//===-- 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
#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.
///
// 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();
}