]> granicus.if.org Git - clang/commitdiff
Do not mark variable as threadprivate if it was marked already.
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 9 Feb 2016 09:41:33 +0000 (09:41 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 9 Feb 2016 09:41:33 +0000 (09:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260214 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOpenMP.cpp

index 3ba5daa03042f246562acf320e6335e99bef252c..480c2919d700fbd5f52cdc197b78bcefd1378557 100644 (file)
@@ -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(