diff options
author | Carlo Bertolli <cbertol@us.ibm.com> | 2016-03-03 22:09:40 +0000 |
---|---|---|
committer | Carlo Bertolli <cbertol@us.ibm.com> | 2016-03-03 22:09:40 +0000 |
commit | 6ad7b5aff2cf27335bb9d501816d872b8fac9100 (patch) | |
tree | 9d8b21f8251dadcb9965f366809abc2f34be5db6 /clang/lib/CodeGen | |
parent | 6df27e7f218c782ca7cf5c50199aa25e688aeb73 (diff) | |
download | bcm5719-llvm-6ad7b5aff2cf27335bb9d501816d872b8fac9100.tar.gz bcm5719-llvm-6ad7b5aff2cf27335bb9d501816d872b8fac9100.zip |
[OPENMP] firstprivate and private clauses of teams, host codegeneration
Add code generation support for firstprivate and private clauses of teams on the host. Add extensive regression tests including lambda functions and vla testing.
http://reviews.llvm.org/D17582
llvm-svn: 262663
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index c5fd7416795..8434cdf2da2 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -45,10 +45,25 @@ class OMPLexicalScope { } } + class PostUpdateCleanup final : public EHScopeStack::Cleanup { + const OMPExecutableDirective &S; + + public: + PostUpdateCleanup(const OMPExecutableDirective &S) : S(S) {} + + void Emit(CodeGenFunction &CGF, Flags /*flags*/) override { + if (!CGF.HaveInsertPoint()) + return; + (void)S; + // TODO: add cleanups for clauses that require post update. + } + }; + public: OMPLexicalScope(CodeGenFunction &CGF, const OMPExecutableDirective &S) : Scope(CGF, S.getSourceRange()) { emitPreInitStmt(CGF, S); + CGF.EHStack.pushCleanup<PostUpdateCleanup>(NormalAndEHCleanup, S); } }; } // namespace @@ -2755,6 +2770,8 @@ void CodeGenFunction::EmitOMPTeamsDirective(const OMPTeamsDirective &S) { // Emit parallel region as a standalone region. auto &&CodeGen = [&S](CodeGenFunction &CGF) { OMPPrivateScope PrivateScope(CGF); + (void)CGF.EmitOMPFirstprivateClause(S, PrivateScope); + CGF.EmitOMPPrivateClause(S, PrivateScope); (void)PrivateScope.Privatize(); CGF.EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt()); }; |