#include <cassert>
namespace llvm {
- class FunctionPass;
+ class AsmPrinter;
class MCAsmParser;
class Module;
class TargetAsmInfo;
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:
}
/// 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);
}
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);
}
};
#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"
/// 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())
/// 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);