summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
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
commit1c419ff50d35c4cab442f5a1c8f5e82812921633 (patch)
tree100a8cbd7a78b65227ce1bca5996b5bdfc327cba /llvm/lib/Support
parent13f6718b428fc5c4b966b6d47bc52aa3d6d36191 (diff)
downloadbcm5719-llvm-1c419ff50d35c4cab442f5a1c8f5e82812921633.tar.gz
bcm5719-llvm-1c419ff50d35c4cab442f5a1c8f5e82812921633.zip
APInt: update asserts for base-36
Hexatridecimal was added in r139695. And fix the unittest that now triggers the assert. llvm-svn: 146754
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/APInt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 506225f0640..143ded920e2 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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!");
}
}
OpenPOWER on IntegriCloud