]> granicus.if.org Git - clang/commitdiff
This patch fixes the assert in emitting captured code in the target data construct.
authorMichael Wong <fraggamuffin@gmail.com>
Tue, 11 Aug 2015 04:52:01 +0000 (04:52 +0000)
committerMichael Wong <fraggamuffin@gmail.com>
Tue, 11 Aug 2015 04:52:01 +0000 (04:52 +0000)
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

index 65ba486d852a16593da5112635226b9d2c492c4a..c75581f4cfdb7a9b054237969d8d4dd11636cf5c 100644 (file)
@@ -2156,5 +2156,7 @@ void CodeGenFunction::EmitOMPTargetDataDirective(
 
   // emit the code inside the construct for now
   auto CS = cast<CapturedStmt>(S.getAssociatedStmt());
-  EmitStmt(CS->getCapturedStmt());
+  CGM.getOpenMPRuntime().emitInlinedDirective(
+      *this, OMPD_target_data,
+      [&CS](CodeGenFunction &CGF) { CGF.EmitStmt(CS->getCapturedStmt()); });
 }