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

Side by Side Diff: src/IceELFObjectWriter.cpp

Issue 1197223002: Subzero: Use C++11 member initializers where practical. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 6 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 | « src/IceELFObjectWriter.h ('k') | 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 uint32_t getELFFlags(TargetArch Arch) { 57 uint32_t getELFFlags(TargetArch Arch) {
58 if (Arch < TargetArch_NUM) 58 if (Arch < TargetArch_NUM)
59 return ELFTargetInfo[Arch].ELFFlags; 59 return ELFTargetInfo[Arch].ELFFlags;
60 llvm_unreachable("Invalid target arch for getELFFlags"); 60 llvm_unreachable("Invalid target arch for getELFFlags");
61 return 0; 61 return 0;
62 } 62 }
63 63
64 } // end of anonymous namespace 64 } // end of anonymous namespace
65 65
66 ELFObjectWriter::ELFObjectWriter(GlobalContext &Ctx, ELFStreamer &Out) 66 ELFObjectWriter::ELFObjectWriter(GlobalContext &Ctx, ELFStreamer &Out)
67 : Ctx(Ctx), Str(Out), SectionNumbersAssigned(false), 67 : Ctx(Ctx), Str(Out), ELF64(isELF64(Ctx.getFlags().getTargetArch())) {
68 ELF64(isELF64(Ctx.getFlags().getTargetArch())) {
69 // Create the special bookkeeping sections now. 68 // Create the special bookkeeping sections now.
70 const IceString NullSectionName(""); 69 const IceString NullSectionName("");
71 NullSection = new (Ctx.allocate<ELFSection>()) 70 NullSection = new (Ctx.allocate<ELFSection>())
72 ELFSection(NullSectionName, SHT_NULL, 0, 0, 0); 71 ELFSection(NullSectionName, SHT_NULL, 0, 0, 0);
73 72
74 const IceString ShStrTabName(".shstrtab"); 73 const IceString ShStrTabName(".shstrtab");
75 ShStrTab = new (Ctx.allocate<ELFStringTableSection>()) 74 ShStrTab = new (Ctx.allocate<ELFStringTableSection>())
76 ELFStringTableSection(ShStrTabName, SHT_STRTAB, 0, 1, 0); 75 ELFStringTableSection(ShStrTabName, SHT_STRTAB, 0, 1, 0);
77 ShStrTab->add(ShStrTabName); 76 ShStrTab->add(ShStrTabName);
78 77
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 if (ELF64) { 617 if (ELF64) {
619 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), 618 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(),
620 AllSections.size()); 619 AllSections.size());
621 } else { 620 } else {
622 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), 621 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(),
623 AllSections.size()); 622 AllSections.size());
624 } 623 }
625 } 624 }
626 625
627 } // end of namespace Ice 626 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceELFObjectWriter.h ('k') | src/IceELFSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698