[clang] [Clang] Add __has_target_builtin macro (PR #126324)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 21 06:22:52 PST 2025
AaronBallman wrote:
> @AaronBallman What do you recommend for next steps here? Should we wait until GCC makes a decision in [this issue](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118882)?
I don't think we need to wait for GCC to make a decision, but we can wait for a bit for them to consider the issue, and should make sure we coordinate closely with GCC if we make a decision on our own.
> I'd vote for fixing the CUDA on Arm case that failed in the meantime, then make a decision as to whether or not we should go back to `__has_builtin` only returning the current compilation target once that's gone.
+1, if we can get away with it.
As for next steps, I think we need a broader community discussion on this, so I would recommend an RFC proposing an approach. I don't know whether that's changing the behavior of `__has_builtin`, proposing `__can_use_builtin` and deprecating `__has_builtin`, or something else; I don't have enough expertise in offloading to feel like I should set the direction in that way. But I think the most conservative approach would be to introduce `__can_use_builtin` and deprecate `__has_builtin` as being a confused interface.
https://github.com/llvm/llvm-project/pull/126324
More information about the cfe-commits
mailing list