diff options
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Constants.h | 12 | ||||
-rw-r--r-- | include/llvm/Support/ConstantFolder.h | 8 | ||||
-rw-r--r-- | include/llvm/Support/NoFolder.h | 2 | ||||
-rw-r--r-- | include/llvm/Support/TargetFolder.h | 8 |
4 files changed, 21 insertions, 9 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 8566ba0..da6fe96 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -648,6 +648,9 @@ public: static Constant *getIntToPtr(Constant *C, const Type *Ty); static Constant *getBitCast (Constant *C, const Type *Ty); + static Constant* getNSWAdd(Constant* C1, Constant* C2); + static Constant* getExactSDiv(Constant* C1, Constant* C2); + /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); @@ -734,6 +737,15 @@ public: static Constant *getGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx); + /// Create an "inbounds" getelementptr. See the documentation for the + /// "inbounds" flag in LangRef.html for details. + static Constant *getInBoundsGetElementPtr(Constant *C, + Constant* const *IdxList, + unsigned NumIdx); + static Constant *getInBoundsGetElementPtr(Constant *C, + Value* const *IdxList, + unsigned NumIdx); + static Constant *getExtractElement(Constant *Vec, Constant *Idx); static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx); static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask); diff --git a/include/llvm/Support/ConstantFolder.h b/include/llvm/Support/ConstantFolder.h index 8ce5237..3c9278a 100644 --- a/include/llvm/Support/ConstantFolder.h +++ b/include/llvm/Support/ConstantFolder.h @@ -36,7 +36,7 @@ public: return ConstantExpr::getAdd(LHS, RHS); } Constant *CreateNSWAdd(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getAdd(LHS, RHS); + return ConstantExpr::getNSWAdd(LHS, RHS); } Constant *CreateFAdd(Constant *LHS, Constant *RHS) const { return ConstantExpr::getFAdd(LHS, RHS); @@ -60,7 +60,7 @@ public: return ConstantExpr::getSDiv(LHS, RHS); } Constant *CreateExactSDiv(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getSDiv(LHS, RHS); + return ConstantExpr::getExactSDiv(LHS, RHS); } Constant *CreateFDiv(Constant *LHS, Constant *RHS) const { return ConstantExpr::getFDiv(LHS, RHS); @@ -127,11 +127,11 @@ public: Constant *CreateInBoundsGetElementPtr(Constant *C, Constant* const *IdxList, unsigned NumIdx) const { - return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx); + return ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx); } Constant *CreateInBoundsGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx) const { - return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx); + return ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx); } //===--------------------------------------------------------------------===// diff --git a/include/llvm/Support/NoFolder.h b/include/llvm/Support/NoFolder.h index 0072471..4540f02 100644 --- a/include/llvm/Support/NoFolder.h +++ b/include/llvm/Support/NoFolder.h @@ -131,7 +131,7 @@ public: Constant *CreateInBoundsGetElementPtr(Constant *C, Constant* const *IdxList, unsigned NumIdx) const { - return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx); + return ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx); } Value *CreateInBoundsGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx) const { diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index 80ab900..77533c0 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -52,7 +52,7 @@ public: return Fold(ConstantExpr::getAdd(LHS, RHS)); } Constant *CreateNSWAdd(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getAdd(LHS, RHS)); + return Fold(ConstantExpr::getNSWAdd(LHS, RHS)); } Constant *CreateFAdd(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getFAdd(LHS, RHS)); @@ -76,7 +76,7 @@ public: return Fold(ConstantExpr::getSDiv(LHS, RHS)); } Constant *CreateExactSDiv(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getSDiv(LHS, RHS)); + return Fold(ConstantExpr::getExactSDiv(LHS, RHS)); } Constant *CreateFDiv(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getFDiv(LHS, RHS)); @@ -143,11 +143,11 @@ public: Constant *CreateInBoundsGetElementPtr(Constant *C, Constant* const *IdxList, unsigned NumIdx) const { - return Fold(ConstantExpr::getGetElementPtr(C, IdxList, NumIdx)); + return Fold(ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx)); } Constant *CreateInBoundsGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx) const { - return Fold(ConstantExpr::getGetElementPtr(C, IdxList, NumIdx)); + return Fold(ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx)); } //===--------------------------------------------------------------------===// |