Ver código fonte

[ConstantRange] Delete unused getSetSize

getSetSize returns an APInt that is 1 bit wider. The APInt is typically 65-bit and requires memory allocation. isSizeStrictlySmallerThan and isSizeLargerThan are preferred. The last use of this helper method was removed by rL302385.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358347 91177308-0d34-0410-b5e6-96231b3b80d8
Fangrui Song 6 anos atrás
pai
commit
1f9f94ca36
2 arquivos alterados com 0 adições e 11 exclusões
  1. 0 3
      include/llvm/IR/ConstantRange.h
  2. 0 8
      lib/IR/ConstantRange.cpp

+ 0 - 3
include/llvm/IR/ConstantRange.h

@@ -205,9 +205,6 @@ public:
   /// Return true if this set contains exactly one member.
   bool isSingleElement() const { return getSingleElement() != nullptr; }
 
-  /// Return the number of elements in this set.
-  APInt getSetSize() const;
-
   /// Compare set size of this range with the range CR.
   bool isSizeStrictlySmallerThan(const ConstantRange &CR) const;
 

+ 0 - 8
lib/IR/ConstantRange.cpp

@@ -349,14 +349,6 @@ bool ConstantRange::isUpperSignWrapped() const {
   return Lower.sgt(Upper);
 }
 
-APInt ConstantRange::getSetSize() const {
-  if (isFullSet())
-    return APInt::getOneBitSet(getBitWidth()+1, getBitWidth());
-
-  // This is also correct for wrapped sets.
-  return (Upper - Lower).zext(getBitWidth()+1);
-}
-
 bool
 ConstantRange::isSizeStrictlySmallerThan(const ConstantRange &Other) const {
   assert(getBitWidth() == Other.getBitWidth());