summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Demangle/ItaniumDemangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Demangle/ItaniumDemangle.cpp')
-rw-r--r--llvm/lib/Demangle/ItaniumDemangle.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/Demangle/ItaniumDemangle.cpp b/llvm/lib/Demangle/ItaniumDemangle.cpp
index 2165cbab7e7..8d132c7580f 100644
--- a/llvm/lib/Demangle/ItaniumDemangle.cpp
+++ b/llvm/lib/Demangle/ItaniumDemangle.cpp
@@ -112,14 +112,20 @@ struct DumpVisitor {
printStr("}");
--Depth;
}
+
// Overload used when T is exactly 'bool', not merely convertible to 'bool'.
- template<typename T, T * = (bool*)nullptr>
- void print(T B) {
- printStr(B ? "true" : "false");
+ void print(bool B) { printStr(B ? "true" : "false"); }
+
+ template <class T>
+ typename std::enable_if<std::is_unsigned<T>::value>::type print(T N) {
+ fprintf(stderr, "%llu", (unsigned long long)N);
}
- void print(size_t N) {
- fprintf(stderr, "%zu", N);
+
+ template <class T>
+ typename std::enable_if<std::is_signed<T>::value>::type print(T N) {
+ fprintf(stderr, "%lld", (long long)N);
}
+
void print(ReferenceKind RK) {
switch (RK) {
case ReferenceKind::LValue:
OpenPOWER on IntegriCloud