[llvm-commits] CVS: llvm/lib/Support/ConstantRange.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jul 23 10:23:48 PDT 2003


Changes in directory llvm/lib/Support:

ConstantRange.cpp updated: 1.4 -> 1.5

---
Log message:

Simplify code by using ConstantInt::getRawValue instead of checking to see 
whether the constant is signed or unsigned, then casting



---
Diffs of the changes:

Index: llvm/lib/Support/ConstantRange.cpp
diff -u llvm/lib/Support/ConstantRange.cpp:1.4 llvm/lib/Support/ConstantRange.cpp:1.5
--- llvm/lib/Support/ConstantRange.cpp:1.4	Tue Sep  3 18:12:40 2002
+++ llvm/lib/Support/ConstantRange.cpp	Wed Jul 23 10:22:17 2003
@@ -126,10 +126,7 @@
   // Simply subtract the bounds...
   Constant *Result = *(Constant*)Upper - *(Constant*)Lower;
   assert(Result && "Subtraction of constant integers not implemented?");
-  if (getType()->isSigned())
-    return (uint64_t)cast<ConstantSInt>(Result)->getValue();
-  else
-    return cast<ConstantUInt>(Result)->getValue();
+  return cast<ConstantInt>(Result)->getRawValue();
 }
 
 





More information about the llvm-commits mailing list