diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 02:42:26 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 02:42:26 +0000 |
commit | b385559db946cf0838494409dc98183f3989f8a8 (patch) | |
tree | bdbd99fd49c5dce4ee73428375bca1e9913298b2 | |
parent | 61e4d529fe641125c10cbad7db0b2ce584534cf4 (diff) | |
download | llvm-b385559db946cf0838494409dc98183f3989f8a8.tar.gz llvm-b385559db946cf0838494409dc98183f3989f8a8.tar.bz2 llvm-b385559db946cf0838494409dc98183f3989f8a8.tar.xz |
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
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 2 | ||||
-rw-r--r-- | lib/LTO/LTOModule.cpp | 3 | ||||
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 4 | ||||
-rw-r--r-- | lib/MC/MCMachOStreamer.cpp | 5 | ||||
-rw-r--r-- | lib/MC/MCNullStreamer.cpp | 3 | ||||
-rw-r--r-- | lib/MC/MCPureStreamer.cpp | 5 | ||||
-rw-r--r-- | lib/MC/MCStreamer.cpp | 5 |
7 files changed, 6 insertions, 21 deletions
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 870cc874b0..78491e85bc 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 6020953946..c5c817c2a1 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 1a82fdebd0..96e14a9a86 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 1386b1ae4b..d32c7fa8f1 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 9d98f987d6..60ee930d19 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 8bb7a7bd40..179ed1e0e8 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 5ba28d2099..10b2f3f9bd 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); |