Most streamers' InitSections just create a text section. Make that the default
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 24 Jan 2014 02:42:26 +0000 (02:42 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 24 Jan 2014 02:42:26 +0000 (02:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199969 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCStreamer.h
lib/LTO/LTOModule.cpp
lib/MC/MCAsmStreamer.cpp
lib/MC/MCMachOStreamer.cpp
lib/MC/MCNullStreamer.cpp
lib/MC/MCPureStreamer.cpp
lib/MC/MCStreamer.cpp

index 870cc874b088dd6aad0e625bdd9adeb942bdeee0..78491e85bcefaf03b16a6d511e8e7c4a7ac1d3aa 100644 (file)
@@ -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.
   ///
index 60209539461be8888c389b8bde775a1c8db99bfe..c5c817c2a1d4f9202a0a7cc31a1e7df0f07b53ab 100644 (file)
@@ -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) {}
index 1a82fdebd0bcf332c727f13935903fec4ffe0495..96e14a9a8635a1cae4e3635645a7dddcd5c14755 100644 (file)
@@ -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);
 
index 1386b1ae4b2a36e80d424c27908c3b8a48860d33..d32c7fa8f1649f25f3eb0b911a86b8201cdca966 100644 (file)
@@ -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 =
index 9d98f987d69fc1cea1a4a387d811b91058b79b9a..60ee930d19dabf8a7701632af3b17fb40bf1a23f 100644 (file)
@@ -24,9 +24,6 @@ namespace {
     /// @name MCStreamer Interface
     /// @{
 
-    virtual void InitSections() {
-    }
-
     virtual void ChangeSection(const MCSection *Section,
                                const MCExpr *Subsection) {
     }
index 8bb7a7bd40e2284d96f0d2d0b8f84812b04834f5..179ed1e0e82a220252ef32f299ef744c036b75c6 100644 (file)
@@ -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!");
index 5ba28d2099db8f0628f4c346731f87485dd58ade..10b2f3f9bd0e588c772f752a0f45c0013326f967 100644 (file)
@@ -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);