diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 02:28:11 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 02:28:11 +0000 |
commit | f2812535e429f82cc8f8a714b0be53ab421104f8 (patch) | |
tree | 65ec0506a2ea42c59819337720b89308a7662fc2 /llvm/lib/MC/WinCOFFStreamer.cpp | |
parent | cc497b6ab51e22a10b497b85c941efc30eeb2f7a (diff) | |
download | bcm5719-llvm-f2812535e429f82cc8f8a714b0be53ab421104f8.tar.gz bcm5719-llvm-f2812535e429f82cc8f8a714b0be53ab421104f8.zip |
Inline trivial functions called only once or twice.
llvm-svn: 199967
Diffstat (limited to 'llvm/lib/MC/WinCOFFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/WinCOFFStreamer.cpp | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/llvm/lib/MC/WinCOFFStreamer.cpp b/llvm/lib/MC/WinCOFFStreamer.cpp index 2e090a045e9..6dbe518d1a2 100644 --- a/llvm/lib/MC/WinCOFFStreamer.cpp +++ b/llvm/lib/MC/WinCOFFStreamer.cpp @@ -94,33 +94,6 @@ private: } DF->getContents().append(Code.begin(), Code.end()); } - - const MCSection *getSectionText() { - return getContext().getObjectFileInfo()->getTextSection(); - } - - const MCSection *getSectionData() { - return getContext().getObjectFileInfo()->getDataSection(); - } - - const MCSection *getSectionBSS() { - return getContext().getObjectFileInfo()->getBSSSection(); - } - - void SetSectionText() { - SwitchSection(getSectionText()); - EmitCodeAlignment(4, 0); - } - - void SetSectionData() { - SwitchSection(getSectionData()); - EmitCodeAlignment(4, 0); - } - - void SetSectionBSS() { - SwitchSection(getSectionBSS()); - EmitCodeAlignment(4, 0); - } }; } // end anonymous namespace. @@ -132,7 +105,7 @@ void WinCOFFStreamer::AddCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, bool External) { assert(!Symbol->isInSection() && "Symbol must not already have a section!"); - const MCSection *Section = getSectionBSS(); + const MCSection *Section = getContext().getObjectFileInfo()->getBSSSection(); MCSectionData &SectionData = getAssembler().getOrCreateSectionData(*Section); if (SectionData.getAlignment() < ByteAlignment) SectionData.setAlignment(ByteAlignment); @@ -151,10 +124,19 @@ void WinCOFFStreamer::AddCommonSymbol(MCSymbol *Symbol, uint64_t Size, // MCStreamer interface void WinCOFFStreamer::InitSections() { - SetSectionText(); - SetSectionData(); - SetSectionBSS(); - SetSectionText(); + // FIXME: this is identical to the ELF one. + // This emulates the same behavior of GNU as. This makes it easier + // to compare the output as the major sections are in the same order. + SwitchSection(getContext().getObjectFileInfo()->getTextSection()); + EmitCodeAlignment(4, 0); + + SwitchSection(getContext().getObjectFileInfo()->getDataSection()); + EmitCodeAlignment(4, 0); + + SwitchSection(getContext().getObjectFileInfo()->getBSSSection()); + EmitCodeAlignment(4, 0); + + SwitchSection(getContext().getObjectFileInfo()->getTextSection()); } void WinCOFFStreamer::EmitLabel(MCSymbol *Symbol) { |