[OPENMP 4.0] Add 'if' clause for 'cancel' directive.

Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive.

llvm-svn: 247976
This commit is contained in:
Alexey Bataev
2015-09-18 08:07:34 +00:00
parent fbbc0b8cec
commit 87933c7ced
15 changed files with 186 additions and 53 deletions

View File

@@ -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());
}