diff options
author | Richard Trieu <rtrieu@google.com> | 2017-04-11 21:31:00 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-04-11 21:31:00 +0000 |
commit | fd1acbb9bb372b98e3dcb2be726098a1f7def7e9 (patch) | |
tree | 454491711bbbcd296617bbdcd711c2c0b790ebaa /clang/lib/Sema/SemaDecl.cpp | |
parent | f720c036f4b1ac9178410b3d47c3543b9b529a65 (diff) | |
download | bcm5719-llvm-fd1acbb9bb372b98e3dcb2be726098a1f7def7e9.tar.gz bcm5719-llvm-fd1acbb9bb372b98e3dcb2be726098a1f7def7e9.zip |
[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
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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<CXXRecordDecl>(Tag)) { + if (isa<CXXRecordDecl>(Tag)) { FieldCollector->FinishClass(); - if (Context.getLangOpts().Modules) - RD->computeODRHash(); } // Exit this scope of this tag's definition. |