llvm.org GIT mirror llvm / 7894578
TargetRegistry: Change AsmPrinter constructor to be typed as returning an AsmPrinter instance (instead of just a FunctionPass) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78962 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 10 years ago
4 changed file(s) with 18 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
2323 #include
2424
2525 namespace llvm {
26 class FunctionPass;
26 class AsmPrinter;
2727 class MCAsmParser;
2828 class Module;
2929 class TargetAsmInfo;
5050 typedef TargetMachine *(*TargetMachineCtorTy)(const Target &T,
5151 const std::string &TT,
5252 const std::string &Features);
53 typedef FunctionPass *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS,
54 TargetMachine &TM,
55 const TargetAsmInfo *TAI,
56 bool VerboseAsm);
53 typedef AsmPrinter *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS,
54 TargetMachine &TM,
55 const TargetAsmInfo *TAI,
56 bool VerboseAsm);
5757 typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,
5858 MCAsmParser &P);
5959 private:
138138 }
139139
140140 /// createAsmPrinter - Create a target specific assembly printer pass.
141 FunctionPass *createAsmPrinter(formatted_raw_ostream &OS,
142 TargetMachine &TM,
143 const TargetAsmInfo *TAI,
144 bool Verbose) const {
141 AsmPrinter *createAsmPrinter(formatted_raw_ostream &OS, TargetMachine &TM,
142 const TargetAsmInfo *TAI, bool Verbose) const {
145143 if (!AsmPrinterCtorFn)
146144 return 0;
147145 return AsmPrinterCtorFn(OS, TM, TAI, Verbose);
406404 }
407405
408406 private:
409 static FunctionPass *Allocator(formatted_raw_ostream &OS,
410 TargetMachine &TM,
411 const TargetAsmInfo *TAI,
412 bool Verbose) {
407 static AsmPrinter *Allocator(formatted_raw_ostream &OS, TargetMachine &TM,
408 const TargetAsmInfo *TAI, bool Verbose) {
413409 return new AsmPrinterImpl(OS, TM, TAI, Verbose);
414410 }
415411 };
1414 #include "llvm/PassManager.h"
1515 #include "llvm/Pass.h"
1616 #include "llvm/Assembly/PrintModulePass.h"
17 #include "llvm/CodeGen/AsmPrinter.h"
1718 #include "llvm/CodeGen/Passes.h"
1819 #include "llvm/CodeGen/GCStrategy.h"
1920 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
10881088 /// for a MachineFunction to the given output stream, in a format that the
10891089 /// Darwin assembler can deal with.
10901090 ///
1091 static FunctionPass *createPPCAsmPrinterPass(formatted_raw_ostream &o,
1092 TargetMachine &tm,
1093 const TargetAsmInfo *tai,
1094 bool verbose) {
1091 static AsmPrinter *createPPCAsmPrinterPass(formatted_raw_ostream &o,
1092 TargetMachine &tm,
1093 const TargetAsmInfo *tai,
1094 bool verbose) {
10951095 const PPCSubtarget *Subtarget = &tm.getSubtarget();
10961096
10971097 if (Subtarget->isDarwin())
2424 /// for a MachineFunction to the given output stream, using the given target
2525 /// machine description.
2626 ///
27 static FunctionPass *createX86CodePrinterPass(formatted_raw_ostream &o,
28 TargetMachine &tm,
29 const TargetAsmInfo *tai,
30 bool verbose) {
27 static AsmPrinter *createX86CodePrinterPass(formatted_raw_ostream &o,
28 TargetMachine &tm,
29 const TargetAsmInfo *tai,
30 bool verbose) {
3131 if (tm.getTargetAsmInfo()->getAssemblerDialect() == 1)
3232 return new X86IntelAsmPrinter(o, tm, tai, verbose);
3333 return new X86ATTAsmPrinter(o, tm, tai, verbose);