diff options
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 15 | ||||
-rw-r--r-- | lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp | 6 | ||||
-rw-r--r-- | lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp | 6 | ||||
-rw-r--r-- | lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp | 20 | ||||
-rw-r--r-- | lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp | 3 | ||||
-rw-r--r-- | lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp | 8 | ||||
-rw-r--r-- | lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp | 15 | ||||
-rw-r--r-- | lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 46 | ||||
-rw-r--r-- | lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp | 12 | ||||
-rw-r--r-- | lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp | 6 | ||||
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 14 | ||||
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp | 9 | ||||
-rw-r--r-- | lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp | 7 |
13 files changed, 94 insertions, 73 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 72fd7e4..3ef3fc5 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -28,6 +28,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/MC/MCSectionMachO.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -260,7 +261,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out labels for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); switch (F->getLinkage()) { default: llvm_unreachable("Unknown linkage type!"); @@ -1162,7 +1163,7 @@ void ARMAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { const MCSection *TheSection = getObjFileLowering().SectionForGlobal(GVar, Mang, TM); - SwitchToSection(TheSection); + OutStreamer.SwitchSection(TheSection); // FIXME: get this stuff from section kind flags. if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal() && @@ -1188,7 +1189,7 @@ void ARMAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { O << TAI->getCOMMDirective() << name << "," << Size << ',' << Align; } else { - SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, Mang,TM)); + OutStreamer.SwitchSection(TheSection); O << "\t.globl " << name << '\n' << TAI->getWeakDefDirective() << name << '\n'; EmitAlignment(Align, GVar); @@ -1297,7 +1298,7 @@ bool ARMAsmPrinter::doFinalization(Module &M) { E = FnStubs.end(); I != E; ++I) { const FnStubInfo &Info = I->second; - SwitchToSection(StubSection); + OutStreamer.SwitchSection(StubSection); EmitAlignment(2); O << "\t.code\t32\n"; @@ -1315,7 +1316,7 @@ bool ARMAsmPrinter::doFinalization(Module &M) { O << "-(" << Info.SCV << "+8)"; O << '\n'; - SwitchToSection(LazySymbolPointerSection); + OutStreamer.SwitchSection(LazySymbolPointerSection); O << Info.LazyPtr << ":\n"; O << "\t.indirect_symbol " << I->getKeyData() << "\n"; O << "\t.long\tdyld_stub_binding_helper\n"; @@ -1326,7 +1327,7 @@ bool ARMAsmPrinter::doFinalization(Module &M) { // Output non-lazy-pointers for external and common global variables. if (!GVNonLazyPtrs.empty()) { // Switch with ".non_lazy_symbol_pointer" directive. - SwitchToSection(TLOFMacho.getNonLazySymbolPointerSection()); + OutStreamer.SwitchSection(TLOFMacho.getNonLazySymbolPointerSection()); EmitAlignment(2); for (StringMap<std::string>::iterator I = GVNonLazyPtrs.begin(), E = GVNonLazyPtrs.end(); I != E; ++I) { @@ -1337,7 +1338,7 @@ bool ARMAsmPrinter::doFinalization(Module &M) { } if (!HiddenGVNonLazyPtrs.empty()) { - SwitchToSection(getObjFileLowering().getDataSection()); + OutStreamer.SwitchSection(getObjFileLowering().getDataSection()); EmitAlignment(2); for (StringMap<std::string>::iterator I = HiddenGVNonLazyPtrs.begin(), E = HiddenGVNonLazyPtrs.end(); I != E; ++I) { diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp index a4690a9..a19661d 100644 --- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp @@ -21,6 +21,7 @@ #include "llvm/Assembly/Writer.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" @@ -138,7 +139,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out labels for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); EmitAlignment(MF.getAlignment(), F); switch (F->getLinkage()) { @@ -210,7 +211,8 @@ void AlphaAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) { unsigned Align = TD->getPreferredAlignmentLog(GVar); // 0: Switch to section - SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GVar, Mang, + TM)); // 1: Check visibility printVisibility(name, GVar->getVisibility()); diff --git a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp index e8e79a4..fd00ea5 100644 --- a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp +++ b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -95,7 +96,8 @@ void BlackfinAsmPrinter::PrintGlobalVariable(const GlobalVariable* GV) { std::string name = Mang->getMangledName(GV); Constant *C = GV->getInitializer(); - SwitchToSection(getObjFileLowering().SectionForGlobal(GV, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GV, Mang, + TM)); emitLinkage(name, GV->getLinkage()); EmitAlignment(TD->getPreferredAlignmentLog(GV), GV); printVisibility(name, GV->getVisibility()); @@ -115,7 +117,7 @@ bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { EmitJumpTableInfo(MF.getJumpTableInfo(), MF); const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); EmitAlignment(2, F); emitLinkage(CurrentFnName, F->getLinkage()); printVisibility(CurrentFnName, F->getVisibility()); diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index 3efcc92..399d430 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -25,13 +25,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" -#include "llvm/Support/Mangler.h" -#include "llvm/Support/MathExtras.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/FormattedStream.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetInstrInfo.h" @@ -40,6 +34,13 @@ #include "llvm/Target/TargetRegistry.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Compiler.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/FormattedStream.h" +#include "llvm/Support/Mangler.h" +#include "llvm/Support/MathExtras.h" #include <set> using namespace llvm; @@ -427,7 +428,7 @@ LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) // Print out labels for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); EmitAlignment(MF.getAlignment(), F); switch (F->getLinkage()) { @@ -512,7 +513,8 @@ void LinuxAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) { unsigned Size = TD->getTypeAllocSize(Type); unsigned Align = TD->getPreferredAlignmentLog(GVar); - SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GVar, Mang, + TM)); if (C->isNullValue() && /* FIXME: Verify correct */ !GVar->hasSection() && diff --git a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp index c746385..73c24ea 100644 --- a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp @@ -26,6 +26,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegistry.h" @@ -78,7 +79,7 @@ namespace { void MSP430AsmPrinter::emitFunctionHeader(const MachineFunction &MF) { const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); unsigned FnAlign = MF.getAlignment(); EmitAlignment(FnAlign, F); diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index 010a299..9df23bc 100644 --- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp @@ -28,6 +28,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -210,7 +211,7 @@ const char *MipsAsmPrinter::emitCurrentABIString() { void MipsAsmPrinter::emitFunctionStart(MachineFunction &MF) { // Print out the label for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); // 2 bits aligned EmitAlignment(MF.getAlignment(), F); @@ -420,7 +421,7 @@ printFCCOperand(const MachineInstr *MI, int opNum, const char *Modifier) { } bool MipsAsmPrinter::doInitialization(Module &M) { - // FIXME: Use SwitchToSection. + // FIXME: Use SwitchSection. // Tell the assembler which ABI we are using O << "\t.section .mdebug." << emitCurrentABIString() << '\n'; @@ -468,7 +469,8 @@ void MipsAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) { printVisibility(name, GVar->getVisibility()); - SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GVar, Mang, + TM)); if (C->isNullValue() && !GVar->hasSection()) { if (!GVar->isThreadLocal() && diff --git a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp index 8dbfffc..1522e4c 100644 --- a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp +++ b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/DwarfWriter.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Support/ErrorHandling.h" @@ -73,7 +74,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { getObjFileLowering().getSectionForFunction(CurrentFnName); // Start the Code Section. O << "\n"; - SwitchToSection(fCodeSection); + OutStreamer.SwitchSection(fCodeSection); // Emit the frame address of the function at the beginning of code. O << "\tretlw low(" << PAN::getFrameLabel(CurrentFnName) << ")\n"; @@ -314,7 +315,7 @@ void PIC16AsmPrinter::EmitRomData(Module &M) { const std::vector<const GlobalVariable*> &Items = ROSections[i]->Items; if (!Items.size()) continue; O << "\n"; - SwitchToSection(PTOF->ROSections[i]->S_); + OutStreamer.SwitchSection(PTOF->ROSections[i]->S_); for (unsigned j = 0; j < Items.size(); j++) { O << Mang->getMangledName(Items[j]); Constant *C = Items[j]->getInitializer(); @@ -341,7 +342,7 @@ void PIC16AsmPrinter::EmitFunctionFrame(MachineFunction &MF) { const MCSection *fPDataSection = getObjFileLowering().getSectionForFunctionFrame(CurrentFnName); - SwitchToSection(fPDataSection); + OutStreamer.SwitchSection(fPDataSection); // Emit function frame label O << PAN::getFrameLabel(CurrentFnName) << ":\n"; @@ -384,7 +385,7 @@ void PIC16AsmPrinter::EmitIData(Module &M) { O << "\n"; if (IDATASections[i]->S_->getName().find("llvm.") != std::string::npos) continue; - SwitchToSection(IDATASections[i]->S_); + OutStreamer.SwitchSection(IDATASections[i]->S_); std::vector<const GlobalVariable*> Items = IDATASections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { std::string Name = Mang->getMangledName(Items[j]); @@ -403,7 +404,7 @@ void PIC16AsmPrinter::EmitUData(Module &M) { const std::vector<PIC16Section*> &BSSSections = PTOF->BSSSections; for (unsigned i = 0; i < BSSSections.size(); i++) { O << "\n"; - SwitchToSection(BSSSections[i]->S_); + OutStreamer.SwitchSection(BSSSections[i]->S_); std::vector<const GlobalVariable*> Items = BSSSections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { std::string Name = Mang->getMangledName(Items[j]); @@ -428,7 +429,7 @@ void PIC16AsmPrinter::EmitAutos(std::string FunctName) { if (AutosSections[i]->S_->getName() == SectionName) { // Set the printing status to true AutosSections[i]->setPrintedStatus(true); - SwitchToSection(AutosSections[i]->S_); + OutStreamer.SwitchSection(AutosSections[i]->S_); const std::vector<const GlobalVariable*> &Items = AutosSections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { std::string VarName = Mang->getMangledName(Items[j]); @@ -460,7 +461,7 @@ void PIC16AsmPrinter::EmitRemainingAutos() { AutosSections[i]->setPrintedStatus(true); O << "\n"; - SwitchToSection(AutosSections[i]->S_); + OutStreamer.SwitchSection(AutosSections[i]->S_); const std::vector<const GlobalVariable*> &Items = AutosSections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { std::string VarName = Mang->getMangledName(Items[j]); diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index 5dca6e6..b56905c 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -32,6 +32,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/MC/MCSectionMachO.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -614,7 +615,7 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out labels for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); switch (F->getLinkage()) { default: llvm_unreachable("Unknown linkage type!"); @@ -675,7 +676,7 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out jump tables referenced by the function. EmitJumpTableInfo(MF.getJumpTableInfo(), MF); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); // Emit post-function debug information. DW->EndFunction(&MF); @@ -703,7 +704,8 @@ void PPCLinuxAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) { unsigned Size = TD->getTypeAllocSize(Type); unsigned Align = TD->getPreferredAlignmentLog(GVar); - SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GVar, Mang, + TM)); if (C->isNullValue() && /* FIXME: Verify correct */ !GVar->hasSection() && @@ -802,7 +804,7 @@ bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out labels for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); switch (F->getLinkage()) { default: llvm_unreachable("Unknown linkage type!"); @@ -894,19 +896,21 @@ bool PPCDarwinAsmPrinter::doInitialization(Module &M) { // large data or debug section causes a branch to exceed 16M limit. TargetLoweringObjectFileMachO &TLOFMacho = static_cast<TargetLoweringObjectFileMachO &>(getObjFileLowering()); - SwitchToSection(TLOFMacho.getTextCoalSection()); + OutStreamer.SwitchSection(TLOFMacho.getTextCoalSection()); if (TM.getRelocationModel() == Reloc::PIC_) { - SwitchToSection(TLOFMacho.getMachOSection("__TEXT", "__picsymbolstub1", - MCSectionMachO::S_SYMBOL_STUBS | - MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, - 32, SectionKind::getText())); + OutStreamer.SwitchSection( + TLOFMacho.getMachOSection("__TEXT", "__picsymbolstub1", + MCSectionMachO::S_SYMBOL_STUBS | + MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, + 32, SectionKind::getText())); } else if (TM.getRelocationModel() == Reloc::DynamicNoPIC) { - SwitchToSection(TLOFMacho.getMachOSection("__TEXT","__symbol_stub1", - MCSectionMachO::S_SYMBOL_STUBS | - MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, - 16, SectionKind::getText())); + OutStreamer.SwitchSection( + TLOFMacho.getMachOSection("__TEXT","__symbol_stub1", + MCSectionMachO::S_SYMBOL_STUBS | + MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, + 16, SectionKind::getText())); } - SwitchToSection(getObjFileLowering().getTextSection()); + OutStreamer.SwitchSection(getObjFileLowering().getTextSection()); return Result; } @@ -938,7 +942,7 @@ void PPCDarwinAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) { const MCSection *TheSection = getObjFileLowering().SectionForGlobal(GVar, Mang, TM); - SwitchToSection(TheSection); + OutStreamer.SwitchSection(TheSection); /// FIXME: Drive this off the section! if (C->isNullValue() && /* FIXME: Verify correct */ @@ -1043,7 +1047,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { 32, SectionKind::getText()); for (StringMap<FnStubInfo>::iterator I = FnStubs.begin(), E = FnStubs.end(); I != E; ++I) { - SwitchToSection(StubSection); + OutStreamer.SwitchSection(StubSection); EmitAlignment(4); const FnStubInfo &Info = I->second; O << Info.Stub << ":\n"; @@ -1060,7 +1064,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { O << "\tmtctr r12\n"; O << "\tbctr\n"; - SwitchToSection(LSPSection); + OutStreamer.SwitchSection(LSPSection); O << Info.LazyPtr << ":\n"; O << "\t.indirect_symbol " << I->getKeyData() << '\n'; O << (isPPC64 ? "\t.quad" : "\t.long") << " dyld_stub_binding_helper\n"; @@ -1074,7 +1078,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { for (StringMap<FnStubInfo>::iterator I = FnStubs.begin(), E = FnStubs.end(); I != E; ++I) { - SwitchToSection(StubSection); + OutStreamer.SwitchSection(StubSection); EmitAlignment(4); const FnStubInfo &Info = I->second; O << Info.Stub << ":\n"; @@ -1084,7 +1088,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { O << Info.LazyPtr << ")(r11)\n"; O << "\tmtctr r12\n"; O << "\tbctr\n"; - SwitchToSection(LSPSection); + OutStreamer.SwitchSection(LSPSection); O << Info.LazyPtr << ":\n"; O << "\t.indirect_symbol " << I->getKeyData() << '\n'; O << (isPPC64 ? "\t.quad" : "\t.long") << " dyld_stub_binding_helper\n"; @@ -1108,7 +1112,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { // Output macho stubs for external and common global variables. if (!GVStubs.empty()) { // Switch with ".non_lazy_symbol_pointer" directive. - SwitchToSection(TLOFMacho.getNonLazySymbolPointerSection()); + OutStreamer.SwitchSection(TLOFMacho.getNonLazySymbolPointerSection()); EmitAlignment(isPPC64 ? 3 : 2); for (StringMap<std::string>::iterator I = GVStubs.begin(), @@ -1120,7 +1124,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { } if (!HiddenGVStubs.empty()) { - SwitchToSection(getObjFileLowering().getDataSection()); + OutStreamer.SwitchSection(getObjFileLowering().getDataSection()); EmitAlignment(isPPC64 ? 3 : 2); for (StringMap<std::string>::iterator I = HiddenGVStubs.begin(), E = HiddenGVStubs.end(); I != E; ++I) { diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp index ff11cdf..d39b6ef 100644 --- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp @@ -24,15 +24,16 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegistry.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/FormattedStream.h" -#include "llvm/Support/Mangler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/FormattedStream.h" +#include "llvm/Support/Mangler.h" #include "llvm/Support/MathExtras.h" #include <cctype> #include <cstring> @@ -95,7 +96,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out the label for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); EmitAlignment(MF.getAlignment(), F); O << "\t.globl\t" << CurrentFnName << '\n'; @@ -227,7 +228,8 @@ void SparcAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { printVisibility(name, GVar->getVisibility()); - SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GVar, Mang, + TM)); if (C->isNullValue() && !GVar->hasSection()) { if (!GVar->isThreadLocal() && diff --git a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp index de6ff96..ae0dce0 100644 --- a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp @@ -26,6 +26,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -84,7 +85,7 @@ void SystemZAsmPrinter::emitFunctionHeader(const MachineFunction &MF) { unsigned FnAlign = MF.getAlignment(); const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); EmitAlignment(FnAlign, F); @@ -317,7 +318,8 @@ void SystemZAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { O << "\t.type\t" << name << ",@object\n"; - SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GVar, Mang, + TM)); if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal() && diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index ca001d3..1e2a6de 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -174,7 +174,7 @@ void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) { if (Subtarget->isTargetCygMing()) DecorateCygMingName(CurrentFnName, F); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); EmitAlignment(FnAlign, F); switch (F->getLinkage()) { @@ -933,7 +933,7 @@ void X86ATTAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GVar, TM); const MCSection *TheSection = getObjFileLowering().SectionForGlobal(GVar, GVKind, Mang, TM); - SwitchToSection(TheSection); + OutStreamer.SwitchSection(TheSection); // FIXME: get this stuff from section kind flags. if (C->isNullValue() && !GVar->hasSection() && @@ -1074,7 +1074,7 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { MCSectionMachO::S_ATTR_SELF_MODIFYING_CODE | MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, 5, SectionKind::getMetadata()); - SwitchToSection(TheSection); + OutStreamer.SwitchSection(TheSection); for (StringMap<std::string>::iterator I = FnStubs.begin(), E = FnStubs.end(); I != E; ++I) O << I->getKeyData() << ":\n" << "\t.indirect_symbol " << I->second @@ -1088,7 +1088,7 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { TLOFMacho.getMachOSection("__IMPORT", "__pointers", MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS, SectionKind::getMetadata()); - SwitchToSection(TheSection); + OutStreamer.SwitchSection(TheSection); for (StringMap<std::string>::iterator I = GVStubs.begin(), E = GVStubs.end(); I != E; ++I) O << I->getKeyData() << ":\n\t.indirect_symbol " @@ -1096,7 +1096,7 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { } if (!HiddenGVStubs.empty()) { - SwitchToSection(getObjFileLowering().getDataSection()); + OutStreamer.SwitchSection(getObjFileLowering().getDataSection()); EmitAlignment(2); for (StringMap<std::string>::iterator I = HiddenGVStubs.begin(), E = HiddenGVStubs.end(); I != E; ++I) @@ -1128,8 +1128,8 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { TargetLoweringObjectFileCOFF &TLOFMacho = static_cast<TargetLoweringObjectFileCOFF&>(getObjFileLowering()); - SwitchToSection(TLOFMacho.getCOFFSection(".section .drectve", true, - SectionKind::getMetadata())); + OutStreamer.SwitchSection(TLOFMacho.getCOFFSection(".section .drectve",true, + SectionKind::getMetadata())); for (StringSet<>::iterator i = DLLExportedGVs.begin(), e = DLLExportedGVs.end(); i != e; ++i) diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp index e9c8cd6..141512e 100644 --- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp @@ -26,11 +26,12 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Assembly/Writer.h" #include "llvm/CodeGen/DwarfWriter.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/Mangler.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/Mangler.h" using namespace llvm; STATISTIC(EmittedInsts, "Number of machine instrs printed"); @@ -143,7 +144,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) { decorateName(CurrentFnName, F); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); switch (F->getLinkage()) { default: llvm_unreachable("Unsupported linkage type!"); @@ -513,7 +514,7 @@ void X86IntelAsmPrinter::PrintGlobalVariable(const GlobalVariable *GV) { O << "\tpublic " << name << "\n"; // FALL THROUGH case GlobalValue::InternalLinkage: - SwitchToSection(getObjFileLowering().getDataSection()); + OutStreamer.SwitchSection(getObjFileLowering().getDataSection()); break; default: llvm_unreachable("Unknown linkage type!"); diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp index 87a09568..8847349 100644 --- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp @@ -27,15 +27,16 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegistry.h" -#include "llvm/Support/Mangler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" +#include "llvm/Support/Mangler.h" #include "llvm/Support/MathExtras.h" #include <algorithm> #include <cctype> @@ -134,7 +135,7 @@ void XCoreAsmPrinter::PrintGlobalVariable(const GlobalVariable *GV) { const TargetData *TD = TM.getTargetData(); - SwitchToSection(getObjFileLowering().SectionForGlobal(GV, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GV, Mang,TM)); std::string name = Mang->getMangledName(GV); Constant *C = GV->getInitializer(); @@ -205,7 +206,7 @@ void XCoreAsmPrinter::emitFunctionStart(MachineFunction &MF) { // Print out the label for the function. const Function *F = MF.getFunction(); - SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); // Mark the start of the function O << "\t.cc_top " << CurrentFnName << ".function," << CurrentFnName << "\n"; |