[libcxx-commits] [PATCH] D76636: [RFC] Added type trait to remove address space qualifier from type
Anastasia Stulova via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 25 09:43:36 PDT 2020
Anastasia added a comment.
In D76636#1940086 <https://reviews.llvm.org/D76636#1940086>, @rjmccall wrote:
> Address spaces are actually defined in a number of standardized C extensions that are compatible with C++, such as the Embedded C specification, OpenCL, and so on. There's precedent for libc++ accepting work that supports this kind of C++-compatible extension in the past; for example, `std::is_pointer` looks through Objective-C's ARC type qualifiers. That said, (1) libc++ hasn't actually added new traits for such things before, just taught existing traits to handle them, and (2) I think this definition wouldn't actually work for cases like the OpenCL address spaces because they're not expressible as `__attribute__((address_space(N)))`. (2) is fixable; (1) may be a reasonable place to draw the line on policy.
Regarding (2) (although it's probably not changing the major concerns) this exact implementation also works for OpenCL because we map the address space keywords to the attributes during the parsing. However, OpenCL currently doesn't support libcxx. :(
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76636/new/
https://reviews.llvm.org/D76636
More information about the libcxx-commits
mailing list