HomePhabricator

[OpenCL] Fix assertion due to blocks

Authored by yaxunl on Feb 26 2019, 8:20 AM.

Description

[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

llvm-svn: 354893

Details

Committed
yaxunlFeb 26 2019, 8:20 AM
Differential Revision
D58658: [OpenCL] Fix assertion due to blocks
Parents
rG46c719ddcd17: Implement P1357: Traits for [Un]bounded Arrays; adopted in Kona
Branches
Unknown
Tags
Unknown