Compute hashes directly with hash_combine instead of taking a detour through FoldingS...
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 11 Apr 2012 14:06:39 +0000 (14:06 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 11 Apr 2012 14:06:39 +0000 (14:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154495 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCDwarf.cpp
lib/VMCore/DebugLoc.cpp

index e16f7aea078362eaca90cf9ef6ab987ebb0e0971..84a34f1d87359a057b4b7a372dfe0819cbcb3a64 100644 (file)
@@ -21,7 +21,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/SourceMgr.h"
-#include "llvm/ADT/FoldingSet.h"
+#include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Config/config.h"
@@ -1361,12 +1361,10 @@ namespace llvm {
       return CIEKey::getTombstoneKey();
     }
     static unsigned getHashValue(const CIEKey &Key) {
-      FoldingSetNodeID ID;
-      ID.AddPointer(Key.Personality);
-      ID.AddInteger(Key.PersonalityEncoding);
-      ID.AddInteger(Key.LsdaEncoding);
-      ID.AddBoolean(Key.IsSignalFrame);
-      return ID.ComputeHash();
+      return static_cast<unsigned>(hash_combine(Key.Personality,
+                                                Key.PersonalityEncoding,
+                                                Key.LsdaEncoding,
+                                                Key.IsSignalFrame));
     }
     static bool isEqual(const CIEKey &LHS,
                         const CIEKey &RHS) {
index 328244f806739467da88316bd8b4e50ebb59f501..9013d28bb67d2d7b8134ce90fdf3f66ede2f6375 100644 (file)
@@ -173,10 +173,7 @@ DebugLoc DenseMapInfo<DebugLoc>::getTombstoneKey() {
 }
 
 unsigned DenseMapInfo<DebugLoc>::getHashValue(const DebugLoc &Key) {
-  FoldingSetNodeID ID;
-  ID.AddInteger(Key.LineCol);
-  ID.AddInteger(Key.ScopeIdx);
-  return ID.ComputeHash();
+  return static_cast<unsigned>(hash_combine(Key.LineCol, Key.ScopeIdx));
 }
 
 bool DenseMapInfo<DebugLoc>::isEqual(const DebugLoc &LHS, const DebugLoc &RHS) {