[PATCH] D69810: [OpenCL] Fix address space for base method call (PR43145)
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 7 04:39:22 PST 2019
Anastasia added inline comments.
================
Comment at: clang/lib/CodeGen/CGCall.cpp:4091
+ V = Builder.CreatePointerBitCastOrAddrSpaceCast(
+ V, IRFuncTy->getParamType(FirstIRArg));
+ else
----------------
svenvh wrote:
> @Anastasia pointed out that the AST might not be correct to begin with, which could cause us to fail here.
>
> ```
> | `-MemberExpr 0x5555558af2c0 <col:3, col:5> '<bound member function type>' .getRef 0x5555558a4008
> | `-ImplicitCastExpr 0x5555558af310 <col:3> '__generic B2' lvalue <UncheckedDerivedToBase (B2)>
> | `-DeclRefExpr 0x5555558af2a0 <col:3> 'Derived' lvalue Var 0x5555558ab290 'd' 'Derived'
> ```
>
> The question is whether it's fine for the `UncheckedDerivedToBase ImplicitCastExpr` to cast from `private` to `__generic`; or do we need another `AddrSpaceConversion ImplicitCastExpr` node perhaps?
Yes, I am not sure AST is correct wrt addr spaces.
Also we should at least use `performAddrSpaceCast` that isn't easy here because the source addr spaces are not available at this point.
But overall I would like @rjmccall to have a look.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69810/new/
https://reviews.llvm.org/D69810
More information about the cfe-commits
mailing list