diff options
author | Duncan Sands <baldrick@free.fr> | 2012-03-08 09:32:21 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2012-03-08 09:32:21 +0000 |
commit | ed5edea96d72440679311d7d31d39804967f3220 (patch) | |
tree | 9ed28f36819890514e02a1a4853176d347fd5f24 /include | |
parent | fac259814923d091942b230e7bd002a8d1130bc3 (diff) | |
download | external_llvm-ed5edea96d72440679311d7d31d39804967f3220.zip external_llvm-ed5edea96d72440679311d7d31d39804967f3220.tar.gz external_llvm-ed5edea96d72440679311d7d31d39804967f3220.tar.bz2 |
Revert commit 152300 (ddunbar) since it still seems to be breaking
buildbots. Original commit message:
[ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline, reapplied
with a fix for the longstanding over-read of 32-bit pointer values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152304 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/FoldingSet.h | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/include/llvm/ADT/FoldingSet.h b/include/llvm/ADT/FoldingSet.h index 028f2df..d2e0b8f 100644 --- a/include/llvm/ADT/FoldingSet.h +++ b/include/llvm/ADT/FoldingSet.h @@ -17,7 +17,6 @@ #define LLVM_ADT_FOLDINGSET_H #include "llvm/Support/DataTypes.h" -#include "llvm/Support/ErrorHandling.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -311,7 +310,6 @@ public: void AddInteger(unsigned long long I); void AddBoolean(bool B) { AddInteger(B ? 1U : 0U); } void AddString(StringRef String); - /// AddNodeID - Adds the Bit data of another ID to *this. void AddNodeID(const FoldingSetNodeID &ID); template <typename T> @@ -677,55 +675,6 @@ template<typename T> struct FoldingSetTrait<T*> { ID.AddPointer(X); } }; - -//===----------------------------------------------------------------------===// -// FoldingSetNodeID Inline function definitions - -/// Add* - Add various data types to Bit data. -/// -inline void FoldingSetNodeID::AddPointer(const void *Ptr) { - // Note: this adds pointers to the hash using sizes and endianness that - // depend on the host. It doesn't matter however, because hashing on - // pointer values in inherently unstable. Nothing should depend on the - // ordering of nodes in the folding set. - if (sizeof(void*) == sizeof(unsigned)) - AddInteger((unsigned) (unsigned long long) Ptr); - else if (sizeof(void*) == sizeof(unsigned long long)) { - AddInteger((unsigned long long) Ptr); - } else { - llvm_unreachable("unexpected sizeof(void*)"); - } -} -inline void FoldingSetNodeID::AddInteger(signed I) { - Bits.push_back(I); -} -inline void FoldingSetNodeID::AddInteger(unsigned I) { - Bits.push_back(I); -} -inline void FoldingSetNodeID::AddInteger(long I) { - AddInteger((unsigned long)I); -} -inline 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 { - llvm_unreachable("unexpected sizeof(long)"); - } -} -inline void FoldingSetNodeID::AddInteger(long long I) { - AddInteger((unsigned long long)I); -} -inline void FoldingSetNodeID::AddInteger(unsigned long long I) { - AddInteger(unsigned(I)); - if ((uint64_t)(unsigned)I != I) - Bits.push_back(unsigned(I >> 32)); -} -inline void FoldingSetNodeID::AddNodeID(const FoldingSetNodeID &ID) { - Bits.append(ID.Bits.begin(), ID.Bits.end()); -} - } // End of namespace llvm. #endif |