diff options
author | Dan Gohman <gohman@apple.com> | 2008-11-03 19:40:18 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-11-03 19:40:18 +0000 |
commit | 20cd13f54f2b1a6307016c47330045de13b140e2 (patch) | |
tree | a578b8c1f00e60ef4785a67d6f6ace411c419ed4 /lib/Support | |
parent | 265ca5dff5ad21add569fadab435f64423861793 (diff) | |
download | external_llvm-20cd13f54f2b1a6307016c47330045de13b140e2.zip external_llvm-20cd13f54f2b1a6307016c47330045de13b140e2.tar.gz external_llvm-20cd13f54f2b1a6307016c47330045de13b140e2.tar.bz2 |
Overload AddInteger on int/long/long long instead of on int/int64_t,
to avoid overload ambiguities. This fixes build errors introduced
by r58623.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/FoldingSet.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/Support/FoldingSet.cpp b/lib/Support/FoldingSet.cpp index 5a96dcd..d2b02f2 100644 --- a/lib/Support/FoldingSet.cpp +++ b/lib/Support/FoldingSet.cpp @@ -41,13 +41,23 @@ void FoldingSetNodeID::AddInteger(signed I) { void FoldingSetNodeID::AddInteger(unsigned I) { Bits.push_back(I); } -void FoldingSetNodeID::AddInteger(int64_t I) { - AddInteger((uint64_t)I); +void FoldingSetNodeID::AddInteger(long I) { + AddInteger((unsigned long)I); } -void FoldingSetNodeID::AddInteger(uint64_t I) { - Bits.push_back(unsigned(I)); - - // If the integer is small, encode it just as 32-bits. +void FoldingSetNodeID::AddInteger(unsigned long I) { + if (sizeof(long) == sizeof(int)) + AddInteger(unsigned(I)); + else if (sizeof(long) == sizeof(long long)) { + AddInteger((unsigned long long)I); + } else { + assert(0 && "unexpected sizeof(long)"); + } +} +void FoldingSetNodeID::AddInteger(long long I) { + AddInteger((unsigned long long)I); +} +void FoldingSetNodeID::AddInteger(unsigned long long I) { + AddInteger(unsigned(I)); if ((uint64_t)(int)I != I) Bits.push_back(unsigned(I >> 32)); } |