aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDylan Noblesmith <nobled@dreamwidth.org>2011-12-16 20:36:31 +0000
committerDylan Noblesmith <nobled@dreamwidth.org>2011-12-16 20:36:31 +0000
commitefb0d1e42f266efbd3d15b0c12c0790e90c5be66 (patch)
treebe8e3eb6d2a45b06b00dceb2959540d9ebc3eb38 /lib
parentf9aabb8f32d61d19f57fb4710c06d01a12fedce7 (diff)
downloadexternal_llvm-efb0d1e42f266efbd3d15b0c12c0790e90c5be66.zip
external_llvm-efb0d1e42f266efbd3d15b0c12c0790e90c5be66.tar.gz
external_llvm-efb0d1e42f266efbd3d15b0c12c0790e90c5be66.tar.bz2
APInt: update asserts for base-36
Hexatridecimal was added in r139695. And fix the unittest that now triggers the assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/APInt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 506225f..143ded9 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -2189,7 +2189,7 @@ void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix,
bool Signed, bool formatAsCLiteral) const {
assert((Radix == 10 || Radix == 8 || Radix == 16 || Radix == 2 ||
Radix == 36) &&
- "Radix should be 2, 8, 10, or 16!");
+ "Radix should be 2, 8, 10, 16, or 36!");
const char *Prefix = "";
if (formatAsCLiteral) {
@@ -2202,9 +2202,13 @@ void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix,
case 8:
Prefix = "0";
break;
+ case 10:
+ break; // No prefix
case 16:
Prefix = "0x";
break;
+ default:
+ llvm_unreachable("Invalid radix!");
}
}