https://bugs.llvm.org/show_bug.cgi?id=36088

            Bug ID: 36088
           Summary: ExprWithCleanups not handled in
                    emitOpenCLEnqueuedBlock
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangb...@nondot.org
          Reporter: l...@zaghen.it
                CC: llvm-bugs@lists.llvm.org

Created attachment 19749
  --> https://bugs.llvm.org/attachment.cgi?id=19749&action=edit
The CL kernel

The attached source makes clang (6.0-rc1 and trunk) assert on
cast<BlockExpr>().
I tried ignoring the ExprWithCleanups:

   if (auto DR = dyn_cast<DeclRefExpr>(E)) {
     E = cast<VarDecl>(DR->getDecl())->getInit();
   }
+  if (auto Cast = dyn_cast<ExprWithCleanups>(E)) {
+    E = Cast->getSubExpr();
+  }
   if (auto Cast = dyn_cast<CastExpr>(E)) {
     E = Cast->getSubExpr();
   }
   auto *Block = cast<BlockExpr>(E);

but it seems like clang also tries to emit the same block expression twice (the
second time through the OCL enqueue specific codepath.)

Options I used for clang: "-x cl -cl-std=CL2.0 enqueue_block_kernel.cl"

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to