efriedma-quic wrote:

> If we want to change the type of a global variable, maybe we can use 
> Value::mutateType

Trying to mutate the type of a global is still unsafe.  The benefit of opaque 
pointers here is that getValueType() is independent from getType(), so it's 
safe to rewrite the ValueType.  (This is what 
GlobalVariable::replaceInitializer() does.)

> I don't think there's any situation in which Clang needs to change the 
> address space of a declaration.

I wouldn't be surprised if there's some GPU stuff that relies on this, maybe by 
accident.

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

Reply via email to