[PATCH] D54862: [OpenCL] Add generic AS to 'this' pointer

Mikael Nilsson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 27 07:27:48 PST 2018


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


================
Comment at: lib/CodeGen/CGCall.cpp:4035
+          V = Builder.CreatePointerBitCastOrAddrSpaceCast(V, DestTy);
+        }
 
----------------
rjmccall wrote:
> Always use the `performAddrSpaceConversion` target hook if there's a semantic address-space conversion required.  But really, this doesn't seem like the right place to be doing this; it ought to happen higher up when we're adding the `this` argument to the call, either explicitly in IRGen or implicitly by expecting the object expression to already yield a value in the right address space.
> 
> I could definitely believe that we don't currently create `CastExpr`s for simple qualification conversions of the object argument of a C++ method call, since (ignoring these address-space conversions) they're always trivial.
Thanks for the input! It seems like the name `performAddrSpaceConversion` does not exist in the code-base though.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54862/new/

https://reviews.llvm.org/D54862





More information about the cfe-commits mailing list