From baf3c404409d5e47b13984a7f95bfbd6d1f2e79e Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 29 Jul 2009 18:55:55 +0000 Subject: Move ConstantExpr to 2.5 API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Constants.h | 36 ++++++++++++++++- include/llvm/LLVMContext.h | 76 ----------------------------------- include/llvm/Support/ConstantFolder.h | 70 ++++++++++++++++---------------- include/llvm/Support/IRBuilder.h | 2 +- include/llvm/Support/NoFolder.h | 2 +- include/llvm/Support/PatternMatch.h | 6 +-- include/llvm/Support/TargetFolder.h | 70 ++++++++++++++++---------------- 7 files changed, 109 insertions(+), 153 deletions(-) (limited to 'include') diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index a3bd551..e8ecfa3 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -584,6 +584,38 @@ public: /// Cast constant expr /// + + /// getAlignOf constant expr - computes the alignment of a type in a target + /// independent way (Note: the return type is an i32; Note: assumes that i8 + /// is byte aligned). + static Constant* getAlignOf(const Type* Ty); + + /// getSizeOf constant expr - computes the size of a type in a target + /// independent way (Note: the return type is an i64). + /// + static Constant* getSizeOf(const Type* Ty); + + static Constant* getNeg(Constant* C); + static Constant* getFNeg(Constant* C); + static Constant* getNot(Constant* C); + static Constant* getAdd(Constant* C1, Constant* C2); + static Constant* getFAdd(Constant* C1, Constant* C2); + static Constant* getSub(Constant* C1, Constant* C2); + static Constant* getFSub(Constant* C1, Constant* C2); + static Constant* getMul(Constant* C1, Constant* C2); + static Constant* getFMul(Constant* C1, Constant* C2); + static Constant* getUDiv(Constant* C1, Constant* C2); + static Constant* getSDiv(Constant* C1, Constant* C2); + static Constant* getFDiv(Constant* C1, Constant* C2); + static Constant* getURem(Constant* C1, Constant* C2); + static Constant* getSRem(Constant* C1, Constant* C2); + static Constant* getFRem(Constant* C1, Constant* C2); + static Constant* getAnd(Constant* C1, Constant* C2); + static Constant* getOr(Constant* C1, Constant* C2); + static Constant* getXor(Constant* C1, Constant* C2); + static Constant* getShl(Constant* C1, Constant* C2); + static Constant* getLShr(Constant* C1, Constant* C2); + static Constant* getAShr(Constant* C1, Constant* C2); static Constant *getTrunc (Constant *C, const Type *Ty); static Constant *getSExt (Constant *C, const Type *Ty); static Constant *getZExt (Constant *C, const Type *Ty); @@ -661,7 +693,7 @@ public: return getSelectTy(V1->getType(), C, V1, V2); } - /// ConstantExpr::get - Return a binary or shift operator constant expression, + /// get - Return a binary or shift operator constant expression, /// folding if possible. /// static Constant *get(unsigned Opcode, Constant *C1, Constant *C2); @@ -669,7 +701,7 @@ public: /// @brief Return an ICmp or FCmp comparison operator constant expression. static Constant *getCompare(unsigned short pred, Constant *C1, Constant *C2); - /// ConstantExpr::get* - Return some common constants without having to + /// get* - Return some common constants without having to /// specify the full Instruction::OPCODE identifier. /// static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS); diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index de118aa..8c3e2ef 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -85,82 +85,6 @@ public: // ConstantAggregateZero accessors ConstantAggregateZero* getConstantAggregateZero(const Type* Ty); - // ConstantExpr accessors - Constant* getConstantExpr(unsigned Opcode, Constant* C1, Constant* C2); - Constant* getConstantExprTrunc(Constant* C, const Type* Ty); - Constant* getConstantExprSExt(Constant* C, const Type* Ty); - Constant* getConstantExprZExt(Constant* C, const Type* Ty); - Constant* getConstantExprFPTrunc(Constant* C, const Type* Ty); - Constant* getConstantExprFPExtend(Constant* C, const Type* Ty); - Constant* getConstantExprUIToFP(Constant* C, const Type* Ty); - Constant* getConstantExprSIToFP(Constant* C, const Type* Ty); - Constant* getConstantExprFPToUI(Constant* C, const Type* Ty); - Constant* getConstantExprFPToSI(Constant* C, const Type* Ty); - Constant* getConstantExprPtrToInt(Constant* C, const Type* Ty); - Constant* getConstantExprIntToPtr(Constant* C, const Type* Ty); - Constant* getConstantExprBitCast(Constant* C, const Type* Ty); - Constant* getConstantExprCast(unsigned ops, Constant* C, const Type* Ty); - Constant* getConstantExprZExtOrBitCast(Constant* C, const Type* Ty); - Constant* getConstantExprSExtOrBitCast(Constant* C, const Type* Ty); - Constant* getConstantExprTruncOrBitCast(Constant* C, const Type* Ty); - Constant* getConstantExprPointerCast(Constant* C, const Type* Ty); - Constant* getConstantExprIntegerCast(Constant* C, const Type* Ty, - bool isSigned); - Constant* getConstantExprFPCast(Constant* C, const Type* Ty); - Constant* getConstantExprSelect(Constant* C, Constant* V1, Constant* V2); - - /// getAlignOf constant expr - computes the alignment of a type in a target - /// independent way (Note: the return type is an i32; Note: assumes that i8 - /// is byte aligned). - /// - Constant* getConstantExprAlignOf(const Type* Ty); - Constant* getConstantExprCompare(unsigned short pred, - Constant* C1, Constant* C2); - Constant* getConstantExprNeg(Constant* C); - Constant* getConstantExprFNeg(Constant* C); - Constant* getConstantExprNot(Constant* C); - Constant* getConstantExprAdd(Constant* C1, Constant* C2); - Constant* getConstantExprFAdd(Constant* C1, Constant* C2); - Constant* getConstantExprSub(Constant* C1, Constant* C2); - Constant* getConstantExprFSub(Constant* C1, Constant* C2); - Constant* getConstantExprMul(Constant* C1, Constant* C2); - Constant* getConstantExprFMul(Constant* C1, Constant* C2); - Constant* getConstantExprUDiv(Constant* C1, Constant* C2); - Constant* getConstantExprSDiv(Constant* C1, Constant* C2); - Constant* getConstantExprFDiv(Constant* C1, Constant* C2); - Constant* getConstantExprURem(Constant* C1, Constant* C2); - Constant* getConstantExprSRem(Constant* C1, Constant* C2); - Constant* getConstantExprFRem(Constant* C1, Constant* C2); - Constant* getConstantExprAnd(Constant* C1, Constant* C2); - Constant* getConstantExprOr(Constant* C1, Constant* C2); - Constant* getConstantExprXor(Constant* C1, Constant* C2); - Constant* getConstantExprICmp(unsigned short pred, Constant* LHS, - Constant* RHS); - Constant* getConstantExprFCmp(unsigned short pred, Constant* LHS, - Constant* RHS); - Constant* getConstantExprShl(Constant* C1, Constant* C2); - Constant* getConstantExprLShr(Constant* C1, Constant* C2); - Constant* getConstantExprAShr(Constant* C1, Constant* C2); - Constant* getConstantExprGetElementPtr(Constant* C, Constant* const* IdxList, - unsigned NumIdx); - Constant* getConstantExprGetElementPtr(Constant* C, Value* const* IdxList, - unsigned NumIdx); - Constant* getConstantExprExtractElement(Constant* Vec, Constant* Idx); - Constant* getConstantExprInsertElement(Constant* Vec, Constant* Elt, - Constant* Idx); - Constant* getConstantExprShuffleVector(Constant* V1, Constant* V2, - Constant* Mask); - Constant* getConstantExprExtractValue(Constant* Agg, const unsigned* IdxList, - unsigned NumIdx); - Constant* getConstantExprInsertValue(Constant* Agg, Constant* Val, - const unsigned* IdxList, - unsigned NumIdx); - - /// getSizeOf constant expr - computes the size of a type in a target - /// independent way (Note: the return type is an i64). - /// - Constant* getConstantExprSizeOf(const Type* Ty); - // MDNode accessors MDNode* getMDNode(Value* const* Vals, unsigned NumVals); diff --git a/include/llvm/Support/ConstantFolder.h b/include/llvm/Support/ConstantFolder.h index 84c2f00..dfcf012 100644 --- a/include/llvm/Support/ConstantFolder.h +++ b/include/llvm/Support/ConstantFolder.h @@ -34,63 +34,63 @@ public: //===--------------------------------------------------------------------===// Constant *CreateAdd(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprAdd(LHS, RHS); + return ConstantExpr::getAdd(LHS, RHS); } Constant *CreateFAdd(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprFAdd(LHS, RHS); + return ConstantExpr::getFAdd(LHS, RHS); } Constant *CreateSub(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprSub(LHS, RHS); + return ConstantExpr::getSub(LHS, RHS); } Constant *CreateFSub(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprFSub(LHS, RHS); + return ConstantExpr::getFSub(LHS, RHS); } Constant *CreateMul(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprMul(LHS, RHS); + return ConstantExpr::getMul(LHS, RHS); } Constant *CreateFMul(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprFMul(LHS, RHS); + return ConstantExpr::getFMul(LHS, RHS); } Constant *CreateUDiv(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprUDiv(LHS, RHS); + return ConstantExpr::getUDiv(LHS, RHS); } Constant *CreateSDiv(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprSDiv(LHS, RHS); + return ConstantExpr::getSDiv(LHS, RHS); } Constant *CreateFDiv(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprFDiv(LHS, RHS); + return ConstantExpr::getFDiv(LHS, RHS); } Constant *CreateURem(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprURem(LHS, RHS); + return ConstantExpr::getURem(LHS, RHS); } Constant *CreateSRem(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprSRem(LHS, RHS); + return ConstantExpr::getSRem(LHS, RHS); } Constant *CreateFRem(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprFRem(LHS, RHS); + return ConstantExpr::getFRem(LHS, RHS); } Constant *CreateShl(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprShl(LHS, RHS); + return ConstantExpr::getShl(LHS, RHS); } Constant *CreateLShr(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprLShr(LHS, RHS); + return ConstantExpr::getLShr(LHS, RHS); } Constant *CreateAShr(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprAShr(LHS, RHS); + return ConstantExpr::getAShr(LHS, RHS); } Constant *CreateAnd(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprAnd(LHS, RHS); + return ConstantExpr::getAnd(LHS, RHS); } Constant *CreateOr(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprOr(LHS, RHS); + return ConstantExpr::getOr(LHS, RHS); } Constant *CreateXor(Constant *LHS, Constant *RHS) const { - return Context.getConstantExprXor(LHS, RHS); + return ConstantExpr::getXor(LHS, RHS); } Constant *CreateBinOp(Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const { - return Context.getConstantExpr(Opc, LHS, RHS); + return ConstantExpr::get(Opc, LHS, RHS); } //===--------------------------------------------------------------------===// @@ -98,13 +98,13 @@ public: //===--------------------------------------------------------------------===// Constant *CreateNeg(Constant *C) const { - return Context.getConstantExprNeg(C); + return ConstantExpr::getNeg(C); } Constant *CreateFNeg(Constant *C) const { - return Context.getConstantExprFNeg(C); + return ConstantExpr::getFNeg(C); } Constant *CreateNot(Constant *C) const { - return Context.getConstantExprNot(C); + return ConstantExpr::getNot(C); } //===--------------------------------------------------------------------===// @@ -113,11 +113,11 @@ public: Constant *CreateGetElementPtr(Constant *C, Constant* const *IdxList, unsigned NumIdx) const { - return Context.getConstantExprGetElementPtr(C, IdxList, NumIdx); + return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx); } Constant *CreateGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx) const { - return Context.getConstantExprGetElementPtr(C, IdxList, NumIdx); + return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx); } //===--------------------------------------------------------------------===// @@ -126,11 +126,11 @@ public: Constant *CreateCast(Instruction::CastOps Op, Constant *C, const Type *DestTy) const { - return Context.getConstantExprCast(Op, C, DestTy); + return ConstantExpr::getCast(Op, C, DestTy); } Constant *CreateIntCast(Constant *C, const Type *DestTy, bool isSigned) const { - return Context.getConstantExprIntegerCast(C, DestTy, isSigned); + return ConstantExpr::getIntegerCast(C, DestTy, isSigned); } Constant *CreateBitCast(Constant *C, const Type *DestTy) const { @@ -143,7 +143,7 @@ public: return CreateCast(Instruction::PtrToInt, C, DestTy); } Constant *CreateTruncOrBitCast(Constant *C, const Type *DestTy) const { - return Context.getConstantExprTruncOrBitCast(C, DestTy); + return ConstantExpr::getTruncOrBitCast(C, DestTy); } //===--------------------------------------------------------------------===// @@ -152,11 +152,11 @@ public: Constant *CreateICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return Context.getConstantExprCompare(P, LHS, RHS); + return ConstantExpr::getCompare(P, LHS, RHS); } Constant *CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return Context.getConstantExprCompare(P, LHS, RHS); + return ConstantExpr::getCompare(P, LHS, RHS); } //===--------------------------------------------------------------------===// @@ -164,31 +164,31 @@ public: //===--------------------------------------------------------------------===// Constant *CreateSelect(Constant *C, Constant *True, Constant *False) const { - return Context.getConstantExprSelect(C, True, False); + return ConstantExpr::getSelect(C, True, False); } Constant *CreateExtractElement(Constant *Vec, Constant *Idx) const { - return Context.getConstantExprExtractElement(Vec, Idx); + return ConstantExpr::getExtractElement(Vec, Idx); } Constant *CreateInsertElement(Constant *Vec, Constant *NewElt, Constant *Idx) const { - return Context.getConstantExprInsertElement(Vec, NewElt, Idx); + return ConstantExpr::getInsertElement(Vec, NewElt, Idx); } Constant *CreateShuffleVector(Constant *V1, Constant *V2, Constant *Mask) const { - return Context.getConstantExprShuffleVector(V1, V2, Mask); + return ConstantExpr::getShuffleVector(V1, V2, Mask); } Constant *CreateExtractValue(Constant *Agg, const unsigned *IdxList, unsigned NumIdx) const { - return Context.getConstantExprExtractValue(Agg, IdxList, NumIdx); + return ConstantExpr::getExtractValue(Agg, IdxList, NumIdx); } Constant *CreateInsertValue(Constant *Agg, Constant *Val, const unsigned *IdxList, unsigned NumIdx) const { - return Context.getConstantExprInsertValue(Agg, Val, IdxList, NumIdx); + return ConstantExpr::getInsertValue(Agg, Val, IdxList, NumIdx); } }; diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index 12439d4..058a9bb 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -726,7 +726,7 @@ public: Value *RHS_int = CreatePtrToInt(RHS, Type::Int64Ty); Value *Difference = CreateSub(LHS_int, RHS_int); return CreateSDiv(Difference, - Context.getConstantExprSizeOf(ArgType->getElementType()), + ConstantExpr::getSizeOf(ArgType->getElementType()), Name); } }; diff --git a/include/llvm/Support/NoFolder.h b/include/llvm/Support/NoFolder.h index c110270..6c9ac45 100644 --- a/include/llvm/Support/NoFolder.h +++ b/include/llvm/Support/NoFolder.h @@ -116,7 +116,7 @@ public: Constant *CreateGetElementPtr(Constant *C, Constant* const *IdxList, unsigned NumIdx) const { - return Context.getConstantExprGetElementPtr(C, IdxList, NumIdx); + return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx); } Value *CreateGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx) const { diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h index 7a93b76..5243d4d 100644 --- a/include/llvm/Support/PatternMatch.h +++ b/include/llvm/Support/PatternMatch.h @@ -465,7 +465,7 @@ struct not_match { if (CE->getOpcode() == Instruction::Xor) return matchIfNot(CE->getOperand(0), CE->getOperand(1), Context); if (ConstantInt *CI = dyn_cast(V)) - return L.match(Context.getConstantExprNot(CI), Context); + return L.match(ConstantExpr::getNot(CI), Context); return false; } private: @@ -501,7 +501,7 @@ struct neg_match { if (CE->getOpcode() == Instruction::Sub) return matchIfNeg(CE->getOperand(0), CE->getOperand(1), Context); if (ConstantInt *CI = dyn_cast(V)) - return L.match(Context.getConstantExprNeg(CI), Context); + return L.match(ConstantExpr::getNeg(CI), Context); return false; } private: @@ -530,7 +530,7 @@ struct fneg_match { if (CE->getOpcode() == Instruction::FSub) return matchIfFNeg(CE->getOperand(0), CE->getOperand(1), Context); if (ConstantFP *CF = dyn_cast(V)) - return L.match(Context.getConstantExprFNeg(CF), Context); + return L.match(ConstantExpr::getFNeg(CF), Context); return false; } private: diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index 1e49850..93c5026 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -49,63 +49,63 @@ public: //===--------------------------------------------------------------------===// Constant *CreateAdd(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprAdd(LHS, RHS)); + return Fold(ConstantExpr::getAdd(LHS, RHS)); } Constant *CreateFAdd(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprFAdd(LHS, RHS)); + return Fold(ConstantExpr::getFAdd(LHS, RHS)); } Constant *CreateSub(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprSub(LHS, RHS)); + return Fold(ConstantExpr::getSub(LHS, RHS)); } Constant *CreateFSub(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprFSub(LHS, RHS)); + return Fold(ConstantExpr::getFSub(LHS, RHS)); } Constant *CreateMul(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprMul(LHS, RHS)); + return Fold(ConstantExpr::getMul(LHS, RHS)); } Constant *CreateFMul(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprFMul(LHS, RHS)); + return Fold(ConstantExpr::getFMul(LHS, RHS)); } Constant *CreateUDiv(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprUDiv(LHS, RHS)); + return Fold(ConstantExpr::getUDiv(LHS, RHS)); } Constant *CreateSDiv(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprSDiv(LHS, RHS)); + return Fold(ConstantExpr::getSDiv(LHS, RHS)); } Constant *CreateFDiv(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprFDiv(LHS, RHS)); + return Fold(ConstantExpr::getFDiv(LHS, RHS)); } Constant *CreateURem(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprURem(LHS, RHS)); + return Fold(ConstantExpr::getURem(LHS, RHS)); } Constant *CreateSRem(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprSRem(LHS, RHS)); + return Fold(ConstantExpr::getSRem(LHS, RHS)); } Constant *CreateFRem(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprFRem(LHS, RHS)); + return Fold(ConstantExpr::getFRem(LHS, RHS)); } Constant *CreateShl(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprShl(LHS, RHS)); + return Fold(ConstantExpr::getShl(LHS, RHS)); } Constant *CreateLShr(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprLShr(LHS, RHS)); + return Fold(ConstantExpr::getLShr(LHS, RHS)); } Constant *CreateAShr(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprAShr(LHS, RHS)); + return Fold(ConstantExpr::getAShr(LHS, RHS)); } Constant *CreateAnd(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprAnd(LHS, RHS)); + return Fold(ConstantExpr::getAnd(LHS, RHS)); } Constant *CreateOr(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprOr(LHS, RHS)); + return Fold(ConstantExpr::getOr(LHS, RHS)); } Constant *CreateXor(Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprXor(LHS, RHS)); + return Fold(ConstantExpr::getXor(LHS, RHS)); } Constant *CreateBinOp(Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExpr(Opc, LHS, RHS)); + return Fold(ConstantExpr::get(Opc, LHS, RHS)); } //===--------------------------------------------------------------------===// @@ -113,13 +113,13 @@ public: //===--------------------------------------------------------------------===// Constant *CreateNeg(Constant *C) const { - return Fold(Context.getConstantExprNeg(C)); + return Fold(ConstantExpr::getNeg(C)); } Constant *CreateFNeg(Constant *C) const { - return Fold(Context.getConstantExprFNeg(C)); + return Fold(ConstantExpr::getFNeg(C)); } Constant *CreateNot(Constant *C) const { - return Fold(Context.getConstantExprNot(C)); + return Fold(ConstantExpr::getNot(C)); } //===--------------------------------------------------------------------===// @@ -128,11 +128,11 @@ public: Constant *CreateGetElementPtr(Constant *C, Constant* const *IdxList, unsigned NumIdx) const { - return Fold(Context.getConstantExprGetElementPtr(C, IdxList, NumIdx)); + return Fold(ConstantExpr::getGetElementPtr(C, IdxList, NumIdx)); } Constant *CreateGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx) const { - return Fold(Context.getConstantExprGetElementPtr(C, IdxList, NumIdx)); + return Fold(ConstantExpr::getGetElementPtr(C, IdxList, NumIdx)); } //===--------------------------------------------------------------------===// @@ -143,13 +143,13 @@ public: const Type *DestTy) const { if (C->getType() == DestTy) return C; // avoid calling Fold - return Fold(Context.getConstantExprCast(Op, C, DestTy)); + return Fold(ConstantExpr::getCast(Op, C, DestTy)); } Constant *CreateIntCast(Constant *C, const Type *DestTy, bool isSigned) const { if (C->getType() == DestTy) return C; // avoid calling Fold - return Fold(Context.getConstantExprIntegerCast(C, DestTy, isSigned)); + return Fold(ConstantExpr::getIntegerCast(C, DestTy, isSigned)); } Constant *CreateBitCast(Constant *C, const Type *DestTy) const { @@ -164,7 +164,7 @@ public: Constant *CreateTruncOrBitCast(Constant *C, const Type *DestTy) const { if (C->getType() == DestTy) return C; // avoid calling Fold - return Fold(Context.getConstantExprTruncOrBitCast(C, DestTy)); + return Fold(ConstantExpr::getTruncOrBitCast(C, DestTy)); } //===--------------------------------------------------------------------===// @@ -173,11 +173,11 @@ public: Constant *CreateICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprCompare(P, LHS, RHS)); + return Fold(ConstantExpr::getCompare(P, LHS, RHS)); } Constant *CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return Fold(Context.getConstantExprCompare(P, LHS, RHS)); + return Fold(ConstantExpr::getCompare(P, LHS, RHS)); } //===--------------------------------------------------------------------===// @@ -185,31 +185,31 @@ public: //===--------------------------------------------------------------------===// Constant *CreateSelect(Constant *C, Constant *True, Constant *False) const { - return Fold(Context.getConstantExprSelect(C, True, False)); + return Fold(ConstantExpr::getSelect(C, True, False)); } Constant *CreateExtractElement(Constant *Vec, Constant *Idx) const { - return Fold(Context.getConstantExprExtractElement(Vec, Idx)); + return Fold(ConstantExpr::getExtractElement(Vec, Idx)); } Constant *CreateInsertElement(Constant *Vec, Constant *NewElt, Constant *Idx) const { - return Fold(Context.getConstantExprInsertElement(Vec, NewElt, Idx)); + return Fold(ConstantExpr::getInsertElement(Vec, NewElt, Idx)); } Constant *CreateShuffleVector(Constant *V1, Constant *V2, Constant *Mask) const { - return Fold(Context.getConstantExprShuffleVector(V1, V2, Mask)); + return Fold(ConstantExpr::getShuffleVector(V1, V2, Mask)); } Constant *CreateExtractValue(Constant *Agg, const unsigned *IdxList, unsigned NumIdx) const { - return Fold(Context.getConstantExprExtractValue(Agg, IdxList, NumIdx)); + return Fold(ConstantExpr::getExtractValue(Agg, IdxList, NumIdx)); } Constant *CreateInsertValue(Constant *Agg, Constant *Val, const unsigned *IdxList, unsigned NumIdx) const { - return Fold(Context.getConstantExprInsertValue(Agg, Val, IdxList, NumIdx)); + return Fold(ConstantExpr::getInsertValue(Agg, Val, IdxList, NumIdx)); } }; -- cgit v1.1