summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-09 23:02:07 +0000
committerChris Lattner <sabre@nondot.org>2001-09-09 23:02:07 +0000
commit8b648b4a8b7dc14cc029540d4a22cbfde0fb64d1 (patch)
tree508ec50f5310ffd6ce4189977198507ac8e8a41f /llvm/lib
parenta461b052073d6c52ffdef1625acf54506a2d6915 (diff)
downloadbcm5719-llvm-8b648b4a8b7dc14cc029540d4a22cbfde0fb64d1.tar.gz
bcm5719-llvm-8b648b4a8b7dc14cc029540d4a22cbfde0fb64d1.zip
Remove the definitions of 3 global functions that don't belong in the core
llvm-svn: 526
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/ConstPoolVals.cpp102
1 files changed, 0 insertions, 102 deletions
diff --git a/llvm/lib/VMCore/ConstPoolVals.cpp b/llvm/lib/VMCore/ConstPoolVals.cpp
index 019d66a0e70..d53130d6012 100644
--- a/llvm/lib/VMCore/ConstPoolVals.cpp
+++ b/llvm/lib/VMCore/ConstPoolVals.cpp
@@ -309,105 +309,3 @@ ConstPoolStruct *ConstPoolStruct::get(const StructType *Ty,
StructConstants.add(Ty, V, Result = new ConstPoolStruct(Ty, V));
return Result;
}
-
-
-
-
-//===----------------------------------------------------------------------===//
-// Extra Method implementations
-
-
-
-
-
-
-// Convenience functions to get the value of an integer constant, for an
-// appropriate integer or non-integer type that can be held in an integer.
-// The type of the argument must be the following:
-// GetSignedIntConstantValue: signed integer or bool
-// GetUnsignedIntConstantValue: unsigned integer, bool, or pointer
-// GetConstantValueAsSignedInt: any of the above, but the value
-// must fit into a int64_t.
-//
-// isValidConstant is set to true if a valid constant was found.
-//
-int64_t
-GetSignedIntConstantValue(const Value* val, bool& isValidConstant)
-{
- int64_t intValue = 0;
- isValidConstant = false;
-
- if (val->getValueType() == Value::ConstantVal)
- {
- switch(val->getType()->getPrimitiveID())
- {
- case Type::BoolTyID:
- intValue = ((ConstPoolBool*) val)->getValue()? 1 : 0;
- isValidConstant = true;
- break;
- case Type::SByteTyID:
- case Type::ShortTyID:
- case Type::IntTyID:
- case Type::LongTyID:
- intValue = ((ConstPoolSInt*) val)->getValue();
- isValidConstant = true;
- break;
- default:
- break;
- }
- }
-
- return intValue;
-}
-
-uint64_t
-GetUnsignedIntConstantValue(const Value* val, bool& isValidConstant)
-{
- uint64_t intValue = 0;
- isValidConstant = false;
-
- if (val->getValueType() == Value::ConstantVal)
- {
- switch(val->getType()->getPrimitiveID())
- {
- case Type::BoolTyID:
- intValue = ((ConstPoolBool*) val)->getValue()? 1 : 0;
- isValidConstant = true;
- break;
- case Type::UByteTyID:
- case Type::UShortTyID:
- case Type::UIntTyID:
- case Type::ULongTyID:
- case Type::PointerTyID:
- intValue = ((ConstPoolUInt*) val)->getValue();
- isValidConstant = true;
- break;
- default:
- break;
- }
- }
-
- return intValue;
-}
-
-
-int64_t
-GetConstantValueAsSignedInt(const Value* val, bool& isValidConstant)
-{
- int64_t intValue = 0;
-
- if (val->getType()->isSigned())
- {
- intValue = GetSignedIntConstantValue(val, isValidConstant);
- }
- else // non-numeric types will fall here
- {
- uint64_t uintValue = GetUnsignedIntConstantValue(val, isValidConstant);
- if (isValidConstant && uintValue < INT64_MAX) // then safe to cast to signed
- intValue = (int64_t) uintValue;
- else
- isValidConstant = false;
- }
-
- return intValue;
-}
OpenPOWER on IntegriCloud