Fix up some asserts that are within an if statement. This removes the need
authorRichard Trieu <rtrieu@google.com>
Mon, 1 Jul 2013 23:42:53 +0000 (23:42 +0000)
committerRichard Trieu <rtrieu@google.com>
Mon, 1 Jul 2013 23:42:53 +0000 (23:42 +0000)
for assert(0 && "text").

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

include/llvm/TableGen/Record.h

index 5bf4f4fc5d5d68822faed417e535eb2b96dd8bda..e17cddd9af9cb9bed9fe716d4c6f5210ee0b82bb 100644 (file)
@@ -1798,10 +1798,12 @@ struct LessRecordRegister {
         return LHSPart.second.size() < RHSPart.second.size();
 
       unsigned LHSVal, RHSVal;
-      if (LHSPart.second.getAsInteger(10, LHSVal))
-        assert(0 && "Unable to convert LHS to integer.");
-      if (RHSPart.second.getAsInteger(10, RHSVal))
-        assert(0 && "Unable to convert RHS to integer.");
+
+      bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
+      assert(!LHSFailed && "Unable to convert LHS to integer.");
+      bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
+      assert(!RHSFailed && "Unable to convert RHS to integer.");
+
       if (LHSVal != RHSVal)
         return LHSVal < RHSVal;
     }