[llvm-commits] [llvm] r78962 - in /llvm/trunk: include/llvm/Target/TargetRegistry.h lib/CodeGen/LLVMTargetMachine.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
Daniel Dunbar
daniel at zuster.org
Thu Aug 13 16:48:47 PDT 2009
Author: ddunbar
Date: Thu Aug 13 18:48:47 2009
New Revision: 78962
URL: http://llvm.org/viewvc/llvm-project?rev=78962&view=rev
Log:
TargetRegistry: Change AsmPrinter constructor to be typed as returning an
AsmPrinter instance (instead of just a FunctionPass)
Modified:
llvm/trunk/include/llvm/Target/TargetRegistry.h
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
Modified: llvm/trunk/include/llvm/Target/TargetRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegistry.h?rev=78962&r1=78961&r2=78962&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetRegistry.h (original)
+++ llvm/trunk/include/llvm/Target/TargetRegistry.h Thu Aug 13 18:48:47 2009
@@ -24,7 +24,7 @@
#include <cassert>
namespace llvm {
- class FunctionPass;
+ class AsmPrinter;
class MCAsmParser;
class Module;
class TargetAsmInfo;
@@ -51,10 +51,10 @@
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 @@
}
/// 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 @@
}
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);
}
};
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=78962&r1=78961&r2=78962&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 13 18:48:47 2009
@@ -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"
Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=78962&r1=78961&r2=78962&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Thu Aug 13 18:48:47 2009
@@ -1089,10 +1089,10 @@
/// 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())
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp?rev=78962&r1=78961&r2=78962&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Thu Aug 13 18:48:47 2009
@@ -25,10 +25,10 @@
/// 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);
More information about the llvm-commits
mailing list