r260214 - Do not mark variable as threadprivate if it was marked already.

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 9 01:41:34 PST 2016


Author: abataev
Date: Tue Feb  9 03:41:33 2016
New Revision: 260214

URL: http://llvm.org/viewvc/llvm-project?rev=260214&view=rev
Log:
Do not mark variable as threadprivate if it was marked already.

Modified:
    cfe/trunk/lib/Sema/SemaOpenMP.cpp

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=260214&r1=260213&r2=260214&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Tue Feb  9 03:41:33 2016
@@ -1289,6 +1289,9 @@ Sema::CheckOMPThreadPrivateDecl(SourceLo
         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(




More information about the cfe-commits mailing list