aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-27 02:25:43 +0000
committerChris Lattner <sabre@nondot.org>2002-04-27 02:25:43 +0000
commit95b876e0b6ea7b74a08bd6309745103195eb90ef (patch)
treee4bad53771a900897c04981bf597640de8e3f37c /lib
parent1a18b7cf805fc6bfc6dc44fb66799ad577d57213 (diff)
* Change Constant::getNullConstant to Constant::getNullValue
* Remove some unused code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Constants.cpp34
1 files changed, 1 insertions, 33 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 52af0ee19e..8bf1d9cc19 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -34,7 +34,7 @@ void Constant::setName(const std::string &Name, SymbolTable *ST) {
}
// Static constructor to create a '0' constant of arbitrary type...
-Constant *Constant::getNullConstant(const Type *Ty) {
+Constant *Constant::getNullValue(const Type *Ty) {
switch (Ty->getPrimitiveID()) {
case Type::BoolTyID: return ConstantBool::get(false);
case Type::SByteTyID:
@@ -225,38 +225,6 @@ bool ConstantFP::isValueValidForType(const Type *Ty, double Val) {
};
//===----------------------------------------------------------------------===//
-// Hash Function Implementations
-#if 0
-unsigned ConstantSInt::hash(const Type *Ty, int64_t V) {
- return unsigned(Ty->getPrimitiveID() ^ V);
-}
-
-unsigned ConstantUInt::hash(const Type *Ty, uint64_t V) {
- return unsigned(Ty->getPrimitiveID() ^ V);
-}
-
-unsigned ConstantFP::hash(const Type *Ty, double V) {
- return Ty->getPrimitiveID() ^ unsigned(V);
-}
-
-unsigned ConstantArray::hash(const ArrayType *Ty,
- const std::vector<Constant*> &V) {
- unsigned Result = (Ty->getUniqueID() << 5) ^ (Ty->getUniqueID() * 7);
- for (unsigned i = 0; i < V.size(); ++i)
- Result ^= V[i]->getHash() << (i & 7);
- return Result;
-}
-
-unsigned ConstantStruct::hash(const StructType *Ty,
- const std::vector<Constant*> &V) {
- unsigned Result = (Ty->getUniqueID() << 5) ^ (Ty->getUniqueID() * 7);
- for (unsigned i = 0; i < V.size(); ++i)
- Result ^= V[i]->getHash() << (i & 7);
- return Result;
-}
-#endif
-
-//===----------------------------------------------------------------------===//
// Factory Function Implementation
template<class ValType, class ConstantClass>