The DarwinAsmPrinter need not check for isDarwin. createPPCAsmPrinterPass
authorChris Lattner <sabre@nondot.org>
Wed, 20 Sep 2006 17:12:19 +0000 (17:12 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 20 Sep 2006 17:12:19 +0000 (17:12 +0000)
should create the right asmprinter subclass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30542 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPC.h
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCTargetMachine.cpp

index 4cd540bf37609f34b8ff8ee2b0a4a05d24fd6a1e..8fef9662010cb21ccb30c577a44067b4584f4e89 100644 (file)
@@ -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, 
index e04e72d7499edd0214ee85e146b3c0dfb84b23f0..35244632eb5a824f2f17b082f4916b4c4130da76 100644 (file)
@@ -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());
+}
+
index 9075abc7db0d2ec4f9d17eaa62429197c57ba6c5..954d15c5b69a2fff843c3a0bad2eb985e714c448 100644 (file)
@@ -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;
 }