TargetRegistry: Change AsmPrinter constructor to be typed as returning an
authorDaniel Dunbar <daniel@zuster.org>
Thu, 13 Aug 2009 23:48:47 +0000 (23:48 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 13 Aug 2009 23:48:47 +0000 (23:48 +0000)
AsmPrinter instance (instead of just a FunctionPass)

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

include/llvm/Target/TargetRegistry.h
lib/CodeGen/LLVMTargetMachine.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp

index bfb23ef930f7364e1dbc984fb715ff1539575741..ebdb36c26ecd0df239d56ac76fa88734bb10d294 100644 (file)
@@ -24,7 +24,7 @@
 #include <cassert>
 
 namespace llvm {
-  class FunctionPass;
+  class AsmPrinter;
   class MCAsmParser;
   class Module;
   class TargetAsmInfo;
@@ -51,10 +51,10 @@ namespace llvm {
     typedef TargetMachine *(*TargetMachineCtorTy)(const Target &T,
                                                   const std::string &TT,
                                                   const std::string &Features);
-    typedef FunctionPass *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS,
-                                              TargetMachine &TM,
-                                              const TargetAsmInfo *TAI,
-                                              bool VerboseAsm);
+    typedef AsmPrinter *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS,
+                                            TargetMachine &TM,
+                                            const TargetAsmInfo *TAI,
+                                            bool VerboseAsm);
     typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,
                                                 MCAsmParser &P);
   private:
@@ -139,10 +139,8 @@ namespace llvm {
     }
 
     /// createAsmPrinter - Create a target specific assembly printer pass.
-    FunctionPass *createAsmPrinter(formatted_raw_ostream &OS,
-                                   TargetMachine &TM,
-                                   const TargetAsmInfo *TAI,
-                                   bool Verbose) const {
+    AsmPrinter *createAsmPrinter(formatted_raw_ostream &OS, TargetMachine &TM,
+                                 const TargetAsmInfo *TAI, bool Verbose) const {
       if (!AsmPrinterCtorFn)
         return 0;
       return AsmPrinterCtorFn(OS, TM, TAI, Verbose);
@@ -407,10 +405,8 @@ namespace llvm {
     }
 
   private:
-    static FunctionPass *Allocator(formatted_raw_ostream &OS,
-                                   TargetMachine &TM,
-                                   const TargetAsmInfo *TAI,
-                                   bool Verbose) {
+    static AsmPrinter *Allocator(formatted_raw_ostream &OS, TargetMachine &TM,
+                                 const TargetAsmInfo *TAI, bool Verbose) {
       return new AsmPrinterImpl(OS, TM, TAI, Verbose);
     }
   };
index cafe4d3f14b5f6c65d3ddd05a652510d6689e47d..b0c3b80c9c6a7f7349aa272a10c800da26616278 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/PassManager.h"
 #include "llvm/Pass.h"
 #include "llvm/Assembly/PrintModulePass.h"
+#include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/CodeGen/GCStrategy.h"
 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
index 4a44f4cb79b8458c3364763b31b7d562608f1a02..efbf7492480b21d063fad080159d75a0d1e2f43d 100644 (file)
@@ -1089,10 +1089,10 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
 /// for a MachineFunction to the given output stream, in a format that the
 /// Darwin assembler can deal with.
 ///
-static FunctionPass *createPPCAsmPrinterPass(formatted_raw_ostream &o,
-                                             TargetMachine &tm,
-                                             const TargetAsmInfo *tai,
-                                             bool verbose) {
+static AsmPrinter *createPPCAsmPrinterPass(formatted_raw_ostream &o,
+                                           TargetMachine &tm,
+                                           const TargetAsmInfo *tai,
+                                           bool verbose) {
   const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>();
 
   if (Subtarget->isDarwin())
index f232159518536b578070a57877c5a40c69bffa8d..2e769a4d95ef41cda2170b08ec4ecba07d3acee0 100644 (file)
@@ -25,10 +25,10 @@ using namespace llvm;
 /// for a MachineFunction to the given output stream, using the given target
 /// machine description.
 ///
-static FunctionPass *createX86CodePrinterPass(formatted_raw_ostream &o,
-                                              TargetMachine &tm,
-                                              const TargetAsmInfo *tai,
-                                              bool verbose) {
+static AsmPrinter *createX86CodePrinterPass(formatted_raw_ostream &o,
+                                            TargetMachine &tm,
+                                            const TargetAsmInfo *tai,
+                                            bool verbose) {
   if (tm.getTargetAsmInfo()->getAssemblerDialect() == 1)
     return new X86IntelAsmPrinter(o, tm, tai, verbose);
   return new X86ATTAsmPrinter(o, tm, tai, verbose);