aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Constants.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-13 20:58:05 +0000
committerOwen Anderson <resistor@mac.com>2009-07-13 20:58:05 +0000
commit73c6b7127aff4499e4d6a2edb219685aee178ee1 (patch)
treecabab2668e037a0276156e885bd54d5bd660eabd /lib/VMCore/Constants.cpp
parent69fbc7f477c21ce1d8ae5a4aa8a701e47aa2d163 (diff)
downloadexternal_llvm-73c6b7127aff4499e4d6a2edb219685aee178ee1.zip
external_llvm-73c6b7127aff4499e4d6a2edb219685aee178ee1.tar.gz
external_llvm-73c6b7127aff4499e4d6a2edb219685aee178ee1.tar.bz2
Move more functionality over to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Constants.cpp')
-rw-r--r--lib/VMCore/Constants.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index f8ae2bd..a1b4c93 100644
--- a/lib/VMCore/Constants.cpp
+++ b/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<IntegerType>(Ty))
- return ConstantInt::get(APInt::getAllOnesValue(ITy->getBitWidth()));
- return ConstantVector::getAllOnesValue(cast<VectorType>(Ty));
-}
-
-// Static constructor to create an integral constant with all bits set
-ConstantInt *ConstantInt::getAllOnesValue(const Type *Ty) {
- if (const IntegerType* ITy = dyn_cast<IntegerType>(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<Constant*> Elts;
- Elts.resize(Ty->getNumElements(),
- ConstantInt::getAllOnesValue(Ty->getElementType()));
- assert(Elts[0] && "Not a vector integer type!");
- return cast<ConstantVector>(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<unsigned, 4> &ConstantExpr::getIndices() const {
return cast<InsertValueConstantExpr>(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);
}