[clang] [Clang][ARM] Only try to redefine builtins for non-CUDA (PR #128222)
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 14 00:10:45 PDT 2025
================
@@ -27,6 +27,8 @@
extern "C" {
#endif
+#if !defined(__CUDA_ARCH__)
+
----------------
rnk wrote:
> If we have to define them on non-windows targets anyways, perhaps a better fix is to let clang define them everywhere, and avoid this special case in the headers.
Yes, we should go this direction. There are some examples of this for x86 builtins. Here's an example of one I did recently for x86:
ee92122b53c7af26bb766e89e1d30ceb2fd5bb93
In this example, we leave behind an `_m_prefetchw` declaration, and the builtin is defined as a "library builtin" which has an associated header. This forces callers to include the relevant header, in this case `arm_acle.h`, to make the builtin callable.
https://github.com/llvm/llvm-project/pull/128222
More information about the cfe-commits
mailing list