[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins
Christopher Di Bella via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 16 12:15:33 PDT 2022
cjdb marked an inline comment as done.
cjdb added inline comments.
================
Comment at: clang/lib/Sema/SemaType.cpp:9113
+ BaseType.isReferenceable() || BaseType->isVoidType()
+ ? BuildPointerType(BaseType.getNonReferenceType(), Loc, EntityName)
+ : BaseType;
----------------
cjdb wrote:
> erichkeane wrote:
> > Do we at any point want this builtin to be address-space aware?
> I'm not against this functionality, but there isn't (currently) motivation for it. WDYT about `__add_pointer(T, address_space)`? Do we want this to be a separate builtin (e.g. `__add_pointer_with_address_space(T, address_space)`)?
I don't think handling address spaces is worth the trouble: we can always do `__add_pointer(int __attribute__((address_space(1))))` if desired (I added two tests to confirm this). I did need to fix `__remove_pointer` so that it also removes address spaces, so thank you for flagging this :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116203/new/
https://reviews.llvm.org/D116203
More information about the cfe-commits
mailing list