summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-09-18 08:07:34 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-09-18 08:07:34 +0000
commit87933c7ced4fb99bb9cf6cea4d87cec2825aea7c (patch)
tree1f887097058b418c1cfd5c261b11a4d126d142ed /clang/lib/CodeGen/CGStmtOpenMP.cpp
parentfbbc0b8cece96d7377a1b52d59daa15465f7db09 (diff)
downloadbcm5719-llvm-87933c7ced4fb99bb9cf6cea4d87cec2825aea7c.tar.gz
bcm5719-llvm-87933c7ced4fb99bb9cf6cea4d87cec2825aea7c.zip
[OPENMP 4.0] Add 'if' clause for 'cancel' directive.
Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive. llvm-svn: 247976
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 70f86385d57..51136413e05 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -2262,7 +2262,15 @@ void CodeGenFunction::EmitOMPCancellationPointDirective(
}
void CodeGenFunction::EmitOMPCancelDirective(const OMPCancelDirective &S) {
- CGM.getOpenMPRuntime().emitCancelCall(*this, S.getLocStart(),
+ const Expr *IfCond = nullptr;
+ for (const auto *C : S.getClausesOfKind<OMPIfClause>()) {
+ if (C->getNameModifier() == OMPD_unknown ||
+ C->getNameModifier() == OMPD_cancel) {
+ IfCond = C->getCondition();
+ break;
+ }
+ }
+ CGM.getOpenMPRuntime().emitCancelCall(*this, S.getLocStart(), IfCond,
S.getCancelRegion());
}
OpenPOWER on IntegriCloud