diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-02-24 08:30:20 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-02-24 08:30:20 +0000 |
commit | c5437ea42948f1e4cc89c0e8d944a380e6c880e7 (patch) | |
tree | b8172788c0ab3e3f721cb36b1f6ac29499ed2ab0 /llvm/lib/Target/Mips/MipsAsmPrinter.cpp | |
parent | 0b0dcd987da5ea4f557c936616dc65f7adc8e187 (diff) | |
download | bcm5719-llvm-c5437ea42948f1e4cc89c0e8d944a380e6c880e7.tar.gz bcm5719-llvm-c5437ea42948f1e4cc89c0e8d944a380e6c880e7.zip |
Overhaul my earlier submission due to feedback. It's a large patch, but most of
them are generic changes.
- Use the "fast" flag that's already being passed into the asm printers instead
of shoving it into the DwarfWriter.
- Instead of calling "MI->getParent()->getParent()" for every MI, set the
machine function when calling "runOnMachineFunction" in the asm printers.
llvm-svn: 65379
Diffstat (limited to 'llvm/lib/Target/Mips/MipsAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsAsmPrinter.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp index 94cd71a7609..732c5d796ca 100644 --- a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp +++ b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp @@ -46,13 +46,12 @@ using namespace llvm; STATISTIC(EmittedInsts, "Number of machine instrs printed"); namespace { - struct VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter { - + class VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter { const MipsSubtarget *Subtarget; - + public: MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM, - const TargetAsmInfo *T): - AsmPrinter(O, TM, T) { + const TargetAsmInfo *T, bool F) + : AsmPrinter(O, TM, T, F) { Subtarget = &TM.getSubtarget<MipsSubtarget>(); } @@ -91,9 +90,9 @@ namespace { /// using the given target machine description. This should work /// regardless of whether the function is in SSA form. FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o, - MipsTargetMachine &tm) -{ - return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo()); + MipsTargetMachine &tm, + bool fast) { + return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); } //===----------------------------------------------------------------------===// @@ -266,6 +265,8 @@ emitFunctionEnd(MachineFunction &MF) bool MipsAsmPrinter:: runOnMachineFunction(MachineFunction &MF) { + this->MF = &MF; + SetupMachineFunction(MF); // Print out constants referenced by the function |