Inline trivial functions called only once or twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199967 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-01-24 02:28:11 +00:00
parent 4296ce5662
commit c5b61da308

View File

@ -94,33 +94,6 @@ private:
} }
DF->getContents().append(Code.begin(), Code.end()); 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. } // end anonymous namespace.
@ -132,7 +105,7 @@ void WinCOFFStreamer::AddCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment, bool External) { unsigned ByteAlignment, bool External) {
assert(!Symbol->isInSection() && "Symbol must not already have a section!"); 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); MCSectionData &SectionData = getAssembler().getOrCreateSectionData(*Section);
if (SectionData.getAlignment() < ByteAlignment) if (SectionData.getAlignment() < ByteAlignment)
SectionData.setAlignment(ByteAlignment); SectionData.setAlignment(ByteAlignment);
@ -151,10 +124,19 @@ void WinCOFFStreamer::AddCommonSymbol(MCSymbol *Symbol, uint64_t Size,
// MCStreamer interface // MCStreamer interface
void WinCOFFStreamer::InitSections() { void WinCOFFStreamer::InitSections() {
SetSectionText(); // FIXME: this is identical to the ELF one.
SetSectionData(); // This emulates the same behavior of GNU as. This makes it easier
SetSectionBSS(); // to compare the output as the major sections are in the same order.
SetSectionText(); 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) { void WinCOFFStreamer::EmitLabel(MCSymbol *Symbol) {