Skip to content

Commit

Permalink
ARCMigrate: Use hash_combine in the DenseMapInfo for EditEntry
Browse files Browse the repository at this point in the history
Simplify the DenseMapInfo for `EditEntry` by migrating from
`FoldingSetNodeID` to `llvm::hash_combine`. Besides the cleanup, this
reduces the diff for a future patch which changes the type of one of the
fields.

There should be no real functionality change here, although I imagine
the hash value will churn since its a different hashing infrastructure.

Differential Revision: https://reviews.llvm.org/D92630
  • Loading branch information
dexonsmith committed Dec 8, 2020
1 parent eca13e9 commit b85c6e5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions clang/lib/ARCMigrate/ObjCMT.cpp
Expand Up @@ -2054,12 +2054,8 @@ template<> struct DenseMapInfo<EditEntry> {
return Entry;
}
static unsigned getHashValue(const EditEntry& Val) {
llvm::FoldingSetNodeID ID;
ID.AddPointer(Val.File);
ID.AddInteger(Val.Offset);
ID.AddInteger(Val.RemoveLen);
ID.AddString(Val.Text);
return ID.ComputeHash();
return (unsigned)llvm::hash_combine(Val.File, Val.Offset, Val.RemoveLen,
Val.Text);
}
static bool isEqual(const EditEntry &LHS, const EditEntry &RHS) {
return LHS.File == RHS.File &&
Expand Down

0 comments on commit b85c6e5

Please sign in to comment.