summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2017-02-18 02:09:28 +0000
committerRichard Trieu <rtrieu@google.com>2017-02-18 02:09:28 +0000
commitb6adf54204b9986967315754870f2ce2782ef82d (patch)
tree37c5f1ff135c2d2d89ddfac36c1546f8f7e2362d /clang/lib/Sema
parent54e06823d2a71b51fb9ef0853728fd8b99670c1d (diff)
downloadbcm5719-llvm-b6adf54204b9986967315754870f2ce2782ef82d.tar.gz
bcm5719-llvm-b6adf54204b9986967315754870f2ce2782ef82d.zip
Part of adding an improved ODR checker.
Reserve a spot for ODR hash in CXXRecordDecl and in its modules storage. Default the hash value to 0 for all classes. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295533
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 77d74983028..e96860a294e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -13771,8 +13771,11 @@ void Sema::ActOnTagFinishDefinition(Scope *S, Decl *TagD,
RD->completeDefinition();
}
- if (isa<CXXRecordDecl>(Tag))
+ if (auto *RD = dyn_cast<CXXRecordDecl>(Tag)) {
FieldCollector->FinishClass();
+ if (Context.getLangOpts().Modules)
+ RD->computeODRHash();
+ }
// Exit this scope of this tag's definition.
PopDeclContext();
OpenPOWER on IntegriCloud