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

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 6 08:36:09 PST 2019


svenvh marked an inline comment as done.
svenvh added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:4091
+            V = Builder.CreatePointerBitCastOrAddrSpaceCast(
+                V, IRFuncTy->getParamType(FirstIRArg));
+          else
----------------
@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?


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