Fix broken asserts that never fire.
authorRichard Trieu <rtrieu@google.com>
Fri, 28 Jun 2013 21:54:25 +0000 (21:54 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 28 Jun 2013 21:54:25 +0000 (21:54 +0000)
Change assert("text") to assert(0 && "text").  The first case is a const char *
to bool conversion, which always evaluates to true, never triggering the
assert.  The second case will always trigger the assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185227 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/TableGen/Record.h
lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp

index a07898a955c77e2e9c3a9af9cd6b4696b9f15b2b..5bf4f4fc5d5d68822faed417e535eb2b96dd8bda 100644 (file)
@@ -1799,9 +1799,9 @@ struct LessRecordRegister {
 
       unsigned LHSVal, RHSVal;
       if (LHSPart.second.getAsInteger(10, LHSVal))
-        assert("Unable to convert LHS to integer.");
+        assert(0 && "Unable to convert LHS to integer.");
       if (RHSPart.second.getAsInteger(10, RHSVal))
-        assert("Unable to convert RHS to integer.");
+        assert(0 && "Unable to convert RHS to integer.");
       if (LHSVal != RHSVal)
         return LHSVal < RHSVal;
     }
index 36da6dfcc3d0ee4d0973e634df758a33582deb13..3105665c9401ef84e197f91c9ed32bc59dd25b88 100644 (file)
@@ -179,7 +179,7 @@ void HexagonInstPrinter::printBranchOperand(const MCInst *MI, unsigned OpNo,
                                             raw_ostream &O) const {
   // Branches can take an immediate operand.  This is used by the branch
   // selection pass to print $+8, an eight byte displacement from the PC.
-  assert("Unknown branch operand.");
+  assert(0 && "Unknown branch operand.");
 }
 
 void HexagonInstPrinter::printCallOperand(const MCInst *MI, unsigned OpNo,
@@ -203,7 +203,7 @@ void HexagonInstPrinter::printSymbol(const MCInst *MI, unsigned OpNo,
     O << '#';
     printOperand(MI, OpNo, O);
   } else {
-    assert("Unknown symbol operand");
+    assert(0 && "Unknown symbol operand");
     printOperand(MI, OpNo, O);
   }
   O << ')';