diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-02-25 05:25:57 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-02-25 05:25:57 +0000 |
commit | 005248ac8adf63d4a6a46b1f6cdb9fea686a2f9d (patch) | |
tree | ae4d8331e3ca9ecea9de2420509ab715a87e80d2 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 640dc752a9445f67f3955475433b9fa2bbf9de98 (diff) | |
download | bcm5719-llvm-005248ac8adf63d4a6a46b1f6cdb9fea686a2f9d.tar.gz bcm5719-llvm-005248ac8adf63d4a6a46b1f6cdb9fea686a2f9d.zip |
[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.
OpenMP 4.5 allows to privatize non-static member decls in non-static
member functions. Patch captures such decls by reference in general (for
bitfields, by value) and then operates with this capture. For bitfields,
at the end of codegen for lastprivates original bitfield is updated with the value of captured copy.
llvm-svn: 261824
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 9ccac258ee0..457d21e3dc2 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -37,25 +37,10 @@ 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 @@ -696,6 +681,8 @@ void CodeGenFunction::EmitOMPLastprivateClauseFinal( ++ISrcRef; ++IDestRef; } + if (auto *PostUpdate = C->getPostUpdateExpr()) + EmitIgnoredExpr(PostUpdate); } if (IsLastIterCond) EmitBlock(DoneBB, /*IsFinished=*/true); |