diff --git a/lib/Target/PowerPC/PPC.h b/lib/Target/PowerPC/PPC.h index 4cd540bf376..8fef9662010 100644 --- a/lib/Target/PowerPC/PPC.h +++ b/lib/Target/PowerPC/PPC.h @@ -26,8 +26,8 @@ class MachineCodeEmitter; FunctionPass *createPPCBranchSelectionPass(); FunctionPass *createPPCISelDag(PPCTargetMachine &TM); -FunctionPass *createDarwinCodePrinterPass(std::ostream &OS, - PPCTargetMachine &TM); +FunctionPass *createPPCAsmPrinterPass(std::ostream &OS, + PPCTargetMachine &TM); FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM, MachineCodeEmitter &MCE); void addPPCMachOObjectWriterPass(FunctionPassManager &FPM, std::ostream &o, diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index e04e72d7499..35244632eb5 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -270,15 +270,6 @@ namespace { }; } // end of anonymous namespace -/// createDarwinCodePrinterPass - Returns a pass that prints the PPC assembly -/// code for a MachineFunction to the given output stream, in a format that the -/// Darwin assembler can deal with. -/// -FunctionPass *llvm::createDarwinCodePrinterPass(std::ostream &o, - PPCTargetMachine &tm) { - return new DarwinAsmPrinter(o, tm, tm.getTargetAsmInfo()); -} - // Include the auto-generated portion of the assembly writer #include "PPCGenAsmWriter.inc" @@ -639,10 +630,20 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { // implementation of multiple entry points). If this doesn't occur, the // linker can safely perform dead code stripping. Since LLVM never generates // code that does this, it is always safe to set. - if (Subtarget.isDarwin()) - O << "\t.subsections_via_symbols\n"; + O << "\t.subsections_via_symbols\n"; AsmPrinter::doFinalization(M); return false; // success } + + +/// createDarwinCodePrinterPass - Returns a pass that prints the PPC assembly +/// code for a MachineFunction to the given output stream, in a format that the +/// Darwin assembler can deal with. +/// +FunctionPass *llvm::createPPCAsmPrinterPass(std::ostream &o, + PPCTargetMachine &tm) { + return new DarwinAsmPrinter(o, tm, tm.getTargetAsmInfo()); +} + diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 9075abc7db0..954d15c5b69 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -122,7 +122,7 @@ bool PPCTargetMachine::addPreEmitPass(FunctionPassManager &PM, bool Fast) { bool PPCTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out) { - PM.add(createDarwinCodePrinterPass(Out, *this)); + PM.add(createPPCAsmPrinterPass(Out, *this)); return false; }