[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp

Evan Cheng evan.cheng at apple.com
Thu May 3 16:30:54 PDT 2007



Changes in directory llvm/lib/Target/ARM:

ARMAsmPrinter.cpp updated: 1.71 -> 1.72
---
Log message:

Should never see an indexed load / store with zero offset.

---
Diffs of the changes:  (+7 -5)

 ARMAsmPrinter.cpp |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp
diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.71 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.72
--- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.71	Thu May  3 15:28:35 2007
+++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp	Thu May  3 18:30:36 2007
@@ -433,10 +433,11 @@
   const MachineOperand &MO2 = MI->getOperand(Op+1);
 
   if (!MO1.getReg()) {
-    if (ARM_AM::getAM2Offset(MO2.getImm()))  // Don't print +0.
-      O << "#"
-        << (char)ARM_AM::getAM2Op(MO2.getImm())
-        << ARM_AM::getAM2Offset(MO2.getImm());
+    unsigned ImmOffs = ARM_AM::getAM2Offset(MO2.getImm());
+    assert(ImmOffs && "Malformed indexed load / store!");
+    O << "#"
+      << (char)ARM_AM::getAM2Op(MO2.getImm())
+      << ImmOffs;
     return;
   }
 
@@ -483,8 +484,9 @@
   }
 
   unsigned ImmOffs = ARM_AM::getAM3Offset(MO2.getImm());
+  assert(ImmOffs && "Malformed indexed load / store!");
   O << "#"
-  << (char)ARM_AM::getAM3Op(MO2.getImm())
+    << (char)ARM_AM::getAM3Op(MO2.getImm())
     << ImmOffs;
 }
   






More information about the llvm-commits mailing list