summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-02-09 09:41:33 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-02-09 09:41:33 +0000
commit3e6c45a41c343368377e36bb0b5b974e3b0f25db (patch)
tree3a5a542dc2e99b31524f6442d8fd1200c74f085c
parent376b4a46907fcb35d6967575fdb89f5b3cb991b1 (diff)
downloadbcm5719-llvm-3e6c45a41c343368377e36bb0b5b974e3b0f25db.tar.gz
bcm5719-llvm-3e6c45a41c343368377e36bb0b5b974e3b0f25db.zip
Do not mark variable as threadprivate if it was marked already.
llvm-svn: 260214
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 3ba5daa0304..480c2919d70 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -1289,6 +1289,9 @@ Sema::CheckOMPThreadPrivateDecl(SourceLocation Loc, ArrayRef<Expr *> VarList) {
continue;
}
+ // Variable is marked already - no need to check.
+ if (DSAStack->isThreadPrivate(VD))
+ continue;
Vars.push_back(RefExpr);
DSAStack->addDSA(VD, DE, OMPC_threadprivate);
VD->addAttr(OMPThreadPrivateDeclAttr::CreateImplicit(
OpenPOWER on IntegriCloud