[llvm] r199969 - Most streamers' InitSections just create a text section. Make that the default
Rafael Espindola
rafael.espindola at gmail.com
Thu Jan 23 18:42:26 PST 2014
Author: rafael
Date: Thu Jan 23 20:42:26 2014
New Revision: 199969
URL: http://llvm.org/viewvc/llvm-project?rev=199969&view=rev
Log:
Most streamers' InitSections just create a text section. Make that the default
Modified:
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/lib/LTO/LTOModule.cpp
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/lib/MC/MCMachOStreamer.cpp
llvm/trunk/lib/MC/MCNullStreamer.cpp
llvm/trunk/lib/MC/MCPureStreamer.cpp
llvm/trunk/lib/MC/MCStreamer.cpp
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=199969&r1=199968&r2=199969&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Thu Jan 23 20:42:26 2014
@@ -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.
///
Modified: llvm/trunk/lib/LTO/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=199969&r1=199968&r2=199969&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)
+++ llvm/trunk/lib/LTO/LTOModule.cpp Thu Jan 23 20:42:26 2014
@@ -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) {}
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=199969&r1=199968&r2=199969&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Thu Jan 23 20:42:26 2014
@@ -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);
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=199969&r1=199968&r2=199969&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Thu Jan 23 20:42:26 2014
@@ -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 =
Modified: llvm/trunk/lib/MC/MCNullStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCNullStreamer.cpp?rev=199969&r1=199968&r2=199969&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCNullStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCNullStreamer.cpp Thu Jan 23 20:42:26 2014
@@ -24,9 +24,6 @@ namespace {
/// @name MCStreamer Interface
/// @{
- virtual void InitSections() {
- }
-
virtual void ChangeSection(const MCSection *Section,
const MCExpr *Subsection) {
}
Modified: llvm/trunk/lib/MC/MCPureStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCPureStreamer.cpp?rev=199969&r1=199968&r2=199969&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCPureStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCPureStreamer.cpp Thu Jan 23 20:42:26 2014
@@ -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!");
Modified: llvm/trunk/lib/MC/MCStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=199969&r1=199968&r2=199969&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCStreamer.cpp Thu Jan 23 20:42:26 2014
@@ -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(con
MCSymbol *EHSymbol) {
}
+void MCStreamer::InitSections() {
+ SwitchSection(getContext().getObjectFileInfo()->getTextSection());
+}
+
void MCStreamer::AssignSection(MCSymbol *Symbol, const MCSection *Section) {
if (Section)
Symbol->setSection(*Section);
More information about the llvm-commits
mailing list