This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Fix assertion due to blocks
ClosedPublic

Authored by yaxunl on Feb 25 2019, 5:39 PM.

Details

Summary

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

There is code

if (!isa<ParmVarDecl>(E->getCalleeDecl()))
  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.

Diff Detail

Repository
rC Clang

Event Timeline

yaxunl created this revision.Feb 25 2019, 5:39 PM
Anastasia accepted this revision.Feb 26 2019, 4:30 AM

LGTM! Thanks!

This revision is now accepted and ready to land.Feb 26 2019, 4:30 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2019, 8:19 AM