diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-03-03 03:52:24 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-03-03 03:52:24 +0000 |
commit | 2bbf7217eab497204acb7e6671b737d485c25547 (patch) | |
tree | f0ad8f9c3f3e1aebeada6a5646b674d45469dcd7 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 600ca6fd39fe326130e97314775f8a560b098215 (diff) | |
download | bcm5719-llvm-2bbf7217eab497204acb7e6671b737d485c25547.tar.gz bcm5719-llvm-2bbf7217eab497204acb7e6671b737d485c25547.zip |
[OPENMP 4.5] Initial support for data members in 'linear' clause.
OpenMP 4.5 allows to privatize data members of current class in member
functions. Patch adds initial support for privatization of data members
in 'linear' clause, no codegen support.
llvm-svn: 262578
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 90d6a829e14..ddceb1b559c 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -18,6 +18,7 @@ #include "TargetInfo.h" #include "clang/AST/Stmt.h" #include "clang/AST/StmtOpenMP.h" +#include "clang/AST/DeclOpenMP.h" using namespace clang; using namespace CodeGen; @@ -30,8 +31,15 @@ class OMPLexicalScope { for (const auto *C : S.clauses()) { if (auto *CPI = OMPClauseWithPreInit::get(C)) { if (auto *PreInit = cast_or_null<DeclStmt>(CPI->getPreInitStmt())) { - for (const auto *I : PreInit->decls()) - CGF.EmitVarDecl(cast<VarDecl>(*I)); + for (const auto *I : PreInit->decls()) { + if (!I->hasAttr<OMPCaptureNoInitAttr>()) + CGF.EmitVarDecl(cast<VarDecl>(*I)); + else { + CodeGenFunction::AutoVarEmission Emission = + CGF.EmitAutoVarAlloca(cast<VarDecl>(*I)); + CGF.EmitAutoVarCleanups(Emission); + } + } } } } |