[llvm] [NFC] Fix MSVC C4146 warnings in LLVM CodeGen and tools (PR #225580)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 20:09:53 PDT 2026


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 origin/main HEAD --extensions cpp,h -- llvm/include/llvm/CodeGen/BasicTTIImpl.h llvm/include/llvm/CodeGen/CallingConvLower.h llvm/include/llvm/CodeGen/SelectionDAGNodes.h llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp llvm/tools/llvm-reduce/ReducerWorkItem.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index 0777861e2..aac86e51f 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -2082,7 +2082,8 @@ public:
       return thisT()->getShuffleCost(
           TTI::SK_Splice, cast<VectorType>(RetTy),
           cast<VectorType>(Args[0]->getType()), CostKind, {},
-          IID == Intrinsic::vector_splice_left ? static_cast<int>(Index) : -static_cast<int>(Index),
+          IID == Intrinsic::vector_splice_left ? static_cast<int>(Index)
+                                               : -static_cast<int>(Index),
           cast<VectorType>(RetTy));
     }
     case Intrinsic::vector_reduce_add:
diff --git a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
index 3f243073a..abb3d0f6f 100644
--- a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
@@ -1581,7 +1581,8 @@ Error MachOPlatform::MachOPlatformPlugin::populateObjCRuntimeObject(
 
       SecBlock.addEdge(PointerEdge,
                        RecordOffset + ((char *)&SD.Sec.addr - (char *)&SD.Sec),
-                       *ObjCImageInfoSym, - static_cast<int64_t>(SecBlock.getAddress().getValue()));
+                       *ObjCImageInfoSym,
+                       -static_cast<int64_t>(SecBlock.getAddress().getValue()));
     };
   }
 

``````````

</details>


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


More information about the llvm-commits mailing list