From fd1acbb9bb372b98e3dcb2be726098a1f7def7e9 Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Tue, 11 Apr 2017 21:31:00 +0000 Subject: [ODRHash] Improve handling of hash values Calculating the hash in Sema::ActOnTagFinishDefinition could happen before all sub-Decls were parsed or processed, which would produce the wrong hash value. Change to calculating the hash on the first use and storing the value instead. Also, avoid using the macros that were only for Boolean fields and use an explicit checker during the DefintionData merge. No functional change, but was this blocking other ODRHash patches. llvm-svn: 299989 --- clang/lib/Sema/SemaDecl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 02cbca8b2bb..c6a0b0101d3 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -13797,10 +13797,8 @@ void Sema::ActOnTagFinishDefinition(Scope *S, Decl *TagD, RD->completeDefinition(); } - if (auto *RD = dyn_cast(Tag)) { + if (isa(Tag)) { FieldCollector->FinishClass(); - if (Context.getLangOpts().Modules) - RD->computeODRHash(); } // Exit this scope of this tag's definition. -- cgit v1.2.3