[PATCH] D69810: [OpenCL] Fix address space for base method call (PR43145)

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 7 09:05:03 PST 2019


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:4091
+            V = Builder.CreatePointerBitCastOrAddrSpaceCast(
+                V, IRFuncTy->getParamType(FirstIRArg));
+          else
----------------
Anastasia wrote:
> 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.
I agree that the AST should include an address-space conversion, not just a derived-to-base conversion.


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