finegrainify namespacification
[oota-llvm.git] / lib / Support / ConstantRange.cpp
index b7ef5e05110343674f9d3a8a73ee61a9af8000df..7b45d20b5331d32408177ae4936c57d3ea1dbfa3 100644 (file)
@@ -1,4 +1,11 @@
 //===-- ConstantRange.cpp - ConstantRange implementation ------------------===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // Represent a range of possible values that may occur when the program is run
 // for an integral value.  This keeps track of a lower and upper bound for the
@@ -18,6 +25,7 @@
 #include "llvm/Type.h"
 #include "llvm/Instruction.h"
 #include "llvm/ConstantHandling.h"
+using namespace llvm;
 
 /// Initialize a full (the default) or empty set for the specified type.
 ///
@@ -126,10 +134,7 @@ uint64_t ConstantRange::getSetSize() const {
   // 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();
 }