Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: src/IceELFObjectWriter.cpp

Issue 904783002: Subzero: Convert a few getName() methods to return a const string ref. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceELFSection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===// 1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines the writer for ELF relocatable object files. 10 // This file defines the writer for ELF relocatable object files.
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 534
535 void ELFObjectWriter::writeAllRelocationSections(bool IsELF64) { 535 void ELFObjectWriter::writeAllRelocationSections(bool IsELF64) {
536 writeRelocationSections(IsELF64, RelTextSections); 536 writeRelocationSections(IsELF64, RelTextSections);
537 writeRelocationSections(IsELF64, RelDataSections); 537 writeRelocationSections(IsELF64, RelDataSections);
538 writeRelocationSections(IsELF64, RelRODataSections); 538 writeRelocationSections(IsELF64, RelRODataSections);
539 } 539 }
540 540
541 void ELFObjectWriter::setUndefinedSyms(const ConstantList &UndefSyms) { 541 void ELFObjectWriter::setUndefinedSyms(const ConstantList &UndefSyms) {
542 for (const Constant *S : UndefSyms) { 542 for (const Constant *S : UndefSyms) {
543 const auto Sym = llvm::cast<ConstantRelocatable>(S); 543 const auto Sym = llvm::cast<ConstantRelocatable>(S);
544 IceString Name = Sym->getName(); 544 const IceString &Name = Sym->getName();
545 assert(Sym->getOffset() == 0); 545 assert(Sym->getOffset() == 0);
546 assert(Sym->getSuppressMangling()); 546 assert(Sym->getSuppressMangling());
547 SymTab->noteUndefinedSym(Name, NullSection); 547 SymTab->noteUndefinedSym(Name, NullSection);
548 StrTab->add(Name); 548 StrTab->add(Name);
549 } 549 }
550 } 550 }
551 551
552 void ELFObjectWriter::writeRelocationSections(bool IsELF64, 552 void ELFObjectWriter::writeRelocationSections(bool IsELF64,
553 RelSectionList &RelSections) { 553 RelSectionList &RelSections) {
554 for (ELFRelocationSection *RelSec : RelSections) { 554 for (ELFRelocationSection *RelSec : RelSections) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 if (IsELF64) { 608 if (IsELF64) {
609 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), 609 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(),
610 AllSections.size()); 610 AllSections.size());
611 } else { 611 } else {
612 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), 612 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(),
613 AllSections.size()); 613 AllSections.size());
614 } 614 }
615 } 615 }
616 616
617 } // end of namespace Ice 617 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | src/IceELFSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698