]> granicus.if.org Git - clang/commit
[OpenCL] Fix assertion due to blocks
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 26 Feb 2019 16:20:41 +0000 (16:20 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 26 Feb 2019 16:20:41 +0000 (16:20 +0000)
commit29e2813a2ab7d5569860bb07892dfef7b5374d96
treeaf8c8c532c2fdc0790d5eb43c6872181b7085edf
parentd7172a58de051e6b5aa569b47a26b266543b1fb3
[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
lib/AST/Expr.cpp
test/CodeGenOpenCL/blocks.cl