aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/ARCMigrate
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-03 19:05:11 -0800
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-08 13:46:21 -0800
commitb85c6e5bcd1a9de941c318f9a5dc742818752a56 (patch)
tree032cb010035f021ac9c6687e8c4cf45c9704dea8 /clang/lib/ARCMigrate
parenteca13e995c6428e11f0d402641a74c9fe26f124c (diff)
downloadllvm-b85c6e5bcd1a9de941c318f9a5dc742818752a56.zip
llvm-b85c6e5bcd1a9de941c318f9a5dc742818752a56.tar.gz
llvm-b85c6e5bcd1a9de941c318f9a5dc742818752a56.tar.bz2
ARCMigrate: Use hash_combine in the DenseMapInfo for EditEntry
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
Diffstat (limited to 'clang/lib/ARCMigrate')
-rw-r--r--clang/lib/ARCMigrate/ObjCMT.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp
index ef2985d..dfc0d93 100644
--- a/clang/lib/ARCMigrate/ObjCMT.cpp
+++ b/clang/lib/ARCMigrate/ObjCMT.cpp
@@ -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 &&