[llvm] [clang] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 08:58:58 PST 2023


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 142e567cf00815f7d1b3d72aaf298212a3f83ab2 07faef47ee26a68c291bd4b8dbe3f63775702876 -- clang/lib/CodeGen/CGBuiltin.cpp llvm/include/llvm/IR/Constants.h llvm/lib/Analysis/InstructionSimplify.cpp llvm/lib/IR/ConstantFold.cpp llvm/lib/IR/Verifier.cpp llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp llvm/lib/Transforms/IPO/OpenMPOpt.cpp llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp llvm/lib/Transforms/Scalar/ConstantHoisting.cpp llvm/lib/Transforms/Scalar/LoopFlatten.cpp llvm/lib/Transforms/Utils/SimplifyCFG.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
index 46ceb56b26..00c369f223 100644
--- a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
@@ -673,8 +673,7 @@ void ConstantHoistingPass::findBaseConstants(GlobalVariable *BaseGV) {
   llvm::stable_sort(ConstCandVec, [](const ConstantCandidate &LHS,
                                      const ConstantCandidate &RHS) {
     if (LHS.ConstInt->getType() != RHS.ConstInt->getType())
-      return LHS.ConstInt->getBitWidth() <
-             RHS.ConstInt->getBitWidth();
+      return LHS.ConstInt->getBitWidth() < RHS.ConstInt->getBitWidth();
     return LHS.ConstInt->getValue().ult(RHS.ConstInt->getValue());
   });
 

``````````

</details>


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


More information about the cfe-commits mailing list