diff options
author | Chris Lattner <sabre@nondot.org> | 2004-08-14 23:27:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-08-14 23:27:29 +0000 |
commit | 7bb424fafcfc3452c209556cd764e60b45ae6a5d (patch) | |
tree | 4246f4bc89bb82bd72d537e989195bbd23b5ada7 /lib/Target/PowerPC/PPC32AsmPrinter.cpp | |
parent | b8ce4c4118e07e53c091294001807f9d1d819200 (diff) |
Print mflr using the asmwriter generator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPC32AsmPrinter.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPC32AsmPrinter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPC32AsmPrinter.cpp b/lib/Target/PowerPC/PPC32AsmPrinter.cpp index afe7c35470..a857f3afeb 100644 --- a/lib/Target/PowerPC/PPC32AsmPrinter.cpp +++ b/lib/Target/PowerPC/PPC32AsmPrinter.cpp @@ -27,6 +27,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Mangler.h" #include "Support/CommandLine.h" @@ -82,6 +83,17 @@ namespace { void printMachineInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO, bool LoadAddrOp = false); void printImmOp(const MachineOperand &MO, unsigned ArgType); + + void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){ + const MachineOperand &MO = MI->getOperand(OpNo); + if (MO.getType() == MachineOperand::MO_MachineRegister) { + assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physreg??"); + O << LowercaseString(TM.getRegisterInfo()->get(MO.getReg()).Name); + } else { + printOp(MO); + } + } + void printConstantPool(MachineConstantPool *MCP); bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); |