[compiler-rt] 4570984 - builtins: honour `_M_ARM64` as `__aarch64__`

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 12:16:37 PDT 2024


Author: Saleem Abdulrasool
Date: 2024-09-11T12:16:24-07:00
New Revision: 4570984e7fe7409cec10d2305fb43c0b52806683

URL: https://github.com/llvm/llvm-project/commit/4570984e7fe7409cec10d2305fb43c0b52806683
DIFF: https://github.com/llvm/llvm-project/commit/4570984e7fe7409cec10d2305fb43c0b52806683.diff

LOG: builtins: honour `_M_ARM64` as `__aarch64__`

When clang is used as `clang-cl`, we use MSVC style macros. The spelling
of `__aarch64__` is converted to `_M_ARM64`. Account for this
alternative spelling in the conditional check. While in the area, add a
tertiary spelling of `__arm64__` to ensure that we catch more of the
variants.

Added: 
    

Modified: 
    compiler-rt/lib/builtins/cpu_model/aarch64.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/cpu_model/aarch64.c b/compiler-rt/lib/builtins/cpu_model/aarch64.c
index 0dd397783b67f5..ea2da23a95278f 100644
--- a/compiler-rt/lib/builtins/cpu_model/aarch64.c
+++ b/compiler-rt/lib/builtins/cpu_model/aarch64.c
@@ -14,7 +14,7 @@
 
 #include "aarch64.h"
 
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(__arm64__) && !defined(_M_ARM64)
 #error This file is intended only for aarch64-based targets
 #endif
 


        


More information about the llvm-commits mailing list