mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
convert ConstantVector::get to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -25,7 +25,7 @@
|
|||||||
#include "llvm/OperandTraits.h"
|
#include "llvm/OperandTraits.h"
|
||||||
#include "llvm/ADT/APInt.h"
|
#include "llvm/ADT/APInt.h"
|
||||||
#include "llvm/ADT/APFloat.h"
|
#include "llvm/ADT/APFloat.h"
|
||||||
#include <vector>
|
#include "llvm/ADT/ArrayRef.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
@ -39,8 +39,6 @@ template<class ConstantClass, class TypeClass, class ValType>
|
|||||||
struct ConstantCreator;
|
struct ConstantCreator;
|
||||||
template<class ConstantClass, class TypeClass>
|
template<class ConstantClass, class TypeClass>
|
||||||
struct ConvertConstantType;
|
struct ConvertConstantType;
|
||||||
template<typename T, unsigned N>
|
|
||||||
class SmallVector;
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
/// This is the shared class of boolean and integer constants. This class
|
/// This is the shared class of boolean and integer constants. This class
|
||||||
@ -473,9 +471,9 @@ protected:
|
|||||||
ConstantVector(const VectorType *T, const std::vector<Constant*> &Val);
|
ConstantVector(const VectorType *T, const std::vector<Constant*> &Val);
|
||||||
public:
|
public:
|
||||||
// ConstantVector accessors
|
// ConstantVector accessors
|
||||||
|
static Constant *get(ArrayRef<Constant*> V);
|
||||||
|
// FIXME: Eliminate this constructor form.
|
||||||
static Constant *get(const VectorType *T, const std::vector<Constant*> &V);
|
static Constant *get(const VectorType *T, const std::vector<Constant*> &V);
|
||||||
static Constant *get(const std::vector<Constant*> &V);
|
|
||||||
static Constant *get(Constant *const *Vals, unsigned NumVals);
|
|
||||||
|
|
||||||
/// Transparently provide more efficient getOperand methods.
|
/// Transparently provide more efficient getOperand methods.
|
||||||
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
|
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
|
||||||
|
@ -54,7 +54,7 @@ static Constant *FoldBitCast(Constant *C, const Type *DestTy,
|
|||||||
// vector so the code below can handle it uniformly.
|
// vector so the code below can handle it uniformly.
|
||||||
if (isa<ConstantFP>(C) || isa<ConstantInt>(C)) {
|
if (isa<ConstantFP>(C) || isa<ConstantInt>(C)) {
|
||||||
Constant *Ops = C; // don't take the address of C!
|
Constant *Ops = C; // don't take the address of C!
|
||||||
return FoldBitCast(ConstantVector::get(&Ops, 1), DestTy, TD);
|
return FoldBitCast(ConstantVector::get(Ops), DestTy, TD);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a bitcast from constant vector -> vector, fold it.
|
// If this is a bitcast from constant vector -> vector, fold it.
|
||||||
@ -167,7 +167,7 @@ static Constant *FoldBitCast(Constant *C, const Type *DestTy,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ConstantVector::get(Result.data(), Result.size());
|
return ConstantVector::get(Result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2079,7 +2079,7 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
|
|||||||
"vector element #" + Twine(i) +
|
"vector element #" + Twine(i) +
|
||||||
" is not of type '" + Elts[0]->getType()->getDescription());
|
" is not of type '" + Elts[0]->getType()->getDescription());
|
||||||
|
|
||||||
ID.ConstantVal = ConstantVector::get(Elts.data(), Elts.size());
|
ID.ConstantVal = ConstantVector::get(Elts);
|
||||||
ID.Kind = ValID::t_Constant;
|
ID.Kind = ValID::t_Constant;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ void BitcodeReaderValueList::ResolveConstantForwardRefs() {
|
|||||||
NewC = ConstantStruct::get(Context, &NewOps[0], NewOps.size(),
|
NewC = ConstantStruct::get(Context, &NewOps[0], NewOps.size(),
|
||||||
UserCS->getType()->isPacked());
|
UserCS->getType()->isPacked());
|
||||||
} else if (isa<ConstantVector>(UserC)) {
|
} else if (isa<ConstantVector>(UserC)) {
|
||||||
NewC = ConstantVector::get(&NewOps[0], NewOps.size());
|
NewC = ConstantVector::get(NewOps);
|
||||||
} else {
|
} else {
|
||||||
assert(isa<ConstantExpr>(UserC) && "Must be a ConstantExpr.");
|
assert(isa<ConstantExpr>(UserC) && "Must be a ConstantExpr.");
|
||||||
NewC = cast<ConstantExpr>(UserC)->getWithOperands(&NewOps[0],
|
NewC = cast<ConstantExpr>(UserC)->getWithOperands(&NewOps[0],
|
||||||
|
@ -2387,30 +2387,14 @@ void SelectionDAGBuilder::visitIndirectBr(const IndirectBrInst &I) {
|
|||||||
void SelectionDAGBuilder::visitFSub(const User &I) {
|
void SelectionDAGBuilder::visitFSub(const User &I) {
|
||||||
// -0.0 - X --> fneg
|
// -0.0 - X --> fneg
|
||||||
const Type *Ty = I.getType();
|
const Type *Ty = I.getType();
|
||||||
if (Ty->isVectorTy()) {
|
if (isa<Constant>(I.getOperand(0)) &&
|
||||||
if (ConstantVector *CV = dyn_cast<ConstantVector>(I.getOperand(0))) {
|
I.getOperand(0) == ConstantFP::getZeroValueForNegation(Ty)) {
|
||||||
const VectorType *DestTy = cast<VectorType>(I.getType());
|
SDValue Op2 = getValue(I.getOperand(1));
|
||||||
const Type *ElTy = DestTy->getElementType();
|
setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
|
||||||
unsigned VL = DestTy->getNumElements();
|
Op2.getValueType(), Op2));
|
||||||
std::vector<Constant*> NZ(VL, ConstantFP::getNegativeZero(ElTy));
|
return;
|
||||||
Constant *CNZ = ConstantVector::get(&NZ[0], NZ.size());
|
|
||||||
if (CV == CNZ) {
|
|
||||||
SDValue Op2 = getValue(I.getOperand(1));
|
|
||||||
setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
|
|
||||||
Op2.getValueType(), Op2));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConstantFP *CFP = dyn_cast<ConstantFP>(I.getOperand(0)))
|
|
||||||
if (CFP->isExactlyValue(ConstantFP::getNegativeZero(Ty)->getValueAPF())) {
|
|
||||||
SDValue Op2 = getValue(I.getOperand(1));
|
|
||||||
setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
|
|
||||||
Op2.getValueType(), Op2));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
visitBinary(I, ISD::FSUB);
|
visitBinary(I, ISD::FSUB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2257,8 +2257,7 @@ static Constant *EvaluateStoreInto(Constant *Init, Constant *Val,
|
|||||||
|
|
||||||
if (Init->getType()->isArrayTy())
|
if (Init->getType()->isArrayTy())
|
||||||
return ConstantArray::get(cast<ArrayType>(InitTy), Elts);
|
return ConstantArray::get(cast<ArrayType>(InitTy), Elts);
|
||||||
else
|
return ConstantVector::get(Elts);
|
||||||
return ConstantVector::get(&Elts[0], Elts.size());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1037,11 +1037,8 @@ Instruction *InstCombiner::visitSExt(SExtInst &CI) {
|
|||||||
if (Pred == ICmpInst::ICMP_SLT && CmpLHS->getType() == DestTy) {
|
if (Pred == ICmpInst::ICMP_SLT && CmpLHS->getType() == DestTy) {
|
||||||
const Type *EltTy = VTy->getElementType();
|
const Type *EltTy = VTy->getElementType();
|
||||||
|
|
||||||
// splat the shift constant to a cosntant vector
|
// splat the shift constant to a constant vector.
|
||||||
Constant *Sh = ConstantInt::get(EltTy, EltTy->getScalarSizeInBits()-1);
|
Constant *VSh = ConstantInt::get(VTy, EltTy->getScalarSizeInBits()-1);
|
||||||
std::vector<Constant *> Elts(VTy->getNumElements(), Sh);
|
|
||||||
Constant *VSh = ConstantVector::get(Elts);
|
|
||||||
|
|
||||||
Value *In = Builder->CreateAShr(CmpLHS, VSh,CmpLHS->getName()+".lobit");
|
Value *In = Builder->CreateAShr(CmpLHS, VSh,CmpLHS->getName()+".lobit");
|
||||||
return ReplaceInstUsesWith(CI, In);
|
return ReplaceInstUsesWith(CI, In);
|
||||||
}
|
}
|
||||||
@ -1390,8 +1387,7 @@ static Instruction *OptimizeVectorResize(Value *InVal, const VectorType *DestTy,
|
|||||||
ConstantInt::get(Int32Ty, SrcElts));
|
ConstantInt::get(Int32Ty, SrcElts));
|
||||||
}
|
}
|
||||||
|
|
||||||
Constant *Mask = ConstantVector::get(ShuffleMask.data(), ShuffleMask.size());
|
return new ShuffleVectorInst(InVal, V2, ConstantVector::get(ShuffleMask));
|
||||||
return new ShuffleVectorInst(InVal, V2, Mask);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isMultipleOfTypeSize(unsigned Value, const Type *Ty) {
|
static bool isMultipleOfTypeSize(unsigned Value, const Type *Ty) {
|
||||||
|
@ -1916,7 +1916,7 @@ void SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
|
|||||||
if (EltTy != ValTy) {
|
if (EltTy != ValTy) {
|
||||||
unsigned NumElts = cast<VectorType>(ValTy)->getNumElements();
|
unsigned NumElts = cast<VectorType>(ValTy)->getNumElements();
|
||||||
SmallVector<Constant*, 16> Elts(NumElts, StoreVal);
|
SmallVector<Constant*, 16> Elts(NumElts, StoreVal);
|
||||||
StoreVal = ConstantVector::get(&Elts[0], NumElts);
|
StoreVal = ConstantVector::get(Elts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new StoreInst(StoreVal, EltPtr, MI);
|
new StoreInst(StoreVal, EltPtr, MI);
|
||||||
|
@ -859,7 +859,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
|
|||||||
for (unsigned i = 0; i != 8; ++i)
|
for (unsigned i = 0; i != 8; ++i)
|
||||||
Indices.push_back(ConstantInt::get(IntTy, shiftVal + 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.CreateShuffleVector(Op2, Op1, SV, "palignr");
|
||||||
Rep = Builder.CreateBitCast(Rep, F->getReturnType());
|
Rep = Builder.CreateBitCast(Rep, F->getReturnType());
|
||||||
}
|
}
|
||||||
@ -915,7 +915,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
|
|||||||
for (unsigned i = 0; i != 16; ++i)
|
for (unsigned i = 0; i != 16; ++i)
|
||||||
Indices.push_back(ConstantInt::get(IntTy, shiftVal + 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.CreateShuffleVector(Op2, Op1, SV, "palignr");
|
||||||
Rep = Builder.CreateBitCast(Rep, F->getReturnType());
|
Rep = Builder.CreateBitCast(Rep, F->getReturnType());
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ static Constant *FoldBitCast(Constant *V, const Type *DestTy) {
|
|||||||
// This allows for other simplifications (although some of them
|
// This allows for other simplifications (although some of them
|
||||||
// can only be handled by Analysis/ConstantFolding.cpp).
|
// can only be handled by Analysis/ConstantFolding.cpp).
|
||||||
if (isa<ConstantInt>(V) || isa<ConstantFP>(V))
|
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
|
// Finally, implement bitcast folding now. The code below doesn't handle
|
||||||
@ -873,7 +873,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1,
|
|||||||
Result.push_back(InElt);
|
Result.push_back(InElt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ConstantVector::get(&Result[0], Result.size());
|
return ConstantVector::get(Result);
|
||||||
}
|
}
|
||||||
|
|
||||||
Constant *llvm::ConstantFoldExtractValueInstruction(Constant *Agg,
|
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
|
// If we can constant fold the comparison of each element, constant fold
|
||||||
// the whole vector comparison.
|
// the whole vector comparison.
|
||||||
SmallVector<Constant*, 4> ResElts;
|
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]));
|
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()) {
|
if (C1->getType()->isFloatingPointTy()) {
|
||||||
|
@ -94,7 +94,7 @@ Constant *Constant::getAllOnesValue(const Type *Ty) {
|
|||||||
return ConstantInt::get(Ty->getContext(),
|
return ConstantInt::get(Ty->getContext(),
|
||||||
APInt::getAllOnesValue(ITy->getBitWidth()));
|
APInt::getAllOnesValue(ITy->getBitWidth()));
|
||||||
|
|
||||||
std::vector<Constant*> Elts;
|
SmallVector<Constant*, 16> Elts;
|
||||||
const VectorType *VTy = cast<VectorType>(Ty);
|
const VectorType *VTy = cast<VectorType>(Ty);
|
||||||
Elts.resize(VTy->getNumElements(), getAllOnesValue(VTy->getElementType()));
|
Elts.resize(VTy->getNumElements(), getAllOnesValue(VTy->getElementType()));
|
||||||
assert(Elts[0] && "Not a vector integer type!");
|
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.
|
// For vectors, broadcast the value.
|
||||||
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
||||||
return ConstantVector::get(
|
return ConstantVector::get(SmallVector<Constant*,
|
||||||
std::vector<Constant *>(VTy->getNumElements(), C));
|
16>(VTy->getNumElements(), C));
|
||||||
|
|
||||||
return C;
|
return C;
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ Constant *ConstantInt::get(const Type* Ty, const APInt& V) {
|
|||||||
// For vectors, broadcast the value.
|
// For vectors, broadcast the value.
|
||||||
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
||||||
return ConstantVector::get(
|
return ConstantVector::get(
|
||||||
std::vector<Constant *>(VTy->getNumElements(), C));
|
SmallVector<Constant *, 16>(VTy->getNumElements(), C));
|
||||||
|
|
||||||
return C;
|
return C;
|
||||||
}
|
}
|
||||||
@ -372,7 +372,7 @@ Constant *ConstantFP::get(const Type* Ty, double V) {
|
|||||||
// For vectors, broadcast the value.
|
// For vectors, broadcast the value.
|
||||||
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
||||||
return ConstantVector::get(
|
return ConstantVector::get(
|
||||||
std::vector<Constant *>(VTy->getNumElements(), C));
|
SmallVector<Constant *, 16>(VTy->getNumElements(), C));
|
||||||
|
|
||||||
return C;
|
return C;
|
||||||
}
|
}
|
||||||
@ -387,7 +387,7 @@ Constant *ConstantFP::get(const Type* Ty, StringRef Str) {
|
|||||||
// For vectors, broadcast the value.
|
// For vectors, broadcast the value.
|
||||||
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
if (const VectorType *VTy = dyn_cast<VectorType>(Ty))
|
||||||
return ConstantVector::get(
|
return ConstantVector::get(
|
||||||
std::vector<Constant *>(VTy->getNumElements(), C));
|
SmallVector<Constant *, 16>(VTy->getNumElements(), C));
|
||||||
|
|
||||||
return C;
|
return C;
|
||||||
}
|
}
|
||||||
@ -404,9 +404,9 @@ ConstantFP* ConstantFP::getNegativeZero(const Type* Ty) {
|
|||||||
Constant *ConstantFP::getZeroValueForNegation(const Type* Ty) {
|
Constant *ConstantFP::getZeroValueForNegation(const Type* Ty) {
|
||||||
if (const VectorType *PTy = dyn_cast<VectorType>(Ty))
|
if (const VectorType *PTy = dyn_cast<VectorType>(Ty))
|
||||||
if (PTy->getElementType()->isFloatingPointTy()) {
|
if (PTy->getElementType()->isFloatingPointTy()) {
|
||||||
std::vector<Constant*> zeros(PTy->getNumElements(),
|
SmallVector<Constant*, 16> zeros(PTy->getNumElements(),
|
||||||
getNegativeZero(PTy->getElementType()));
|
getNegativeZero(PTy->getElementType()));
|
||||||
return ConstantVector::get(PTy, zeros);
|
return ConstantVector::get(zeros);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ty->isFloatingPointTy())
|
if (Ty->isFloatingPointTy())
|
||||||
@ -601,13 +601,12 @@ ConstantVector::ConstantVector(const VectorType *T,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ConstantVector accessors.
|
// ConstantVector accessors.
|
||||||
Constant *ConstantVector::get(const VectorType* T,
|
Constant *ConstantVector::get(const VectorType *T,
|
||||||
const std::vector<Constant*>& V) {
|
const std::vector<Constant*> &V) {
|
||||||
assert(!V.empty() && "Vectors can't be empty");
|
assert(!V.empty() && "Vectors can't be empty");
|
||||||
LLVMContext &Context = T->getContext();
|
LLVMContextImpl *pImpl = T->getContext().pImpl;
|
||||||
LLVMContextImpl *pImpl = Context.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.
|
// ConstantAggregateZero or UndefValue.
|
||||||
Constant *C = V[0];
|
Constant *C = V[0];
|
||||||
bool isZero = C->isNullValue();
|
bool isZero = C->isNullValue();
|
||||||
@ -629,14 +628,10 @@ Constant *ConstantVector::get(const VectorType* T,
|
|||||||
return pImpl->VectorConstants.getOrCreate(T, V);
|
return pImpl->VectorConstants.getOrCreate(T, V);
|
||||||
}
|
}
|
||||||
|
|
||||||
Constant *ConstantVector::get(const std::vector<Constant*>& V) {
|
Constant *ConstantVector::get(ArrayRef<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) {
|
|
||||||
// FIXME: make this the primary ctor method.
|
// 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
|
// Utility function for determining if a ConstantExpr is a CastOp or not. This
|
||||||
|
@ -629,8 +629,8 @@ LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
|
|||||||
Packed);
|
Packed);
|
||||||
}
|
}
|
||||||
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) {
|
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) {
|
||||||
return wrap(ConstantVector::get(
|
return wrap(ConstantVector::get(ArrayRef<Constant*>(
|
||||||
unwrap<Constant>(ScalarConstantVals, Size), Size));
|
unwrap<Constant>(ScalarConstantVals, Size), Size)));
|
||||||
}
|
}
|
||||||
/*--.. Constant expressions ................................................--*/
|
/*--.. Constant expressions ................................................--*/
|
||||||
|
|
||||||
@ -647,74 +647,62 @@ LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal) {
|
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal) {
|
||||||
return wrap(ConstantExpr::getNeg(
|
return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal)));
|
||||||
unwrap<Constant>(ConstantVal)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal) {
|
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal) {
|
||||||
return wrap(ConstantExpr::getNSWNeg(
|
return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal)));
|
||||||
unwrap<Constant>(ConstantVal)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal) {
|
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal) {
|
||||||
return wrap(ConstantExpr::getNUWNeg(
|
return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal)));
|
||||||
unwrap<Constant>(ConstantVal)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFNeg(LLVMValueRef ConstantVal) {
|
LLVMValueRef LLVMConstFNeg(LLVMValueRef ConstantVal) {
|
||||||
return wrap(ConstantExpr::getFNeg(
|
return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal)));
|
||||||
unwrap<Constant>(ConstantVal)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal) {
|
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal) {
|
||||||
return wrap(ConstantExpr::getNot(
|
return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal)));
|
||||||
unwrap<Constant>(ConstantVal)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getAdd(
|
return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant,
|
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant,
|
||||||
LLVMValueRef RHSConstant) {
|
LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getNSWAdd(
|
return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant,
|
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant,
|
||||||
LLVMValueRef RHSConstant) {
|
LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getNUWAdd(
|
return wrap(ConstantExpr::getNUWAdd(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getFAdd(
|
return wrap(ConstantExpr::getFAdd(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getSub(
|
return wrap(ConstantExpr::getSub(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant,
|
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant,
|
||||||
LLVMValueRef RHSConstant) {
|
LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getNSWSub(
|
return wrap(ConstantExpr::getNSWSub(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant,
|
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant,
|
||||||
LLVMValueRef RHSConstant) {
|
LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getNUWSub(
|
return wrap(ConstantExpr::getNUWSub(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,89 +712,75 @@ LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getMul(
|
return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant,
|
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant,
|
||||||
LLVMValueRef RHSConstant) {
|
LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getNSWMul(
|
return wrap(ConstantExpr::getNSWMul(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant,
|
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant,
|
||||||
LLVMValueRef RHSConstant) {
|
LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getNUWMul(
|
return wrap(ConstantExpr::getNUWMul(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getFMul(
|
return wrap(ConstantExpr::getFMul(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getUDiv(
|
return wrap(ConstantExpr::getUDiv(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getSDiv(
|
return wrap(ConstantExpr::getSDiv(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant,
|
LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant,
|
||||||
LLVMValueRef RHSConstant) {
|
LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getExactSDiv(
|
return wrap(ConstantExpr::getExactSDiv(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getFDiv(
|
return wrap(ConstantExpr::getFDiv(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getURem(
|
return wrap(ConstantExpr::getURem(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getSRem(
|
return wrap(ConstantExpr::getSRem(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getFRem(
|
return wrap(ConstantExpr::getFRem(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getAnd(
|
return wrap(ConstantExpr::getAnd(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getOr(
|
return wrap(ConstantExpr::getOr(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getXor(
|
return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -825,27 +799,23 @@ LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getShl(
|
return wrap(ConstantExpr::getShl(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
unwrap<Constant>(RHSConstant)));
|
||||||
unwrap<Constant>(RHSConstant)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getLShr(
|
return wrap(ConstantExpr::getLShr(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant) {
|
||||||
return wrap(ConstantExpr::getAShr(
|
return wrap(ConstantExpr::getAShr(unwrap<Constant>(LHSConstant),
|
||||||
unwrap<Constant>(LHSConstant),
|
|
||||||
unwrap<Constant>(RHSConstant)));
|
unwrap<Constant>(RHSConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal,
|
LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal,
|
||||||
LLVMValueRef *ConstantIndices, unsigned NumIndices) {
|
LLVMValueRef *ConstantIndices, unsigned NumIndices) {
|
||||||
return wrap(ConstantExpr::getGetElementPtr(
|
return wrap(ConstantExpr::getGetElementPtr(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap<Constant>(ConstantIndices,
|
unwrap<Constant>(ConstantIndices,
|
||||||
NumIndices),
|
NumIndices),
|
||||||
NumIndices));
|
NumIndices));
|
||||||
@ -860,38 +830,32 @@ LLVMValueRef LLVMConstInBoundsGEP(LLVMValueRef ConstantVal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getTrunc(
|
return wrap(ConstantExpr::getTrunc(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getSExt(
|
return wrap(ConstantExpr::getSExt(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getZExt(
|
return wrap(ConstantExpr::getZExt(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getFPTrunc(
|
return wrap(ConstantExpr::getFPTrunc(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getFPExtend(
|
return wrap(ConstantExpr::getFPExtend(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getUIToFP(
|
return wrap(ConstantExpr::getUIToFP(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -906,92 +870,78 @@ LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getFPToSI(
|
return wrap(ConstantExpr::getFPToSI(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getPtrToInt(
|
return wrap(ConstantExpr::getPtrToInt(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getIntToPtr(
|
return wrap(ConstantExpr::getIntToPtr(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getBitCast(
|
return wrap(ConstantExpr::getBitCast(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal,
|
LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal,
|
||||||
LLVMTypeRef ToType) {
|
LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getZExtOrBitCast(
|
return wrap(ConstantExpr::getZExtOrBitCast(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal,
|
LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal,
|
||||||
LLVMTypeRef ToType) {
|
LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getSExtOrBitCast(
|
return wrap(ConstantExpr::getSExtOrBitCast(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal,
|
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal,
|
||||||
LLVMTypeRef ToType) {
|
LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getTruncOrBitCast(
|
return wrap(ConstantExpr::getTruncOrBitCast(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,
|
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,
|
||||||
LLVMTypeRef ToType) {
|
LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getPointerCast(
|
return wrap(ConstantExpr::getPointerCast(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType,
|
LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType,
|
||||||
LLVMBool isSigned) {
|
LLVMBool isSigned) {
|
||||||
return wrap(ConstantExpr::getIntegerCast(
|
return wrap(ConstantExpr::getIntegerCast(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
unwrap(ToType), isSigned));
|
||||||
unwrap(ToType),
|
|
||||||
isSigned));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType) {
|
||||||
return wrap(ConstantExpr::getFPCast(
|
return wrap(ConstantExpr::getFPCast(unwrap<Constant>(ConstantVal),
|
||||||
unwrap<Constant>(ConstantVal),
|
|
||||||
unwrap(ToType)));
|
unwrap(ToType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
|
LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
|
||||||
LLVMValueRef ConstantIfTrue,
|
LLVMValueRef ConstantIfTrue,
|
||||||
LLVMValueRef ConstantIfFalse) {
|
LLVMValueRef ConstantIfFalse) {
|
||||||
return wrap(ConstantExpr::getSelect(
|
return wrap(ConstantExpr::getSelect(unwrap<Constant>(ConstantCondition),
|
||||||
unwrap<Constant>(ConstantCondition),
|
|
||||||
unwrap<Constant>(ConstantIfTrue),
|
unwrap<Constant>(ConstantIfTrue),
|
||||||
unwrap<Constant>(ConstantIfFalse)));
|
unwrap<Constant>(ConstantIfFalse)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
|
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
|
||||||
LLVMValueRef IndexConstant) {
|
LLVMValueRef IndexConstant) {
|
||||||
return wrap(ConstantExpr::getExtractElement(
|
return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant),
|
||||||
unwrap<Constant>(VectorConstant),
|
|
||||||
unwrap<Constant>(IndexConstant)));
|
unwrap<Constant>(IndexConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
|
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
|
||||||
LLVMValueRef ElementValueConstant,
|
LLVMValueRef ElementValueConstant,
|
||||||
LLVMValueRef IndexConstant) {
|
LLVMValueRef IndexConstant) {
|
||||||
return wrap(ConstantExpr::getInsertElement(
|
return wrap(ConstantExpr::getInsertElement(unwrap<Constant>(VectorConstant),
|
||||||
unwrap<Constant>(VectorConstant),
|
|
||||||
unwrap<Constant>(ElementValueConstant),
|
unwrap<Constant>(ElementValueConstant),
|
||||||
unwrap<Constant>(IndexConstant)));
|
unwrap<Constant>(IndexConstant)));
|
||||||
}
|
}
|
||||||
@ -999,24 +949,21 @@ LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
|
|||||||
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
|
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
|
||||||
LLVMValueRef VectorBConstant,
|
LLVMValueRef VectorBConstant,
|
||||||
LLVMValueRef MaskConstant) {
|
LLVMValueRef MaskConstant) {
|
||||||
return wrap(ConstantExpr::getShuffleVector(
|
return wrap(ConstantExpr::getShuffleVector(unwrap<Constant>(VectorAConstant),
|
||||||
unwrap<Constant>(VectorAConstant),
|
|
||||||
unwrap<Constant>(VectorBConstant),
|
unwrap<Constant>(VectorBConstant),
|
||||||
unwrap<Constant>(MaskConstant)));
|
unwrap<Constant>(MaskConstant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList,
|
LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList,
|
||||||
unsigned NumIdx) {
|
unsigned NumIdx) {
|
||||||
return wrap(ConstantExpr::getExtractValue(
|
return wrap(ConstantExpr::getExtractValue(unwrap<Constant>(AggConstant),
|
||||||
unwrap<Constant>(AggConstant),
|
|
||||||
IdxList, NumIdx));
|
IdxList, NumIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant,
|
LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant,
|
||||||
LLVMValueRef ElementValueConstant,
|
LLVMValueRef ElementValueConstant,
|
||||||
unsigned *IdxList, unsigned NumIdx) {
|
unsigned *IdxList, unsigned NumIdx) {
|
||||||
return wrap(ConstantExpr::getInsertValue(
|
return wrap(ConstantExpr::getInsertValue(unwrap<Constant>(AggConstant),
|
||||||
unwrap<Constant>(AggConstant),
|
|
||||||
unwrap<Constant>(ElementValueConstant),
|
unwrap<Constant>(ElementValueConstant),
|
||||||
IdxList, NumIdx));
|
IdxList, NumIdx));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user