[llvm] Add Addend Checks for MOVT and MOVW instructions. (PR #111970)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 02:35:41 PDT 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 a4402039bffd788b9af82435fd5a2fb311fdc6e8 81eec5f7dd6acd10383c7afea6647f602206acd5 --extensions cpp -- llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index 4d643d001d..530657b837 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -449,10 +449,10 @@ unsigned ARMAsmBackend::adjustFixupValue(const MCAssembler &Asm,
 
   // For MOVW/MOVT Instructions, the Fixup Value needs to be 16 bit aligned.
   // If this is not the case, we should reject compilation.
-  if((Kind == ARM::fixup_arm_movw_lo16 || Kind == ARM::fixup_arm_movt_hi16 ||
-      Kind == ARM::fixup_t2_movw_lo16 || Kind == ARM::fixup_t2_movt_hi16) &&
+  if ((Kind == ARM::fixup_arm_movw_lo16 || Kind == ARM::fixup_arm_movt_hi16 ||
+       Kind == ARM::fixup_t2_movw_lo16 || Kind == ARM::fixup_t2_movt_hi16) &&
       (!(minIntN(16) <= static_cast<int64_t>(Value) &&
-    static_cast<int64_t>(Value) <= maxIntN(16)))) {
+         static_cast<int64_t>(Value) <= maxIntN(16)))) {
     Ctx.reportError(Fixup.getLoc(), "Relocation Not In Range");
     return 0;
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/111970


More information about the llvm-commits mailing list