[PATCH] D77491: [Sema] Introduce BuiltinAttr, per-declaration builtin-ness
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 3 00:49:22 PDT 2020
rjmccall added a comment.
The builtins with custom type-checking are all true intrinsics like `__builtin_operator_new` and so on. They really can't be validly declared by the user program. The thing that seems most likely to avoid random compiler crashes would be to either forbid explicit declarations of them or treat those as no longer being builtins. If we need to maintain compatibility with people making custom declarations, we would need to always treat them as builtins and run the risk of crashing if someone declares one with a bad signature. But I don't think it's unfair of us to break those people; that is seriously not reasonable user behavior.
It's possible that custom declarations are people trying to create compatibility shims for compilers that don't provide these as builtins. Those people should be guarding their custom declarations, preferably with `__has_builtin`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77491/new/
https://reviews.llvm.org/D77491
More information about the cfe-commits
mailing list