summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-13 17:50:18 +0000
committerChris Lattner <sabre@nondot.org>2002-08-13 17:50:18 +0000
commitc75071c3bff982c6d83e1274060ec5fcf5fa5922 (patch)
treeb71df3b54f98e8e6516abbf0c76dcf4cb14ad536 /include
parent65a2deef8c1187e58a7ad954ec8ec18e3074d7fe (diff)
downloadexternal_llvm-c75071c3bff982c6d83e1274060ec5fcf5fa5922.zip
external_llvm-c75071c3bff982c6d83e1274060ec5fcf5fa5922.tar.gz
external_llvm-c75071c3bff982c6d83e1274060ec5fcf5fa5922.tar.bz2
- Rename ConstantGenericIntegral -> ConstantIntegral
- Add new methods to ConstantIntegral: getMaxValue, getMinValue, getAllOnesValue git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Constants.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 6e3d2ce..29dcf5a 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -17,13 +17,13 @@ class PointerType;
//===---------------------------------------------------------------------------
-// ConstantGenericIntegral - Shared superclass of boolean and integer constants.
+// ConstantIntegral - Shared superclass of boolean and integer constants.
//
// This class just defines some common interfaces to be implemented.
//
-class ConstantGenericIntegral : public Constant {
+class ConstantIntegral : public Constant {
protected:
- ConstantGenericIntegral(const Type *Ty) : Constant(Ty) {}
+ ConstantIntegral(const Type *Ty) : Constant(Ty) {}
public:
// isNullValue - Return true if this is the value that would be returned by
@@ -45,8 +45,15 @@ public:
//
virtual bool isAllOnesValue() const = 0;
+ // Static constructor to get the maximum/minimum/allones constant of specified
+ // (integral) type...
+ //
+ static ConstantIntegral *getMaxValue(const Type *Ty);
+ static ConstantIntegral *getMinValue(const Type *Ty);
+ static ConstantIntegral *getAllOnesValue(const Type *Ty);
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstantGenericIntegral *) { return true; }
+ static inline bool classof(const ConstantIntegral *) { return true; }
static bool classof(const Constant *CPV); // defined in Constants.cpp
static inline bool classof(const Value *V) {
return isa<Constant>(V) && classof(cast<Constant>(V));
@@ -57,7 +64,7 @@ public:
//===---------------------------------------------------------------------------
// ConstantBool - Boolean Values
//
-class ConstantBool : public ConstantGenericIntegral {
+class ConstantBool : public ConstantIntegral {
bool Val;
ConstantBool(bool V);
~ConstantBool() {}
@@ -96,7 +103,7 @@ public:
// ConstantInt - Superclass of ConstantSInt & ConstantUInt, to make dealing
// with integral constants easier.
//
-class ConstantInt : public ConstantGenericIntegral {
+class ConstantInt : public ConstantIntegral {
protected:
union {
int64_t Signed;