llvm.org GIT mirror llvm / 7484920
Compute hashes directly with hash_combine instead of taking a detour through FoldingSetNodeID. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154495 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 8 years ago
2 changed file(s) with 6 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
2020 #include "llvm/Support/raw_ostream.h"
2121 #include "llvm/Support/Path.h"
2222 #include "llvm/Support/SourceMgr.h"
23 #include "llvm/ADT/FoldingSet.h"
23 #include "llvm/ADT/Hashing.h"
2424 #include "llvm/ADT/SmallString.h"
2525 #include "llvm/ADT/Twine.h"
2626 #include "llvm/Config/config.h"
13601360 return CIEKey::getTombstoneKey();
13611361 }
13621362 static unsigned getHashValue(const CIEKey &Key) {
1363 FoldingSetNodeID ID;
1364 ID.AddPointer(Key.Personality);
1365 ID.AddInteger(Key.PersonalityEncoding);
1366 ID.AddInteger(Key.LsdaEncoding);
1367 ID.AddBoolean(Key.IsSignalFrame);
1368 return ID.ComputeHash();
1363 return static_cast(hash_combine(Key.Personality,
1364 Key.PersonalityEncoding,
1365 Key.LsdaEncoding,
1366 Key.IsSignalFrame));
13691367 }
13701368 static bool isEqual(const CIEKey &LHS,
13711369 const CIEKey &RHS) {
172172 }
173173
174174 unsigned DenseMapInfo::getHashValue(const DebugLoc &Key) {
175 FoldingSetNodeID ID;
176 ID.AddInteger(Key.LineCol);
177 ID.AddInteger(Key.ScopeIdx);
178 return ID.ComputeHash();
175 return static_cast(hash_combine(Key.LineCol, Key.ScopeIdx));
179176 }
180177
181178 bool DenseMapInfo::isEqual(const DebugLoc &LHS, const DebugLoc &RHS) {