summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-19 05:49:37 +0000
committerChris Lattner <sabre@nondot.org>2009-08-19 05:49:37 +0000
commit4b7dadb76ef179b5d898ab8fad30ad4ceef3c626 (patch)
treeb544b339635830712ebe7a84b4dc944f764cae17 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent21e66abd409145fc49f9b75fc78517364e4b9744 (diff)
downloadbcm5719-llvm-4b7dadb76ef179b5d898ab8fad30ad4ceef3c626.tar.gz
bcm5719-llvm-4b7dadb76ef179b5d898ab8fad30ad4ceef3c626.zip
eliminate AsmPrinter::SwitchToSection and just have clients
talk to the MCStreamer directly instead. llvm-svn: 79405
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 6de6f2b47f4..1762859e324 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -80,13 +80,6 @@ TargetLoweringObjectFile &AsmPrinter::getObjFileLowering() const {
return TM.getTargetLowering()->getObjFileLowering();
}
-/// SwitchToSection - Switch to the specified section of the executable if we
-/// are not already in it!
-void AsmPrinter::SwitchToSection(const MCSection *NS) {
- assert(NS != 0 && "Must specify a section to switch to");
- OutStreamer.SwitchSection(NS);
-}
-
/// getCurrentSection() - Return the current section we are emitting to.
const MCSection *AsmPrinter::getCurrentSection() const {
return OutStreamer.getCurrentSection();
@@ -300,7 +293,7 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
// Now print stuff into the calculated sections.
for (unsigned i = 0, e = CPSections.size(); i != e; ++i) {
- SwitchToSection(CPSections[i].S);
+ OutStreamer.SwitchSection(CPSections[i].S);
EmitAlignment(Log2_32(CPSections[i].Alignment));
unsigned Offset = 0;
@@ -354,12 +347,13 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI,
// function body itself, otherwise the label differences won't make sense.
// We should also do if the section name is NULL or function is declared in
// discardable section.
- SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM));
+ OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang,
+ TM));
} else {
// Otherwise, drop it in the readonly section.
const MCSection *ReadOnlySection =
getObjFileLowering().getSectionForConstant(SectionKind::getReadOnly());
- SwitchToSection(ReadOnlySection);
+ OutStreamer.SwitchSection(ReadOnlySection);
JTInDiffSection = true;
}
@@ -458,14 +452,14 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
const TargetData *TD = TM.getTargetData();
unsigned Align = Log2_32(TD->getPointerPrefAlignment());
if (GV->getName() == "llvm.global_ctors") {
- SwitchToSection(getObjFileLowering().getStaticCtorSection());
+ OutStreamer.SwitchSection(getObjFileLowering().getStaticCtorSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
return true;
}
if (GV->getName() == "llvm.global_dtors") {
- SwitchToSection(getObjFileLowering().getStaticDtorSection());
+ OutStreamer.SwitchSection(getObjFileLowering().getStaticDtorSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
return true;
OpenPOWER on IntegriCloud