[llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp X86InstrInfo.cpp X86InstrInfo.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Nov 17 16:54:04 PST 2002
Changes in directory llvm/lib/Target/X86:
Printer.cpp updated: 1.4 -> 1.5
X86InstrInfo.cpp updated: 1.5 -> 1.6
X86InstrInfo.h updated: 1.6 -> 1.7
---
Log message:
Reorganize printing interface a bit
---
Diffs of the changes:
Index: llvm/lib/Target/X86/Printer.cpp
diff -u llvm/lib/Target/X86/Printer.cpp:1.4 llvm/lib/Target/X86/Printer.cpp:1.5
--- llvm/lib/Target/X86/Printer.cpp:1.4 Thu Nov 14 16:32:30 2002
+++ llvm/lib/Target/X86/Printer.cpp Sun Nov 17 16:53:13 2002
@@ -11,7 +11,7 @@
#include "llvm/Function.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include <iostream>
+#include "llvm/CodeGen/MachineInstr.h"
namespace {
struct Printer : public FunctionPass {
@@ -24,6 +24,15 @@
};
}
+/// createX86CodePrinterPass - Print out the specified machine code function to
+/// the specified stream. This function should work regardless of whether or
+/// not the function is in SSA form or not.
+///
+Pass *createX86CodePrinterPass(TargetMachine &TM, std::ostream &O) {
+ return new Printer(TM, O);
+}
+
+
/// runOnFunction - This uses the X86InstructionInfo::print method
/// to print assembly for each instruction.
bool Printer::runOnFunction (Function & F)
@@ -31,9 +40,8 @@
static unsigned bbnumber = 0;
MachineFunction & MF = MachineFunction::get (&F);
const MachineInstrInfo & MII = TM.getInstrInfo ();
- const X86InstrInfo & x86ii = dynamic_cast <const X86InstrInfo &> (MII);
- O << "# x86 printing not implemented yet!\n";
+ O << "# x86 printing only sorta implemented so far!\n";
// Print out labels for the function.
O << "\t.globl\t" << F.getName () << "\n";
@@ -51,7 +59,7 @@
{
// Print the assembly for the instruction.
O << "\t";
- x86ii.print (*i_i, O);
+ MII.print(*i_i, O);
}
}
@@ -59,10 +67,9 @@
return false;
}
-/// createX86CodePrinterPass - Print out the specified machine code function to
-/// the specified stream. This function should work regardless of whether or
-/// not the function is in SSA form or not.
-///
-Pass *createX86CodePrinterPass(TargetMachine &TM, std::ostream &O) {
- return new Printer(TM, O);
+
+// print - Print out an x86 instruction in intel syntax
+void X86InstrInfo::print(const MachineInstr *MI, std::ostream &O) const {
+ // FIXME: This sucks.
+ O << getName(MI->getOpCode()) << "\n";
}
Index: llvm/lib/Target/X86/X86InstrInfo.cpp
diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.5 llvm/lib/Target/X86/X86InstrInfo.cpp:1.6
--- llvm/lib/Target/X86/X86InstrInfo.cpp:1.5 Tue Oct 29 19:15:31 2002
+++ llvm/lib/Target/X86/X86InstrInfo.cpp Sun Nov 17 16:53:13 2002
@@ -25,9 +25,3 @@
}
-// print - Print out an x86 instruction in GAS syntax
-void X86InstrInfo::print(const MachineInstr *MI, std::ostream &O) const {
- // FIXME: This sucks.
- O << getName(MI->getOpCode()) << "\n";
-}
-
Index: llvm/lib/Target/X86/X86InstrInfo.h
diff -u llvm/lib/Target/X86/X86InstrInfo.h:1.6 llvm/lib/Target/X86/X86InstrInfo.h:1.7
--- llvm/lib/Target/X86/X86InstrInfo.h:1.6 Tue Oct 29 19:09:34 2002
+++ llvm/lib/Target/X86/X86InstrInfo.h Sun Nov 17 16:53:13 2002
@@ -30,7 +30,7 @@
///
virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
- /// print - Print out an x86 instruction in GAS syntax
+ /// print - Print out an x86 instruction in intel syntax
///
virtual void print(const MachineInstr *MI, std::ostream &O) const;
More information about the llvm-commits
mailing list