From: Alexey Bataev Date: Tue, 9 Feb 2016 09:41:33 +0000 (+0000) Subject: Do not mark variable as threadprivate if it was marked already. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2532eb2aa8a9f6666c9aee3c9f2275c05f985233;p=clang Do not mark variable as threadprivate if it was marked already. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260214 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 3ba5daa030..480c2919d7 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -1289,6 +1289,9 @@ Sema::CheckOMPThreadPrivateDecl(SourceLocation Loc, ArrayRef 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(