summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-02-17 13:19:37 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-02-17 13:19:37 +0000
commit417089fc7e2cac58aa240d4a81a89f44afe99bc4 (patch)
treec6f4fb77c0a42d4d6820fe891c200dee1a4813bb /clang/lib/CodeGen
parent4788179a2cbb8fceda25751b2bdfc4f3ae2d13d6 (diff)
downloadbcm5719-llvm-417089fc7e2cac58aa240d4a81a89f44afe99bc4.tar.gz
bcm5719-llvm-417089fc7e2cac58aa240d4a81a89f44afe99bc4.zip
[OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.
Added codegen for captured data members in non-static member functions. llvm-svn: 261089
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index e0d1a5056c6..07fac2d6328 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -1925,16 +1925,14 @@ void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &S) {
AssignmentOps.append(C->assignment_ops().begin(),
C->assignment_ops().end());
}
- bool HasFirstprivates;
{
OMPLexicalScope Scope(*this, S);
// Emit code for 'single' region along with 'copyprivate' clauses
- auto &&CodeGen = [&S, &HasFirstprivates](CodeGenFunction &CGF) {
+ auto &&CodeGen = [&S](CodeGenFunction &CGF) {
CodeGenFunction::OMPPrivateScope SingleScope(CGF);
- HasFirstprivates = CGF.EmitOMPFirstprivateClause(S, SingleScope);
+ (void)CGF.EmitOMPFirstprivateClause(S, SingleScope);
CGF.EmitOMPPrivateClause(S, SingleScope);
(void)SingleScope.Privatize();
-
CGF.EmitStmt(
cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());
};
@@ -1944,8 +1942,7 @@ void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &S) {
}
// Emit an implicit barrier at the end (to avoid data race on firstprivate
// init or if no 'nowait' clause was specified and no 'copyprivate' clause).
- if ((!S.getSingleClause<OMPNowaitClause>() || HasFirstprivates) &&
- CopyprivateVars.empty()) {
+ if (!S.getSingleClause<OMPNowaitClause>() && CopyprivateVars.empty()) {
CGM.getOpenMPRuntime().emitBarrierCall(
*this, S.getLocStart(),
S.getSingleClause<OMPNowaitClause>() ? OMPD_unknown : OMPD_single);
@@ -2000,9 +1997,7 @@ void CodeGenFunction::EmitOMPParallelSectionsDirective(
// Emit directive as a combined directive that consists of two implicit
// directives: 'parallel' with 'sections' directive.
OMPLexicalScope Scope(*this, S);
- auto &&CodeGen = [&S](CodeGenFunction &CGF) {
- CGF.EmitSections(S);
- };
+ auto &&CodeGen = [&S](CodeGenFunction &CGF) { CGF.EmitSections(S); };
emitCommonOMPParallelDirective(*this, S, OMPD_sections, CodeGen);
}
OpenPOWER on IntegriCloud