From: Rafael Espindola Date: Fri, 24 Jan 2014 02:42:26 +0000 (+0000) Subject: Most streamers' InitSections just create a text section. Make that the default X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b385559db946cf0838494409dc98183f3989f8a8;p=oota-llvm.git Most streamers' InitSections just create a text section. Make that the default git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199969 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 870cc874b08..78491e85bce 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -342,7 +342,7 @@ public: } /// InitSections - Create the default sections and set the initial one. - virtual void InitSections() = 0; + virtual void InitSections(); /// AssignSection - Sets the symbol's section. /// diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp index 60209539461..c5c817c2a1d 100644 --- a/lib/LTO/LTOModule.cpp +++ b/lib/LTO/LTOModule.cpp @@ -663,9 +663,6 @@ namespace { // Noop calls. virtual void ChangeSection(const MCSection *Section, const MCExpr *Subsection) {} - virtual void InitSections() { - SwitchSection(getContext().getObjectFileInfo()->getTextSection()); - } virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {} virtual void EmitThumbFunc(MCSymbol *Func) {} virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {} diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 1a82fdebd0b..96e14a9a863 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -128,10 +128,6 @@ public: virtual void ChangeSection(const MCSection *Section, const MCExpr *Subsection); - virtual void InitSections() { - SwitchSection(getContext().getObjectFileInfo()->getTextSection()); - } - virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitDebugLabel(MCSymbol *Symbol); diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp index 1386b1ae4b2..d32c7fa8f16 100644 --- a/lib/MC/MCMachOStreamer.cpp +++ b/lib/MC/MCMachOStreamer.cpp @@ -43,7 +43,6 @@ public: /// @name MCStreamer Interface /// @{ - virtual void InitSections(); virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitDebugLabel(MCSymbol *Symbol); virtual void EmitEHSymAttributes(const MCSymbol *Symbol, @@ -94,10 +93,6 @@ public: } // end anonymous namespace. -void MCMachOStreamer::InitSections() { - SwitchSection(getContext().getObjectFileInfo()->getTextSection()); -} - void MCMachOStreamer::EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) { MCSymbolData &SD = diff --git a/lib/MC/MCNullStreamer.cpp b/lib/MC/MCNullStreamer.cpp index 9d98f987d69..60ee930d19d 100644 --- a/lib/MC/MCNullStreamer.cpp +++ b/lib/MC/MCNullStreamer.cpp @@ -24,9 +24,6 @@ namespace { /// @name MCStreamer Interface /// @{ - virtual void InitSections() { - } - virtual void ChangeSection(const MCSection *Section, const MCExpr *Subsection) { } diff --git a/lib/MC/MCPureStreamer.cpp b/lib/MC/MCPureStreamer.cpp index 8bb7a7bd40e..179ed1e0e82 100644 --- a/lib/MC/MCPureStreamer.cpp +++ b/lib/MC/MCPureStreamer.cpp @@ -34,7 +34,6 @@ public: /// @name MCStreamer Interface /// @{ - virtual void InitSections(); virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitDebugLabel(MCSymbol *Symbol); virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0, @@ -104,10 +103,6 @@ public: } // end anonymous namespace. -void MCPureStreamer::InitSections() { - SwitchSection(getContext().getObjectFileInfo()->getTextSection()); -} - void MCPureStreamer::EmitLabel(MCSymbol *Symbol) { assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); assert(!Symbol->isVariable() && "Cannot emit a variable symbol!"); diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 5ba28d2099d..10b2f3f9bd0 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -14,6 +14,7 @@ #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCObjectFileInfo.h" #include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Support/ErrorHandling.h" @@ -200,6 +201,10 @@ void MCStreamer::EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) { } +void MCStreamer::InitSections() { + SwitchSection(getContext().getObjectFileInfo()->getTextSection()); +} + void MCStreamer::AssignSection(MCSymbol *Symbol, const MCSection *Section) { if (Section) Symbol->setSection(*Section);