X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FConstants.cpp;h=8bf1d9cc199ad6cb51730b344b12ff84ca7733e0;hb=67e08db3b97e83637c596e3ef4866e64552762cc;hp=52af0ee19eedc0b74e60c6778caa4ba2dc128a82;hpb=68d892dc0d503236099e43d39dda50556d394dbb;p=oota-llvm.git diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 52af0ee19ee..8bf1d9cc199 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: @@ -224,38 +224,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 &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 &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