From: Duncan P. N. Exon Smith Date: Fri, 4 Dec 2020 03:05:11 +0000 (-0800) Subject: ARCMigrate: Use hash_combine in the DenseMapInfo for EditEntry X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b85c6e5bcd1a9de941c318f9a5dc742818752a56;p=android-x86%2Fexternal-llvm-project.git 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 --- diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index ef2985d16d2..dfc0d935316 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -2054,12 +2054,8 @@ template<> struct DenseMapInfo { 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 &&