From d7efa4b285d2464f1844b52b220381c64cd64bf6 Mon Sep 17 00:00:00 2001 From: Michael Wong Date: Tue, 11 Aug 2015 04:52:01 +0000 Subject: [PATCH] This patch fixes the assert in emitting captured code in the target data construct. This is on behalf of Kelvin Li. http://reviews.llvm.org/D11475 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244569 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGStmtOpenMP.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/CGStmtOpenMP.cpp b/lib/CodeGen/CGStmtOpenMP.cpp index 65ba486d85..c75581f4cf 100644 --- a/lib/CodeGen/CGStmtOpenMP.cpp +++ b/lib/CodeGen/CGStmtOpenMP.cpp @@ -2156,5 +2156,7 @@ void CodeGenFunction::EmitOMPTargetDataDirective( // emit the code inside the construct for now auto CS = cast(S.getAssociatedStmt()); - EmitStmt(CS->getCapturedStmt()); + CGM.getOpenMPRuntime().emitInlinedDirective( + *this, OMPD_target_data, + [&CS](CodeGenFunction &CGF) { CGF.EmitStmt(CS->getCapturedStmt()); }); } -- 2.40.0