From 2344cbce571b60627653ec3015125737e5f8c68d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 25 Feb 2017 14:40:42 +0000 Subject: Vendor import of clang release_40 branch r296202: https://llvm.org/svn/llvm-project/cfe/branches/release_40@296202 --- lib/CodeGen/CGOpenMPRuntime.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGOpenMPRuntime.cpp') diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index df3f38c6ee9e..40252171368b 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -4697,7 +4697,9 @@ void CGOpenMPRuntime::emitCancellationPointCall( // global_tid, kmp_int32 cncl_kind); if (auto *OMPRegionInfo = dyn_cast_or_null(CGF.CapturedStmtInfo)) { - if (OMPRegionInfo->hasCancel()) { + // For 'cancellation point taskgroup', the task region info may not have a + // cancel. This may instead happen in another adjacent task. + if (CancelRegion == OMPD_taskgroup || OMPRegionInfo->hasCancel()) { llvm::Value *Args[] = { emitUpdateLocation(CGF, Loc), getThreadID(CGF, Loc), CGF.Builder.getInt32(getCancellationKind(CancelRegion))}; -- cgit v1.3