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
This commit is contained in:
Rafael Espindola 2014-01-24 02:42:26 +00:00
parent 61e4d529fe
commit b385559db9
7 changed files with 6 additions and 21 deletions

View 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.
///

View 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) {}

View 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);

View 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 =

View File

@ -24,9 +24,6 @@ namespace {
/// @name MCStreamer Interface
/// @{
virtual void InitSections() {
}
virtual void ChangeSection(const MCSection *Section,
const MCExpr *Subsection) {
}

View 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!");

View 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);