AlexVlx wrote:

> I think the default AS is expected to be losslessly converted to other AS but 
> not the other way around, though I understand it is not clearly stated in 
> LangRef or other places and a lot of code just assumes it can.

I don't think this expectation is thoroughly encoded anywhere, and it's 
definitely not binding today (there are targets who have a mapping of default 
that breaks this assumption). Whilst the premise is interesting I'm not sure 
this patch is doing the right thing. If you are in vanilla C/C++, you wouldn't 
have anything but default, and hopefully the default is mapped to something 
sane on the target. 

Running into an observable situation where this is a concern means that either 
you've messed around with (non C/C++) attributes, or are linking in something 
exciting. Neither of which constitutes valid C/C++, and I'm leaning towards 
saying shouldn't be allowed to silently work - we probably should refrain from 
infecting C/C++ with explicit address spaces a la OpenCL. What are you actually 
running into @jhuber6 where this is a concern?

https://github.com/llvm/llvm-project/pull/112248
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to