summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-04-27 04:12:12 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-04-27 04:12:12 +0000
commit7387083d95d595f4d5e883bd4cb20781c1b4e72b (patch)
tree75afdfa2be980de60612456aa3bb35cbf03b64d4 /clang/lib/CodeGen
parent59c654aa43756d91da5b5df206db4328936291a5 (diff)
downloadbcm5719-llvm-7387083d95d595f4d5e883bd4cb20781c1b4e72b.tar.gz
bcm5719-llvm-7387083d95d595f4d5e883bd4cb20781c1b4e72b.zip
[OPENMP] Codegen for 'private' clause in 'sections' directive.
If there are 2 or more sections in a 'section' directive the following code is generated: <default init for privates> @__kmpc_for_static_init_4(); <BODY for sections directive> @__kmpc_for_static_fini() If there is only one section, the following code is generated: if (@__kmpc_single()) { <default init for privates> @__kmpc_end_single(); } Differential Revision: http://reviews.llvm.org/D9239 llvm-svn: 235833
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 5305db8fd21..0b54b1bbc56 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -1172,6 +1172,7 @@ static OpenMPDirectiveKind emitSections(CodeGenFunction &CGF,
CGF.CGM.getOpenMPRuntime().emitBarrierCall(CGF, S.getLocStart(),
OMPD_unknown);
}
+ CGF.EmitOMPPrivateClause(S, LoopScope);
(void)LoopScope.Privatize();
// Emit static non-chunked loop.
@@ -1202,6 +1203,7 @@ static OpenMPDirectiveKind emitSections(CodeGenFunction &CGF,
auto &&CodeGen = [Stmt, &S, &HasFirstprivates](CodeGenFunction &CGF) {
CodeGenFunction::OMPPrivateScope SingleScope(CGF);
HasFirstprivates = CGF.EmitOMPFirstprivateClause(S, SingleScope);
+ CGF.EmitOMPPrivateClause(S, SingleScope);
(void)SingleScope.Privatize();
CGF.EmitStmt(Stmt);
OpenPOWER on IntegriCloud