vsapsai added inline comments.
================ Comment at: clang/lib/Serialization/ASTReader.cpp:10621-10626 // Compute the hash of the method as if it has no body. - auto ComputeCXXMethodODRHash = [&Hash](const CXXMethodDecl *D) { - Hash.clear(); - Hash.AddFunctionDecl(D, true /*SkipBody*/); - return Hash.CalculateHash(); + auto ComputeCXXMethodODRHash = [](const CXXMethodDecl *D) { + ODRHash Hasher; + Hasher.AddFunctionDecl(D, true /*SkipBody*/); + return Hasher.CalculateHash(); }; ---------------- ChuanqiXu wrote: > Couldn't we hoist this like others? It is used only on the lines below - 10632 & 10634, so I think it is good to keep its scope small. And not hoisting is consistent with other places using lambdas close to their 2 calls like different kinds of `PopulateHashes`. This is a good observation. I've checked the usage of other hoisted lambdas and `ComputeTemplateParameterListODRHash` is used only in 2 places, so now I think we shouldn't hoist it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128690/new/ https://reviews.llvm.org/D128690 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits