[clang] c23d6df - [AArch64] Don't define reserved macros
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 17 10:07:52 PDT 2024
Author: Benjamin Kramer
Date: 2024-09-17T19:07:36+02:00
New Revision: c23d6df60d62f971d957e730f6fe55ea89541f6b
URL: https://github.com/llvm/llvm-project/commit/c23d6df60d62f971d957e730f6fe55ea89541f6b
DIFF: https://github.com/llvm/llvm-project/commit/c23d6df60d62f971d957e730f6fe55ea89541f6b.diff
LOG: [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))
Added:
Modified:
clang/lib/Basic/Targets/AArch64.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 586e4dd2a21b4e..5f5dfcb722f9d4 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -401,12 +401,11 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
// ACLE predefines. Many can only have one possible value on v8 AArch64.
Builder.defineMacro("__ARM_ACLE_VERSION(year, quarter, patch)",
"(100 * (year) + 10 * (quarter) + (patch))");
-#define __ARM_ACLE_VERSION(Y, Q, P) (100 * (Y) + 10 * (Q) + (P))
- Builder.defineMacro("__ARM_ACLE",
- std::to_string(__ARM_ACLE_VERSION(2024, 2, 0)));
+#define ARM_ACLE_VERSION(Y, Q, P) (100 * (Y) + 10 * (Q) + (P))
+ Builder.defineMacro("__ARM_ACLE", Twine(ARM_ACLE_VERSION(2024, 2, 0)));
Builder.defineMacro("__FUNCTION_MULTI_VERSIONING_SUPPORT_LEVEL",
- std::to_string(__ARM_ACLE_VERSION(2024, 2, 0)));
-#undef __ARM_ACLE_VERSION
+ Twine(ARM_ACLE_VERSION(2024, 2, 0)));
+#undef ARM_ACLE_VERSION
Builder.defineMacro("__ARM_ARCH",
std::to_string(ArchInfo->Version.getMajor()));
Builder.defineMacro("__ARM_ARCH_PROFILE",
More information about the cfe-commits
mailing list