Anastasia added inline comments.
================ Comment at: lib/CodeGen/CGBlocks.cpp:1275 + // We *can* call the block directly unless it is a function argument. + if (!isa<ParmVarDecl>(E->getCalleeDecl())) + Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee()); ---------------- I think it's reasonable enough... if we restrict blocks as parameters in the spec later it should be easy enough to modify this code. ================ Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:131 +static const BlockExpr *getBlockExpr(const Expr *E) { + if (auto Cast = dyn_cast<CastExpr>(E)) { + E = Cast->getSubExpr(); ---------------- Btw, does this handle the case when we assign a variable multiple time? I was just wondering if we need a loop somewhere? I.e. does something like this work now: ``` typedef void (^bl_t)(local void *); bl_t a = ...; bl_t b = a; bl_t c = b; c(); enqueue_kernel(... c, ...); ``` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58388/new/ https://reviews.llvm.org/D58388 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits