diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-12-04 07:23:53 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-12-04 07:23:53 +0000 |
commit | 8d690650e88f2aad2f204a77e918155abb3bcba7 (patch) | |
tree | c444f674ea11807ffeccd2258d80939c24bf6ecd /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 0152732ef40fa1398bb57e8592e54d4e6c47352b (diff) | |
download | bcm5719-llvm-8d690650e88f2aad2f204a77e918155abb3bcba7.tar.gz bcm5719-llvm-8d690650e88f2aad2f204a77e918155abb3bcba7.zip |
[OPENMP] Codegen for 'omp master' directive
Patch adds 2 library functions to OpenMPRuntime class - int32 kmpc_master(ident_t *, int32 gtid) and void kmpc_end_master(ident_t *, int32 gtid);
For 'omp master' directive the next code is generated:
if (__kmpc_master(loc, gtid)) {
<Associated structured block>;
__kmpc_end_master(log, gtid);
}
Differential Revision: http://reviews.llvm.org/D6473
llvm-svn: 223342
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 79af4bc00df..90776e5a705 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -490,8 +490,13 @@ void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &) { llvm_unreachable("CodeGen for 'omp single' is not supported yet."); } -void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &) { - llvm_unreachable("CodeGen for 'omp master' is not supported yet."); +void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { + CGM.getOpenMPRuntime().EmitOMPMasterRegion( + *this, [&]() -> void { + RunCleanupsScope Scope(*this); + EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt()); + EnsureInsertPoint(); + }, S.getLocStart()); } void CodeGenFunction::EmitOMPCriticalDirective(const OMPCriticalDirective &S) { |