summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/FoldingSet.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-03 19:40:18 +0000
committerDan Gohman <gohman@apple.com>2008-11-03 19:40:18 +0000
commitbde853911fa82f56f37a9734c7fe0c71b85e50fd (patch)
tree0a1e76b993c045aac03ff6123df748cb9a32fbea /llvm/lib/Support/FoldingSet.cpp
parentfe57d109b6414d6728825a64857335afcd2bd13e (diff)
downloadbcm5719-llvm-bde853911fa82f56f37a9734c7fe0c71b85e50fd.tar.gz
bcm5719-llvm-bde853911fa82f56f37a9734c7fe0c71b85e50fd.zip
Overload AddInteger on int/long/long long instead of on int/int64_t,
to avoid overload ambiguities. This fixes build errors introduced by r58623. llvm-svn: 58632
Diffstat (limited to 'llvm/lib/Support/FoldingSet.cpp')
-rw-r--r--llvm/lib/Support/FoldingSet.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/llvm/lib/Support/FoldingSet.cpp b/llvm/lib/Support/FoldingSet.cpp
index 5a96dcd4485..d2b02f240c9 100644
--- a/llvm/lib/Support/FoldingSet.cpp
+++ b/llvm/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));
}
OpenPOWER on IntegriCloud