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


================
Comment at: lib/CodeGen/CGCall.cpp:4067
+              IRFuncTy->getParamType(FirstIRArg)->isPointerTy())
+            V = Builder.CreatePointerBitCastOrAddrSpaceCast(
+                V, IRFuncTy->getParamType(FirstIRArg));
----------------
We have started using `performAddrSpaceCast` for those but, however, I was very 
confused about how to get address space of the Clang types correctly here.

I was using this function in a couple of places before but I must admit I am 
still a bit confused about the purpose of it. Mainly I was wondering if we 
could drop `LangAS` parameters from it? It would simplify its use a lot in 
multiple places. As far as I can see they are not used in the function at the 
moment. I am not sure if they are reserved for some development in the future 
though?

Altogether I quite like using `IRBuilder` directly because in combination with 
target address space map it allows to do what's needed here and keep consistent 
with the rest. Perhaps, I am missing some background info. I have tried to dig 
out a bit but no much success.


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

https://reviews.llvm.org/D58634



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to