[llvm-commits] [llvm] r98928 - /llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp

Daniel Dunbar daniel at zuster.org
Thu Mar 18 20:18:23 PDT 2010


Author: ddunbar
Date: Thu Mar 18 22:18:23 2010
New Revision: 98928

URL: http://llvm.org/viewvc/llvm-project?rev=98928&view=rev
Log:
Fix -Asserts warnings.

Modified:
    llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp

Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp?rev=98928&r1=98927&r2=98928&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp Thu Mar 18 22:18:23 2010
@@ -30,6 +30,9 @@
 
 static unsigned NextReg(unsigned Reg) {
   switch (Reg) {
+  default:
+    assert(0 && "Unexpected register enum");
+
   case ARM::D0:
     return ARM::D1;
   case ARM::D1:
@@ -92,9 +95,6 @@
     return ARM::D30;
   case ARM::D30:
     return ARM::D31;
-
-  default:
-    assert(0 && "Unexpected register enum");
   }
 }
 
@@ -212,8 +212,7 @@
       O << getRegisterName(Reg);
     }
   } else if (Op.isImm()) {
-    bool isCallOp = Modifier && !strcmp(Modifier, "call");
-    assert(isCallOp ||
+    assert((Modifier && !strcmp(Modifier, "call")) ||
            ((Modifier == 0 || Modifier[0] == 0) && "No modifiers supported"));
     O << '#' << Op.getImm();
   } else {





More information about the llvm-commits mailing list