Skip to content

Commit c23d6df

Browse files
committed
[AArch64] Don't define reserved macros
It's not allowed. It also prevents Clang from compiling itself on Aarch64. lib/Basic/Targets/AArch64.cpp:404:9: warning: '__ARM_ACLE_VERSION' macro redefined [-Wmacro-redefined] 404 | #define __ARM_ACLE_VERSION(Y, Q, P) (100 * (Y) + 10 * (Q) + (P))
1 parent 419c534 commit c23d6df

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,11 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
401401
// ACLE predefines. Many can only have one possible value on v8 AArch64.
402402
Builder.defineMacro("__ARM_ACLE_VERSION(year, quarter, patch)",
403403
"(100 * (year) + 10 * (quarter) + (patch))");
404-
#define __ARM_ACLE_VERSION(Y, Q, P) (100 * (Y) + 10 * (Q) + (P))
405-
Builder.defineMacro("__ARM_ACLE",
406-
std::to_string(__ARM_ACLE_VERSION(2024, 2, 0)));
404+
#define ARM_ACLE_VERSION(Y, Q, P) (100 * (Y) + 10 * (Q) + (P))
405+
Builder.defineMacro("__ARM_ACLE", Twine(ARM_ACLE_VERSION(2024, 2, 0)));
407406
Builder.defineMacro("__FUNCTION_MULTI_VERSIONING_SUPPORT_LEVEL",
408-
std::to_string(__ARM_ACLE_VERSION(2024, 2, 0)));
409-
#undef __ARM_ACLE_VERSION
407+
Twine(ARM_ACLE_VERSION(2024, 2, 0)));
408+
#undef ARM_ACLE_VERSION
410409
Builder.defineMacro("__ARM_ARCH",
411410
std::to_string(ArchInfo->Version.getMajor()));
412411
Builder.defineMacro("__ARM_ARCH_PROFILE",

0 commit comments

Comments
 (0)