summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-03-11 04:48:56 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-03-11 04:48:56 +0000
commit10fec57e5a4508eb0fee4cc76c4cc68e21ddf345 (patch)
treeadd4768d94937730fbacd523637fd9aef740e9eb /clang/lib/CodeGen
parent23562fcfe971131a0545e51c1a77cc1179c10736 (diff)
downloadbcm5719-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.cpp6
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());
}
OpenPOWER on IntegriCloud