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

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 10:23:31 PST 2023


================
@@ -673,8 +673,8 @@ 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->getType()->getBitWidth() <
-             RHS.ConstInt->getType()->getBitWidth();
+      return LHS.ConstInt->getIntegerType()->getBitWidth() <
+             RHS.ConstInt->getIntegerType()->getBitWidth();
----------------
nikic wrote:

```suggestion
      return LHS.ConstInt->getBitWidth() <
             RHS.ConstInt->getBitWidth();
```

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


More information about the cfe-commits mailing list