rjmccall added inline comments.

================
Comment at: lib/CodeGen/CGCall.cpp:4067
+              IRFuncTy->getParamType(FirstIRArg)->isPointerTy())
+            V = Builder.CreatePointerBitCastOrAddrSpaceCast(
+                V, IRFuncTy->getParamType(FirstIRArg));
----------------
Anastasia wrote:
> 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.
We want to allow language address spaces to be arbitrarily mapped to IR address 
spaces during lowering, which might include e.g. changing the null value.  
That's why we pass language address spaces down.

You should be getting the language address space from the appropriate type.  I 
wouldn't expect that to include address-space conversions at this point, 
though; is there maybe a missing implicit conversions somewhere?


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