summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-11-14 21:01:01 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-11-14 21:01:01 +0000
commit817d7f36e9bf0dbd82ddfb2b76e8b23fe9a18d4e (patch)
treecd707e827c4b147a875291e9560f4ecc92ab54f6 /clang/lib/Sema
parent2bd183652053aa6553fb5ae3cfe9424a70251734 (diff)
downloadbcm5719-llvm-817d7f36e9bf0dbd82ddfb2b76e8b23fe9a18d4e.tar.gz
bcm5719-llvm-817d7f36e9bf0dbd82ddfb2b76e8b23fe9a18d4e.zip
[OPENMP] Fix DSA analysis for threadprivates after deserialization.
If threadprivate vaible is deserialized, it is not marked as threadprivate in DSAStack. llvm-svn: 318194
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 1d69a68e4d5..1c127c602f8 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -966,6 +966,12 @@ DSAStackTy::DSAVarData DSAStackTy::getTopDSA(ValueDecl *D, bool FromParent) {
DVar.RefExpr = TI->getSecond().RefExpr.getPointer();
DVar.CKind = OMPC_threadprivate;
return DVar;
+ } else if (VD && VD->hasAttr<OMPThreadPrivateDeclAttr>()) {
+ DVar.RefExpr = buildDeclRefExpr(
+ SemaRef, VD, D->getType().getNonReferenceType(),
+ VD->getAttr<OMPThreadPrivateDeclAttr>()->getLocation());
+ DVar.CKind = OMPC_threadprivate;
+ addDSA(D, DVar.RefExpr, OMPC_threadprivate);
}
if (isStackEmpty())
OpenPOWER on IntegriCloud