diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-29 18:55:55 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-29 18:55:55 +0000 |
commit | baf3c404409d5e47b13984a7f95bfbd6d1f2e79e (patch) | |
tree | c06618ee06936e7f5a1dc3c30b313ee49d5eb09b /include/llvm/Support | |
parent | 26ef510d5d20b89c637d13e2d9169c0458de775c (diff) |
Move ConstantExpr to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/ConstantFolder.h | 70 | ||||
-rw-r--r-- | include/llvm/Support/IRBuilder.h | 2 | ||||
-rw-r--r-- | include/llvm/Support/NoFolder.h | 2 | ||||
-rw-r--r-- | include/llvm/Support/PatternMatch.h | 6 | ||||
-rw-r--r-- | include/llvm/Support/TargetFolder.h | 70 |
5 files changed, 75 insertions, 75 deletions
diff --git a/include/llvm/Support/ConstantFolder.h b/include/llvm/Support/ConstantFolder.h index 84c2f00c69..dfcf012b71 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 12439d4486..058a9bbd1e 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 c110270f32..6c9ac450d4 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 7a93b7665f..5243d4d24e 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<ConstantInt>(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<ConstantInt>(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<ConstantFP>(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 1e49850f68..93c50269fa 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)); } }; |