[PATCH] [OpenCL] Fix assertion due to blocks
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 26 Feb 2019 16:20:41 +0000 (16:20 +0000)
committerGianfranco Costamagna <locutusofborg@debian.org>
Thu, 23 Jan 2020 09:17:54 +0000 (09:17 +0000)
commit4e5b587c89d0fa2f4048971a532eda0f1aa65149
tree61f8c7a1d691b5e48f2e0542d9be7bb5191e73e1
parentf2a2d6a1aaab03c0d0c0557a4571333411ee5f45
[PATCH] [OpenCL] Fix assertion due to blocks

A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called.

There is code

  Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee());
getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle
BlockExpr and returns nullptr, which causes isa to assert.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D58658

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354893 91177308-0d34-0410-b5e6-96231b3b80d8

Gbp-Pq: Name OpenCL-Fix-assertion-due-to-blocks.patch
clang/lib/AST/Expr.cpp
clang/test/CodeGenOpenCL/blocks.cl