[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Feb 24 12:27:52 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCAsmPrinter.cpp updated: 1.155 -> 1.156
---
Log message:

Add memory printing support for PPC.  Input memory operands now work with
inline asms! :)


---
Diffs of the changes:  (+12 -1)

 PPCAsmPrinter.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.155 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.156
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.155	Thu Feb 23 13:31:10 2006
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp	Fri Feb 24 14:27:40 2006
@@ -98,6 +98,9 @@
     
     bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
                          unsigned AsmVariant, const char *ExtraCode);
+    bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
+                               unsigned AsmVariant, const char *ExtraCode);
+    
     
     void printU5ImmOperand(const MachineInstr *MI, unsigned OpNo) {
       unsigned char value = MI->getOperand(OpNo).getImmedValue();
@@ -187,7 +190,7 @@
       unsigned RegNo = enumRegToMachineReg(CCReg);
       O << (0x80 >> RegNo);
     }
-    // The new addressing mode printers, currently empty
+    // The new addressing mode printers.
     void printMemRegImm(const MachineInstr *MI, unsigned OpNo) {
       printSymbolLo(MI, OpNo);
       O << '(';
@@ -419,6 +422,14 @@
   return false;
 }
 
+bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
+                                          unsigned AsmVariant, 
+                                          const char *ExtraCode) {
+  if (ExtraCode && ExtraCode[0])
+    return true; // Unknown modifier.
+  printMemRegReg(MI, OpNo);
+  return false;
+}
 
 /// printMachineInstruction -- Print out a single PowerPC MI in Darwin syntax to
 /// the current output stream.






More information about the llvm-commits mailing list