aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorEdwin Török <edwintorok@gmail.com>2009-07-11 20:10:48 +0000
committerEdwin Török <edwintorok@gmail.com>2009-07-11 20:10:48 +0000
commit675d56222b6b98d2c22a17aaf69a036e57d5426a (patch)
treee4bb95c96a33fda5d5204f2c9d1b906084760415 /lib/Support/APInt.cpp
parent3f6e3ffc36c9dd4c10056c7262de77f6c4a115c7 (diff)
downloadexternal_llvm-675d56222b6b98d2c22a17aaf69a036e57d5426a.zip
external_llvm-675d56222b6b98d2c22a17aaf69a036e57d5426a.tar.gz
external_llvm-675d56222b6b98d2c22a17aaf69a036e57d5426a.tar.bz2
assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 30dc352..bd5abec 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -17,6 +17,7 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cmath>
@@ -1386,7 +1387,7 @@ APInt APInt::sqrt() const {
else
return x_old + 1;
} else
- assert(0 && "Error in APInt::sqrt computation");
+ LLVM_UNREACHABLE("Error in APInt::sqrt computation");
return x_old + 1;
}
@@ -2032,7 +2033,7 @@ void APInt::fromString(unsigned numbits, const char *str, unsigned slen,
char cdigit = str[i];
if (radix == 16) {
if (!isxdigit(cdigit))
- assert(0 && "Invalid hex digit in string");
+ LLVM_UNREACHABLE("Invalid hex digit in string");
if (isdigit(cdigit))
digit = cdigit - '0';
else if (cdigit >= 'a')
@@ -2040,7 +2041,7 @@ void APInt::fromString(unsigned numbits, const char *str, unsigned slen,
else if (cdigit >= 'A')
digit = cdigit - 'A' + 10;
else
- assert(0 && "huh? we shouldn't get here");
+ LLVM_UNREACHABLE("huh? we shouldn't get here");
} else if (isdigit(cdigit)) {
digit = cdigit - '0';
assert((radix == 10 ||
@@ -2048,7 +2049,7 @@ void APInt::fromString(unsigned numbits, const char *str, unsigned slen,
(radix == 2 && (digit == 0 || digit == 1))) &&
"Invalid digit in string for given radix");
} else {
- assert(0 && "Invalid character in digit string");
+ LLVM_UNREACHABLE("Invalid character in digit string");
}
// Shift or multiply the value by the radix