[PATCH] D62574: Initial draft of target-configurable address spaces.

Danila Malyutin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 7 09:44:41 PDT 2020


danilaml added a comment.

In D62574#2135662 <https://reviews.llvm.org/D62574#2135662>, @ebevhan wrote:

> It's generally not safe to alter address spaces below the top level. C is just very permissive about it.


Isn't that also true for the top-level casts? Unless when it is. And the target should know when it's safe or not. It's just that for non top-level casts there is added condition that casts are noop (i.e. don't change the bit pattern of the pointer). At least that's how I see it.

I think that you are write about that patch being targeted at C++ (need to do some C tests), but having the same implicit conversion being legal in C and not in C++ would be a bit confusing for the users (especially when the target knows it's completely safe). Anyway, this is not as important as getting this target-configurable AS work done. Without it, I guess the only option for downstream works to customize the behavior is to introduce their own LangAS-level AS entries, which is definitely not ideal.


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

https://reviews.llvm.org/D62574





More information about the cfe-commits mailing list