From 542619e6d56d97e40b22b0876f6ca57f61112169 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 13 Jul 2009 20:58:05 +0000 Subject: Move more functionality over to LLVMContext. llvm-svn: 75497 --- llvm/lib/VMCore/Constants.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'llvm/lib/VMCore/Constants.cpp') diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index f8ae2bd79f4..a1b4c93268d 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -128,31 +128,6 @@ bool Constant::ContainsRelocations(unsigned Kind) const { return false; } -Constant *Constant::getAllOnesValue(const Type *Ty) { - if (const IntegerType* ITy = dyn_cast(Ty)) - return ConstantInt::get(APInt::getAllOnesValue(ITy->getBitWidth())); - return ConstantVector::getAllOnesValue(cast(Ty)); -} - -// Static constructor to create an integral constant with all bits set -ConstantInt *ConstantInt::getAllOnesValue(const Type *Ty) { - if (const IntegerType* ITy = dyn_cast(Ty)) - return ConstantInt::get(APInt::getAllOnesValue(ITy->getBitWidth())); - return 0; -} - -/// @returns the value for a vector integer constant of the given type that -/// has all its bits set to true. -/// @brief Get the all ones value -ConstantVector *ConstantVector::getAllOnesValue(const VectorType *Ty) { - std::vector Elts; - Elts.resize(Ty->getNumElements(), - ConstantInt::getAllOnesValue(Ty->getElementType())); - assert(Elts[0] && "Not a vector integer type!"); - return cast(ConstantVector::get(Elts)); -} - - /// getVectorElements - This method, which is only valid on constant of vector /// type, returns the elements of the vector in the specified smallvector. /// This handles breaking down a vector undef into undef elements, etc. For @@ -797,12 +772,6 @@ const SmallVector &ConstantExpr::getIndices() const { return cast(this)->Indices; } -Constant *ConstantExpr::getNot(Constant *C) { - assert(C->getType()->isIntOrIntVector() && - "Cannot NOT a nonintegral value!"); - return get(Instruction::Xor, C, - Constant::getAllOnesValue(C->getType())); -} Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2) { return get(Instruction::Add, C1, C2); } -- cgit v1.2.3