[clang] [llvm] __ARM_ARCH macro fix (PR #81466)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 03:24:35 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff c609846155279090a4f9e659f63fb851e4946cb7 4b91b1be657dcf01d5c7f70d4c62a8ba60185efd -- clang/lib/Basic/Targets/AArch64.cpp clang/lib/Basic/Targets/ARM.cpp clang/lib/Basic/Targets/ARM.h clang/test/Preprocessor/arm-target-features.c llvm/include/llvm/TargetParser/ARMTargetParser.h llvm/lib/TargetParser/ARMTargetParser.cpp llvm/unittests/TargetParser/TargetParserTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 32bca34f89..3ef283f824 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -379,7 +379,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
std::to_string(ArchInfo->Version.getMajor()));
else
Builder.defineMacro("__ARM_ARCH",
- std::to_string(ArchInfo->Version.getMajor()*100 +
+ std::to_string(ArchInfo->Version.getMajor() * 100 +
ArchInfo->Version.getMinor().value()));
Builder.defineMacro("__ARM_ARCH_PROFILE",
diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index f1d6494258..9ac558caa2 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -744,7 +744,8 @@ void ARMTargetInfo::getTargetDefines(const LangOptions &Opts,
// minor version number, e.g. for ARM architecture ARMvX.Y:
// __ARM_ARCH = X * 100 + Y.
if (ArchVersion >= 9 || ArchMinorVersion != 0)
- Builder.defineMacro("__ARM_ARCH", Twine(ArchVersion*100 + ArchMinorVersion));
+ Builder.defineMacro("__ARM_ARCH",
+ Twine(ArchVersion * 100 + ArchMinorVersion));
else
Builder.defineMacro("__ARM_ARCH", Twine(ArchVersion));
``````````
</details>
https://github.com/llvm/llvm-project/pull/81466
More information about the llvm-commits
mailing list