diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-02-05 06:35:41 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-02-05 06:35:41 +0000 |
commit | 6956e2e68338f62bd19d54b82f0791a8f626c84d (patch) | |
tree | 2670b395613aca0611fc5523ea4204aaa87c6a6f /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 520449d55e5853ca995446988e9be58b0bb3c436 (diff) | |
download | bcm5719-llvm-6956e2e68338f62bd19d54b82f0791a8f626c84d.tar.gz bcm5719-llvm-6956e2e68338f62bd19d54b82f0791a8f626c84d.zip |
[OPENMP] Initial codegen for 'single' directive.
This patch emits the following code for the single directive:
#pragma omp single
<body>
<---->
if(__kmpc_single(...)) {
<body>
__kmpc_end_single(...);
}
Differential Revision: http://reviews.llvm.org/D7045
llvm-svn: 228275
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 2518e55d4b3..b4dcadc5fdc 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -707,8 +707,13 @@ void CodeGenFunction::EmitOMPSectionDirective(const OMPSectionDirective &) { llvm_unreachable("CodeGen for 'omp section' is not supported yet."); } -void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &) { - llvm_unreachable("CodeGen for 'omp single' is not supported yet."); +void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &S) { + CGM.getOpenMPRuntime().EmitOMPSingleRegion(*this, [&]() -> void { + InlinedOpenMPRegion Region(*this, S.getAssociatedStmt()); + RunCleanupsScope Scope(*this); + EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt()); + EnsureInsertPoint(); + }, S.getLocStart()); } void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { |