summaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-11 05:34:33 +0000
committerChris Lattner <sabre@nondot.org>2011-02-11 05:34:33 +0000
commit1f78d51be69964b38c5fc76ceb2147b737d09857 (patch)
treec9cc9275cb54a35a850b1088447e7f50560fb6b5 /include/llvm/Constants.h
parentef1860a117b4a35918eb9793a7b94715e12a3a42 (diff)
downloadllvm-1f78d51be69964b38c5fc76ceb2147b737d09857.tar.gz
llvm-1f78d51be69964b38c5fc76ceb2147b737d09857.tar.bz2
llvm-1f78d51be69964b38c5fc76ceb2147b737d09857.tar.xz
make the constantexpr interfaces for inbounds GEPs follow the same style
as other constantexpr flags, reducing redundancy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 24a8803c4b..50e64d4c8b 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -631,11 +631,8 @@ protected:
Constant *C1, Constant *C2, Constant *C3);
template<typename IndexTy>
static Constant *getGetElementPtrTy(const Type *Ty, Constant *C,
- IndexTy const *Idxs, unsigned NumIdxs);
- template<typename IndexTy>
- static Constant *getInBoundsGetElementPtrTy(const Type *Ty, Constant *C,
- IndexTy const *Idxs,
- unsigned NumIdxs);
+ IndexTy const *Idxs, unsigned NumIdxs,
+ bool InBounds);
static Constant *getExtractElementTy(const Type *Ty, Constant *Val,
Constant *Idx);
static Constant *getInsertElementTy(const Type *Ty, Constant *Val,
@@ -650,11 +647,7 @@ protected:
template<typename IndexTy>
static Constant *getGetElementPtrImpl(Constant *C,
IndexTy const *IdxList,
- unsigned NumIdx);
- template<typename IndexTy>
- static Constant *getInBoundsGetElementPtrImpl(Constant *C,
- IndexTy const *IdxList,
- unsigned NumIdx);
+ unsigned NumIdx, bool InBounds);
public:
// Static methods to construct a ConstantExpr of different kinds. Note that
@@ -849,18 +842,24 @@ public:
/// all elements must be Constant's.
///
static Constant *getGetElementPtr(Constant *C,
- Constant *const *IdxList, unsigned NumIdx);
+ Constant *const *IdxList, unsigned NumIdx,
+ bool InBounds = false);
static Constant *getGetElementPtr(Constant *C,
- Value* const *IdxList, unsigned NumIdx);
+ Value *const *IdxList, unsigned NumIdx,
+ bool InBounds = false);
/// 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);
+ unsigned NumIdx) {
+ return getGetElementPtr(C, IdxList, NumIdx, true);
+ }
static Constant *getInBoundsGetElementPtr(Constant *C,
Value* const *IdxList,
- unsigned NumIdx);
+ unsigned NumIdx) {
+ return getGetElementPtr(C, IdxList, NumIdx, true);
+ }
static Constant *getExtractElement(Constant *Vec, Constant *Idx);
static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx);