[llvm-commits] CVS: llvm/lib/Analysis/ConstantRange.cpp ScalarEvolution.cpp ScalarEvolutionExpander.cpp

Chris Lattner sabre at nondot.org
Sun Jan 14 18:28:14 PST 2007



Changes in directory llvm/lib/Analysis:

ConstantRange.cpp updated: 1.31 -> 1.32
ScalarEvolution.cpp updated: 1.87 -> 1.88
ScalarEvolutionExpander.cpp updated: 1.11 -> 1.12
---
Log message:

rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)



---
Diffs of the changes:  (+16 -16)

 ConstantRange.cpp           |    8 ++++----
 ScalarEvolution.cpp         |   22 +++++++++++-----------
 ScalarEvolutionExpander.cpp |    2 +-
 3 files changed, 16 insertions(+), 16 deletions(-)


Index: llvm/lib/Analysis/ConstantRange.cpp
diff -u llvm/lib/Analysis/ConstantRange.cpp:1.31 llvm/lib/Analysis/ConstantRange.cpp:1.32
--- llvm/lib/Analysis/ConstantRange.cpp:1.31	Sun Jan 14 19:58:56 2007
+++ llvm/lib/Analysis/ConstantRange.cpp	Sun Jan 14 20:27:26 2007
@@ -31,7 +31,7 @@
 using namespace llvm;
 
 static ConstantInt *getMaxValue(const Type *Ty, bool isSigned = false) {
-  if (Ty->isIntegral()) {
+  if (Ty->isInteger()) {
     if (isSigned) {
       // Calculate 011111111111111...
       unsigned TypeBits = Ty->getPrimitiveSizeInBits();
@@ -46,7 +46,7 @@
 
 // Static constructor to create the minimum constant for an integral type...
 static ConstantInt *getMinValue(const Type *Ty, bool isSigned = false) {
-  if (Ty->isIntegral()) {
+  if (Ty->isInteger()) {
     if (isSigned) {
       // Calculate 1111111111000000000000
       unsigned TypeBits = Ty->getPrimitiveSizeInBits();
@@ -93,7 +93,7 @@
 /// Initialize a full (the default) or empty set for the specified type.
 ///
 ConstantRange::ConstantRange(const Type *Ty, bool Full) {
-  assert(Ty->isIntegral() &&
+  assert(Ty->isInteger() &&
          "Cannot make constant range of non-integral type!");
   if (Full)
     Lower = Upper = getMaxValue(Ty);
@@ -225,7 +225,7 @@
 /// subtract - Subtract the specified constant from the endpoints of this
 /// constant range.
 ConstantRange ConstantRange::subtract(ConstantInt *CI) const {
-  assert(CI->getType() == getType() && getType()->isIntegral() &&
+  assert(CI->getType() == getType() && getType()->isInteger() &&
          "Cannot subtract from different type range or non-integer!");
   // If the set is empty or full, don't modify the endpoints.
   if (Lower == Upper) return *this;


Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.87 llvm/lib/Analysis/ScalarEvolution.cpp:1.88
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.87	Sun Jan 14 19:58:56 2007
+++ llvm/lib/Analysis/ScalarEvolution.cpp	Sun Jan 14 20:27:26 2007
@@ -122,7 +122,7 @@
 /// known to have.  This method is only valid on integer SCEV objects.
 ConstantRange SCEV::getValueRange() const {
   const Type *Ty = getType();
-  assert(Ty->isIntegral() && "Can't get range for a non-integer SCEV!");
+  assert(Ty->isInteger() && "Can't get range for a non-integer SCEV!");
   // Default to a full range if no better information is available.
   return ConstantRange(getType());
 }
@@ -194,7 +194,7 @@
 
 SCEVTruncateExpr::SCEVTruncateExpr(const SCEVHandle &op, const Type *ty)
   : SCEV(scTruncate), Op(op), Ty(ty) {
-  assert(Op->getType()->isIntegral() && Ty->isIntegral() &&
+  assert(Op->getType()->isInteger() && Ty->isInteger() &&
          "Cannot truncate non-integer value!");
   assert(Op->getType()->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits()
          && "This is not a truncating conversion!");
@@ -220,7 +220,7 @@
 
 SCEVZeroExtendExpr::SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty)
   : SCEV(scZeroExtend), Op(op), Ty(ty) {
-  assert(Op->getType()->isIntegral() && Ty->isIntegral() &&
+  assert(Op->getType()->isInteger() && Ty->isInteger() &&
          "Cannot zero extend non-integer value!");
   assert(Op->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()
          && "This is not an extending conversion!");
@@ -459,7 +459,7 @@
 /// extended.
 static SCEVHandle getTruncateOrZeroExtend(const SCEVHandle &V, const Type *Ty) {
   const Type *SrcTy = V->getType();
-  assert(SrcTy->isIntegral() && Ty->isIntegral() &&
+  assert(SrcTy->isInteger() && Ty->isInteger() &&
          "Cannot truncate or zero extend with non-integer arguments!");
   if (SrcTy->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
     return V;  // No conversion
@@ -1333,7 +1333,7 @@
 
   if (SCEVTruncateExpr *T = dyn_cast<SCEVTruncateExpr>(S))
     return GetConstantFactor(T->getOperand()) &
-           T->getType()->getIntegralTypeMask();
+           T->getType()->getIntegerTypeMask();
   if (SCEVZeroExtendExpr *E = dyn_cast<SCEVZeroExtendExpr>(S))
     return GetConstantFactor(E->getOperand());
   
@@ -1421,8 +1421,8 @@
 
     case Instruction::BitCast:
       // BitCasts are no-op casts so we just eliminate the cast.
-      if (I->getType()->isIntegral() &&
-          I->getOperand(0)->getType()->isIntegral())
+      if (I->getType()->isInteger() &&
+          I->getOperand(0)->getType()->isInteger())
         return getSCEV(I->getOperand(0));
       break;
 
@@ -2186,7 +2186,7 @@
         }
       }
     }
-  } else if (AddRec->isQuadratic() && AddRec->getType()->isIntegral()) {
+  } else if (AddRec->isQuadratic() && AddRec->getType()->isInteger()) {
     // If this is a quadratic (3-term) AddRec {L,+,M,+,N}, find the roots of
     // the quadratic equation to solve it.
     std::pair<SCEVHandle,SCEVHandle> Roots = SolveQuadraticEquation(AddRec);
@@ -2314,7 +2314,7 @@
       }
 
       if (Cond == ICmpInst::ICMP_SLT) {
-        if (PreCondLHS->getType()->isIntegral()) {
+        if (PreCondLHS->getType()->isInteger()) {
           if (RHS != getSCEV(PreCondRHS))
             return UnknownValue;  // Not a comparison against 'm'.
 
@@ -2567,14 +2567,14 @@
 
   OS << "Classifying expressions for: " << F.getName() << "\n";
   for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
-    if (I->getType()->isIntegral()) {
+    if (I->getType()->isInteger()) {
       OS << *I;
       OS << "  --> ";
       SCEVHandle SV = getSCEV(&*I);
       SV->print(OS);
       OS << "\t\t";
 
-      if ((*I).getType()->isIntegral()) {
+      if ((*I).getType()->isInteger()) {
         ConstantRange Bounds = SV->getValueRange();
         if (!Bounds.isFullSet())
           OS << "Bounds: " << Bounds << " ";


Index: llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff -u llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.11 llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.12
--- llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.11	Thu Jan 11 06:24:13 2007
+++ llvm/lib/Analysis/ScalarEvolutionExpander.cpp	Sun Jan 14 20:27:26 2007
@@ -92,7 +92,7 @@
   const Type *Ty = S->getType();
   const Loop *L = S->getLoop();
   // We cannot yet do fp recurrences, e.g. the xform of {X,+,F} --> X+{0,+,F}
-  assert(Ty->isIntegral() && "Cannot expand fp recurrences yet!");
+  assert(Ty->isInteger() && "Cannot expand fp recurrences yet!");
 
   // {X,+,F} --> X + {0,+,F}
   if (!isa<SCEVConstant>(S->getStart()) ||






More information about the llvm-commits mailing list