diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 03:54:40 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 03:54:40 +0000 |
commit | 0e2ccb2df10ae5e7be0983fd1565cbacb19fba33 (patch) | |
tree | 530c63f02c12e6c1346e338bea5fd2f974ee840e /llvm/lib | |
parent | 0e50a883ff369a24f291c2e3b40e6ac1d4742059 (diff) | |
download | bcm5719-llvm-0e2ccb2df10ae5e7be0983fd1565cbacb19fba33.tar.gz bcm5719-llvm-0e2ccb2df10ae5e7be0983fd1565cbacb19fba33.zip |
Simplify the logic for deciding when to initialize the sections.
llvm-svn: 199971
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/MC/MCELFStreamer.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/MC/MCStreamer.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/MC/WinCOFFStreamer.cpp | 4 |
6 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 45f5f583450..cdff074e975 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -163,7 +163,7 @@ bool AsmPrinter::doInitialization(Module &M) { const_cast<TargetLoweringObjectFile&>(getObjFileLowering()) .Initialize(OutContext, TM); - OutStreamer.InitStreamer(); + OutStreamer.InitSections(false); Mang = new Mangler(TM.getDataLayout()); diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 2a92e2312a2..f30c5153359 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -208,7 +208,6 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, *Context, *MAB, Out, MCE, hasMCRelaxAll(), hasMCNoExecStack())); - AsmStreamer.get()->setAutoInitSections(true); break; } case CGFT_Null: diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index 96e14a9a863..f586db34e92 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -128,6 +128,11 @@ public: virtual void ChangeSection(const MCSection *Section, const MCExpr *Subsection); + virtual void InitSections(bool Force) { + if (Force) + SwitchSection(getContext().getObjectFileInfo()->getTextSection()); + } + virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitDebugLabel(MCSymbol *Symbol); diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp index d2c2395a7cf..8c9ad632135 100644 --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/lib/MC/MCELFStreamer.cpp @@ -38,7 +38,7 @@ using namespace llvm; MCELFStreamer::~MCELFStreamer() { } -void MCELFStreamer::InitSections() { +void MCELFStreamer::InitSections(bool Force) { // 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()); diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index 10b2f3f9bd0..0b7c9067190 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -29,8 +29,7 @@ void MCTargetStreamer::emitLabel(MCSymbol *Symbol) {} MCStreamer::MCStreamer(MCContext &Ctx, MCTargetStreamer *TargetStreamer) : Context(Ctx), TargetStreamer(TargetStreamer), EmitEHFrame(true), - EmitDebugFrame(false), CurrentW64UnwindInfo(0), LastSymbol(0), - AutoInitSections(false) { + EmitDebugFrame(false), CurrentW64UnwindInfo(0), LastSymbol(0) { SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>()); if (TargetStreamer) TargetStreamer->setStreamer(this); @@ -201,7 +200,7 @@ void MCStreamer::EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) { } -void MCStreamer::InitSections() { +void MCStreamer::InitSections(bool Force) { SwitchSection(getContext().getObjectFileInfo()->getTextSection()); } diff --git a/llvm/lib/MC/WinCOFFStreamer.cpp b/llvm/lib/MC/WinCOFFStreamer.cpp index 6dbe518d1a2..3f7baf9038e 100644 --- a/llvm/lib/MC/WinCOFFStreamer.cpp +++ b/llvm/lib/MC/WinCOFFStreamer.cpp @@ -50,7 +50,7 @@ public: // MCStreamer interface - virtual void InitSections(); + virtual void InitSections(bool Force); virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitDebugLabel(MCSymbol *Symbol); virtual void EmitAssemblerFlag(MCAssemblerFlag Flag); @@ -123,7 +123,7 @@ void WinCOFFStreamer::AddCommonSymbol(MCSymbol *Symbol, uint64_t Size, // MCStreamer interface -void WinCOFFStreamer::InitSections() { +void WinCOFFStreamer::InitSections(bool Force) { // 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. |