[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Feb 24 12:22:10 PST 2006



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.54 -> 1.55
---
Log message:

Use the PrintAsmMemoryOperand to print addressing modes.


---
Diffs of the changes:  (+19 -4)

 AsmPrinter.cpp |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.54 llvm/lib/CodeGen/AsmPrinter.cpp:1.55
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.54	Fri Feb 24 13:50:58 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Fri Feb 24 14:21:58 2006
@@ -580,11 +580,19 @@
           OpNo += (OpFlags >> 3) + 1;
         }
         
+        unsigned OpFlags = MI->getOperand(OpNo).getImmedValue();
         ++OpNo;  // Skip over the ID number.
-        
-        if (const_cast<AsmPrinter*>(this)->
-                PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
-                                Modifier[0] ? Modifier : 0)) {
+
+        bool Error;
+        AsmPrinter *AP = const_cast<AsmPrinter*>(this);
+        if ((OpFlags & 7) == 4 /*ADDR MODE*/) {
+          Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant,
+                                            Modifier[0] ? Modifier : 0);
+        } else {
+          Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
+                                      Modifier[0] ? Modifier : 0);
+        }
+        if (Error) {
           std::cerr << "Invalid operand found in inline asm: '"
                     << AsmStr << "'\n";
           MI->dump();
@@ -633,3 +641,10 @@
   // Target doesn't support this yet!
   return true;
 }
+
+bool AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
+                                       unsigned AsmVariant,
+                                       const char *ExtraCode) {
+  // Target doesn't support this yet!
+  return true;
+}






More information about the llvm-commits mailing list