diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-28 21:19:26 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-28 21:19:26 +0000 |
commit | 4aa3295a655e48bbb065ac1d51bc1eb890cda4dd (patch) | |
tree | 97b1c1e6d93d0091668cc8dbbe004e9589f461d0 /llvm/lib/VMCore/LLVMContextImpl.cpp | |
parent | 019f4142610d4a3bfb24dca0224770ff9e512706 (diff) | |
download | bcm5719-llvm-4aa3295a655e48bbb065ac1d51bc1eb890cda4dd.tar.gz bcm5719-llvm-4aa3295a655e48bbb065ac1d51bc1eb890cda4dd.zip |
Return ConstantVector to 2.5 API.
llvm-svn: 77366
Diffstat (limited to 'llvm/lib/VMCore/LLVMContextImpl.cpp')
-rw-r--r-- | llvm/lib/VMCore/LLVMContextImpl.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/llvm/lib/VMCore/LLVMContextImpl.cpp b/llvm/lib/VMCore/LLVMContextImpl.cpp index 72e415cd66b..5efc1ebe5e7 100644 --- a/llvm/lib/VMCore/LLVMContextImpl.cpp +++ b/llvm/lib/VMCore/LLVMContextImpl.cpp @@ -21,15 +21,6 @@ using namespace llvm; static char getValType(ConstantAggregateZero *CPZ) { return 0; } -static std::vector<Constant*> getValType(ConstantVector *CP) { - std::vector<Constant*> Elements; - Elements.reserve(CP->getNumOperands()); - for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) - Elements.push_back(CP->getOperand(i)); - return Elements; -} - - LLVMContextImpl::LLVMContextImpl(LLVMContext &C) : Context(C), TheTrueVal(0), TheFalseVal(0) { } @@ -77,32 +68,6 @@ LLVMContextImpl::getConstantAggregateZero(const Type *Ty) { return AggZeroConstants.getOrCreate(Ty, 0); } -Constant *LLVMContextImpl::getConstantVector(const VectorType *Ty, - const std::vector<Constant*> &V) { - assert(!V.empty() && "Vectors can't be empty"); - // If this is an all-undef or alll-zero vector, return a - // ConstantAggregateZero or UndefValue. - Constant *C = V[0]; - bool isZero = C->isNullValue(); - bool isUndef = isa<UndefValue>(C); - - if (isZero || isUndef) { - for (unsigned i = 1, e = V.size(); i != e; ++i) - if (V[i] != C) { - isZero = isUndef = false; - break; - } - } - - if (isZero) - return Context.getConstantAggregateZero(Ty); - if (isUndef) - return Context.getUndef(Ty); - - // Implicitly locked. - return VectorConstants.getOrCreate(Ty, V); -} - // *** erase methods *** void LLVMContextImpl::erase(MDString *M) { @@ -118,7 +83,3 @@ void LLVMContextImpl::erase(MDNode *M) { void LLVMContextImpl::erase(ConstantAggregateZero *Z) { AggZeroConstants.remove(Z); } - -void LLVMContextImpl::erase(ConstantVector *V) { - VectorConstants.remove(V); -} |