diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-15 00:14:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-15 00:14:00 +0000 |
commit | 2ca5c8644e6c35b3a7910a576ed89cddb7b82c3b (patch) | |
tree | 6f1f14dd87926e65a6beff9e41fb051e116d7f1c /lib/VMCore | |
parent | 04df049014396fe97a31bf3fa8951201b2ed8ffe (diff) | |
download | external_llvm-2ca5c8644e6c35b3a7910a576ed89cddb7b82c3b.zip external_llvm-2ca5c8644e6c35b3a7910a576ed89cddb7b82c3b.tar.gz external_llvm-2ca5c8644e6c35b3a7910a576ed89cddb7b82c3b.tar.bz2 |
convert ConstantVector::get to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 12 | ||||
-rw-r--r-- | lib/VMCore/Constants.cpp | 35 | ||||
-rw-r--r-- | lib/VMCore/Core.cpp | 165 |
4 files changed, 79 insertions, 137 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index 64b0b51..b323540 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -859,7 +859,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { for (unsigned i = 0; i != 8; ++i) Indices.push_back(ConstantInt::get(IntTy, shiftVal + i)); - Value *SV = ConstantVector::get(Indices.begin(), Indices.size()); + Value *SV = ConstantVector::get(Indices); Rep = Builder.CreateShuffleVector(Op2, Op1, SV, "palignr"); Rep = Builder.CreateBitCast(Rep, F->getReturnType()); } @@ -915,7 +915,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { for (unsigned i = 0; i != 16; ++i) Indices.push_back(ConstantInt::get(IntTy, shiftVal + i)); - Value *SV = ConstantVector::get(Indices.begin(), Indices.size()); + Value *SV = ConstantVector::get(Indices); Rep = Builder.CreateShuffleVector(Op2, Op1, SV, "palignr"); Rep = Builder.CreateBitCast(Rep, F->getReturnType()); } diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 1b50c4a..c8292c6 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -150,7 +150,7 @@ static Constant *FoldBitCast(Constant *V, const Type *DestTy) { // This allows for other simplifications (although some of them // can only be handled by Analysis/ConstantFolding.cpp). if (isa<ConstantInt>(V) || isa<ConstantFP>(V)) - return ConstantExpr::getBitCast(ConstantVector::get(&V, 1), DestPTy); + return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); } // Finally, implement bitcast folding now. The code below doesn't handle @@ -873,7 +873,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1, Result.push_back(InElt); } - return ConstantVector::get(&Result[0], Result.size()); + return ConstantVector::get(Result); } Constant *llvm::ConstantFoldExtractValueInstruction(Constant *Agg, @@ -1947,11 +1947,11 @@ Constant *llvm::ConstantFoldCompareInstruction(unsigned short pred, // If we can constant fold the comparison of each element, constant fold // the whole vector comparison. SmallVector<Constant*, 4> ResElts; - for (unsigned i = 0, e = C1Elts.size(); i != e; ++i) { - // Compare the elements, producing an i1 result or constant expr. + // Compare the elements, producing an i1 result or constant expr. + for (unsigned i = 0, e = C1Elts.size(); i != e; ++i) ResElts.push_back(ConstantExpr::getCompare(pred, C1Elts[i], C2Elts[i])); - } - return ConstantVector::get(&ResElts[0], ResElts.size()); + + return ConstantVector::get(ResElts); } if (C1->getType()->isFloatingPointTy()) { diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 42c6076..cac37cb 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -94,7 +94,7 @@ Constant *Constant::getAllOnesValue(const Type *Ty) { return ConstantInt::get(Ty->getContext(), APInt::getAllOnesValue(ITy->getBitWidth())); - std::vector<Constant*> Elts; + SmallVector<Constant*, 16> Elts; const VectorType *VTy = cast<VectorType>(Ty); Elts.resize(VTy->getNumElements(), getAllOnesValue(VTy->getElementType())); assert(Elts[0] && "Not a vector integer type!"); @@ -302,8 +302,8 @@ Constant *ConstantInt::get(const Type* Ty, uint64_t V, bool isSigned) { // For vectors, broadcast the value. if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) - return ConstantVector::get( - std::vector<Constant *>(VTy->getNumElements(), C)); + return ConstantVector::get(SmallVector<Constant*, + 16>(VTy->getNumElements(), C)); return C; } @@ -329,7 +329,7 @@ Constant *ConstantInt::get(const Type* Ty, const APInt& V) { // For vectors, broadcast the value. if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) return ConstantVector::get( - std::vector<Constant *>(VTy->getNumElements(), C)); + SmallVector<Constant *, 16>(VTy->getNumElements(), C)); return C; } @@ -372,7 +372,7 @@ Constant *ConstantFP::get(const Type* Ty, double V) { // For vectors, broadcast the value. if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) return ConstantVector::get( - std::vector<Constant *>(VTy->getNumElements(), C)); + SmallVector<Constant *, 16>(VTy->getNumElements(), C)); return C; } @@ -387,7 +387,7 @@ Constant *ConstantFP::get(const Type* Ty, StringRef Str) { // For vectors, broadcast the value. if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) return ConstantVector::get( - std::vector<Constant *>(VTy->getNumElements(), C)); + SmallVector<Constant *, 16>(VTy->getNumElements(), C)); return C; } @@ -404,9 +404,9 @@ ConstantFP* ConstantFP::getNegativeZero(const Type* Ty) { Constant *ConstantFP::getZeroValueForNegation(const Type* Ty) { if (const VectorType *PTy = dyn_cast<VectorType>(Ty)) if (PTy->getElementType()->isFloatingPointTy()) { - std::vector<Constant*> zeros(PTy->getNumElements(), + SmallVector<Constant*, 16> zeros(PTy->getNumElements(), getNegativeZero(PTy->getElementType())); - return ConstantVector::get(PTy, zeros); + return ConstantVector::get(zeros); } if (Ty->isFloatingPointTy()) @@ -601,13 +601,12 @@ ConstantVector::ConstantVector(const VectorType *T, } // ConstantVector accessors. -Constant *ConstantVector::get(const VectorType* T, - const std::vector<Constant*>& V) { +Constant *ConstantVector::get(const VectorType *T, + const std::vector<Constant*> &V) { assert(!V.empty() && "Vectors can't be empty"); - LLVMContext &Context = T->getContext(); - LLVMContextImpl *pImpl = Context.pImpl; + LLVMContextImpl *pImpl = T->getContext().pImpl; - // If this is an all-undef or alll-zero vector, return a + // If this is an all-undef or all-zero vector, return a // ConstantAggregateZero or UndefValue. Constant *C = V[0]; bool isZero = C->isNullValue(); @@ -629,14 +628,10 @@ Constant *ConstantVector::get(const VectorType* T, return pImpl->VectorConstants.getOrCreate(T, V); } -Constant *ConstantVector::get(const std::vector<Constant*>& V) { - assert(!V.empty() && "Cannot infer type if V is empty"); - return get(VectorType::get(V.front()->getType(),V.size()), V); -} - -Constant *ConstantVector::get(Constant *const* Vals, unsigned NumVals) { +Constant *ConstantVector::get(ArrayRef<Constant*> V) { // FIXME: make this the primary ctor method. - return get(std::vector<Constant*>(Vals, Vals+NumVals)); + assert(!V.empty() && "Vectors cannot be empty"); + return get(VectorType::get(V.front()->getType(), V.size()), V.vec()); } // Utility function for determining if a ConstantExpr is a CastOp or not. This diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 52c27fe..5fd3735 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -629,8 +629,8 @@ LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, Packed); } LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) { - return wrap(ConstantVector::get( - unwrap<Constant>(ScalarConstantVals, Size), Size)); + return wrap(ConstantVector::get(ArrayRef<Constant*>( + unwrap<Constant>(ScalarConstantVals, Size), Size))); } /*--.. Constant expressions ................................................--*/ @@ -647,74 +647,62 @@ LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty) { } LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal) { - return wrap(ConstantExpr::getNeg( - unwrap<Constant>(ConstantVal))); + return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); } LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal) { - return wrap(ConstantExpr::getNSWNeg( - unwrap<Constant>(ConstantVal))); + return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); } LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal) { - return wrap(ConstantExpr::getNUWNeg( - unwrap<Constant>(ConstantVal))); + return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); } LLVMValueRef LLVMConstFNeg(LLVMValueRef ConstantVal) { - return wrap(ConstantExpr::getFNeg( - unwrap<Constant>(ConstantVal))); + return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal))); } LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal) { - return wrap(ConstantExpr::getNot( - unwrap<Constant>(ConstantVal))); + return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); } LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getAdd( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getNSWAdd( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getNUWAdd( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getNUWAdd(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getFAdd( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getFAdd(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getSub( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getSub(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getNSWSub( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getNSWSub(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getNUWSub( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getNUWSub(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } @@ -724,89 +712,75 @@ LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { } LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getMul( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getNSWMul( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getNSWMul(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getNUWMul( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getNUWMul(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getFMul( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getFMul(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getUDiv( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getUDiv(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getSDiv( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getSDiv(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getExactSDiv( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getExactSDiv(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getFDiv( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getFDiv(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getURem( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getURem(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getSRem( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getSRem(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getFRem( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getFRem(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getAnd( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getAnd(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getOr( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getOr(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getXor( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } @@ -825,27 +799,23 @@ LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, } LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getShl( - unwrap<Constant>(LHSConstant), - unwrap<Constant>(RHSConstant))); + return wrap(ConstantExpr::getShl(unwrap<Constant>(LHSConstant), + unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getLShr( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getLShr(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) { - return wrap(ConstantExpr::getAShr( - unwrap<Constant>(LHSConstant), + return wrap(ConstantExpr::getAShr(unwrap<Constant>(LHSConstant), unwrap<Constant>(RHSConstant))); } LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices) { - return wrap(ConstantExpr::getGetElementPtr( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getGetElementPtr(unwrap<Constant>(ConstantVal), unwrap<Constant>(ConstantIndices, NumIndices), NumIndices)); @@ -860,38 +830,32 @@ LLVMValueRef LLVMConstInBoundsGEP(LLVMValueRef ConstantVal, } LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getTrunc( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getTrunc(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getSExt( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getSExt(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getZExt( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getZExt(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getFPTrunc( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getFPTrunc(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getFPExtend( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getFPExtend(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getUIToFP( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getUIToFP(unwrap<Constant>(ConstantVal), unwrap(ToType))); } @@ -906,92 +870,78 @@ LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { } LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getFPToSI( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getFPToSI(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getPtrToInt( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getPtrToInt(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getIntToPtr( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getIntToPtr(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getBitCast( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getBitCast(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getZExtOrBitCast( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getZExtOrBitCast(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getSExtOrBitCast( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getSExtOrBitCast(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getTruncOrBitCast( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getTruncOrBitCast(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getPointerCast( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getPointerCast(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType, LLVMBool isSigned) { - return wrap(ConstantExpr::getIntegerCast( - unwrap<Constant>(ConstantVal), - unwrap(ToType), - isSigned)); + return wrap(ConstantExpr::getIntegerCast(unwrap<Constant>(ConstantVal), + unwrap(ToType), isSigned)); } LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) { - return wrap(ConstantExpr::getFPCast( - unwrap<Constant>(ConstantVal), + return wrap(ConstantExpr::getFPCast(unwrap<Constant>(ConstantVal), unwrap(ToType))); } LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition, LLVMValueRef ConstantIfTrue, LLVMValueRef ConstantIfFalse) { - return wrap(ConstantExpr::getSelect( - unwrap<Constant>(ConstantCondition), + return wrap(ConstantExpr::getSelect(unwrap<Constant>(ConstantCondition), unwrap<Constant>(ConstantIfTrue), unwrap<Constant>(ConstantIfFalse))); } LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant) { - return wrap(ConstantExpr::getExtractElement( - unwrap<Constant>(VectorConstant), + return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant), unwrap<Constant>(IndexConstant))); } LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant) { - return wrap(ConstantExpr::getInsertElement( - unwrap<Constant>(VectorConstant), + return wrap(ConstantExpr::getInsertElement(unwrap<Constant>(VectorConstant), unwrap<Constant>(ElementValueConstant), unwrap<Constant>(IndexConstant))); } @@ -999,24 +949,21 @@ LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant) { - return wrap(ConstantExpr::getShuffleVector( - unwrap<Constant>(VectorAConstant), + return wrap(ConstantExpr::getShuffleVector(unwrap<Constant>(VectorAConstant), unwrap<Constant>(VectorBConstant), unwrap<Constant>(MaskConstant))); } LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, unsigned NumIdx) { - return wrap(ConstantExpr::getExtractValue( - unwrap<Constant>(AggConstant), + return wrap(ConstantExpr::getExtractValue(unwrap<Constant>(AggConstant), IdxList, NumIdx)); } LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, LLVMValueRef ElementValueConstant, unsigned *IdxList, unsigned NumIdx) { - return wrap(ConstantExpr::getInsertValue( - unwrap<Constant>(AggConstant), + return wrap(ConstantExpr::getInsertValue(unwrap<Constant>(AggConstant), unwrap<Constant>(ElementValueConstant), IdxList, NumIdx)); } |