diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-12-01 11:32:38 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-12-01 11:32:38 +0000 |
commit | 75ddfabed756bfeb75057b535dc4a128946ed816 (patch) | |
tree | b284e5ea4f36d6e8ad7fd131c59e7c61da9fc484 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | b682ddf33ae05386c7069877abf2cd74ea89c13a (diff) | |
download | bcm5719-llvm-75ddfabed756bfeb75057b535dc4a128946ed816.tar.gz bcm5719-llvm-75ddfabed756bfeb75057b535dc4a128946ed816.zip |
[OPENMP] Formating and code improvement for codegen of 'omp critical' directive.
No functional changes, only code improvements.
llvm-svn: 223010
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index b160f17ccad..79af4bc00df 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -495,21 +495,12 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &) { } void CodeGenFunction::EmitOMPCriticalDirective(const OMPCriticalDirective &S) { - // __kmpc_critical(); - // <captured_body> - // __kmpc_end_critical(); - // - - auto Lock = CGM.getOpenMPRuntime().GetCriticalRegionLock( - S.getDirectiveName().getAsString()); - CGM.getOpenMPRuntime().EmitOMPCriticalRegionStart(*this, Lock, - S.getLocStart()); - { + CGM.getOpenMPRuntime().EmitOMPCriticalRegion( + *this, S.getDirectiveName().getAsString(), [&]() -> void { RunCleanupsScope Scope(*this); EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt()); EnsureInsertPoint(); - } - CGM.getOpenMPRuntime().EmitOMPCriticalRegionEnd(*this, Lock, S.getLocEnd()); + }, S.getLocStart()); } void |