diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-11 04:48:56 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-11 04:48:56 +0000 |
commit | 10fec57e5a4508eb0fee4cc76c4cc68e21ddf345 (patch) | |
tree | add4768d94937730fbacd523637fd9aef740e9eb /clang/lib/CodeGen | |
parent | 23562fcfe971131a0545e51c1a77cc1179c10736 (diff) | |
download | bcm5719-llvm-10fec57e5a4508eb0fee4cc76c4cc68e21ddf345.tar.gz bcm5719-llvm-10fec57e5a4508eb0fee4cc76c4cc68e21ddf345.zip |
[OPENMP] Fix for ExprWithCleanups in 'omp atomic' constructs.
This patch allows using of ExprWithCleanups expressions and other complex expressions in 'omp atomic' construct
Differential Revision: http://reviews.llvm.org/D8200
llvm-svn: 231905
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index bd8d10f81db..ed6815550f7 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -921,7 +921,13 @@ void CodeGenFunction::EmitOMPAtomicDirective(const OMPAtomicDirective &S) { break; } } + + const auto *CS = + S.getAssociatedStmt()->IgnoreContainers(/*IgnoreCaptured=*/true); + if (const auto *EWC = dyn_cast<ExprWithCleanups>(CS)) + enterFullExpression(EWC); InlinedOpenMPRegionScopeRAII Region(*this, S); + EmitOMPAtomicExpr(*this, Kind, IsSeqCst, S.getX(), S.getV(), S.getExpr(), S.getLocStart()); } |