diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-22 12:24:45 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-22 12:24:45 +0000 |
commit | 50a6458870bad4f1aa8938e2ffa9fa40f6e2d24f (patch) | |
tree | 872b71e05bcb037563da56379271348bf513f71b /clang/lib/Sema | |
parent | 5c3c43afc11399e2ce4b288d802640aec4a1df1f (diff) | |
download | bcm5719-llvm-50a6458870bad4f1aa8938e2ffa9fa40f6e2d24f.tar.gz bcm5719-llvm-50a6458870bad4f1aa8938e2ffa9fa40f6e2d24f.zip |
[OPENMP] Codegen for 'private' clause in 'for' directive.
This patch generates helper variables which used as a private copies of the corresponding original variables inside an OpenMP 'for' directive. These generated variables are initialized by default (with the default constructor, if any). In OpenMP region references to original variables are replaced by the references to these private helper variables.
Differential Revision: http://reviews.llvm.org/D9106
llvm-svn: 235503
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 0cfb94eb482..c960f8ba042 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -4716,10 +4716,10 @@ OMPClause *Sema::ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList, // the new private variable in CodeGen. This new variable is not added to // IdResolver, so the code in the OpenMP region uses original variable for // proper diagnostics. - auto VDPrivate = - VarDecl::Create(Context, CurContext, DE->getLocStart(), - DE->getExprLoc(), VD->getIdentifier(), VD->getType(), - VD->getTypeSourceInfo(), /*S*/ SC_Auto); + auto VDPrivate = VarDecl::Create(Context, CurContext, DE->getLocStart(), + DE->getExprLoc(), VD->getIdentifier(), + VD->getType().getUnqualifiedType(), + VD->getTypeSourceInfo(), /*S*/ SC_Auto); ActOnUninitializedDecl(VDPrivate, /*TypeMayContainAuto*/ false); if (VDPrivate->isInvalidDecl()) continue; |