Author: Nick Sarnie Date: 2025-09-15T14:39:25Z New Revision: 959c3b627fd4084ae583c80703b88b91f63f9a0e
URL: https://github.com/llvm/llvm-project/commit/959c3b627fd4084ae583c80703b88b91f63f9a0e DIFF: https://github.com/llvm/llvm-project/commit/959c3b627fd4084ae583c80703b88b91f63f9a0e.diff LOG: [clang][ARM] Include arm_acle.h in intrin.h on supported platforms (#144172) Right now when using ARM intrinsics without including `arm_acle.h`, we throw a warning saying to include it or provide a declaration for the function. MSVC doesn't have any ARM-intrinsic specific header, so include Clang's ARM intrinsic header (`arm_acle.h`) in `intrin.h` so we don't get a warning that tells the user to include a header that doesn't exist. Ideally we could change the header based on the platform, but we don't have the infra for that at the moment. See https://github.com/llvm/llvm-project/pull/140910 for more info. Signed-off-by: Sarnie, Nick <[email protected]> Added: clang/test/Headers/arm-acle-no-direct-include.c Modified: clang/lib/Headers/intrin.h Removed: ################################################################################ diff --git a/clang/lib/Headers/intrin.h b/clang/lib/Headers/intrin.h index 588c283cbdfba..210ed0c1f773b 100644 --- a/clang/lib/Headers/intrin.h +++ b/clang/lib/Headers/intrin.h @@ -30,6 +30,10 @@ #include <arm64intr.h> #endif +#if defined(__ARM_ACLE) +#include <arm_acle.h> +#endif + /* For the definition of jmp_buf. */ #if __STDC_HOSTED__ #include <setjmp.h> diff --git a/clang/test/Headers/arm-acle-no-direct-include.c b/clang/test/Headers/arm-acle-no-direct-include.c new file mode 100644 index 0000000000000..b69549d92e4b0 --- /dev/null +++ b/clang/test/Headers/arm-acle-no-direct-include.c @@ -0,0 +1,8 @@ +// RUN: %clang_cl --target=aarch64-windows-msvc -Xclang -verify /E -U__STDC_HOSTED__ -Wno-builtin-macro-redefined %s 2>&1 | FileCheck %s + +// expected-no-diagnostics + +// CHECK: void __yield(void); +#include <intrin.h> +void f() { __yield(); } + _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
