diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-01-14 08:07:43 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-01-14 08:07:43 +0000 |
commit | 25052d8d64f18a85d6a84e0e010f6ba3eba0760d (patch) | |
tree | 3303905c62ad6228c42e26c484d442f3ec187dd6 /include/llvm/Constants.h | |
parent | e0a1a5ba91df6817f9ffae7af65ed0bda66f7620 (diff) | |
download | llvm-25052d8d64f18a85d6a84e0e010f6ba3eba0760d.tar.gz llvm-25052d8d64f18a85d6a84e0e010f6ba3eba0760d.tar.bz2 llvm-25052d8d64f18a85d6a84e0e010f6ba3eba0760d.tar.xz |
Remove casts between Value** and Constant**, which won't work if a
static_cast from Constant* to Value* has to adjust the "this" pointer.
This is groundwork for PR889.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r-- | include/llvm/Constants.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 229ef9c76f..738c90cee7 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -629,10 +629,12 @@ protected: Constant *C2); static Constant *getSelectTy(const Type *Ty, Constant *C1, Constant *C2, Constant *C3); + template<typename IndexTy> static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, - Value* const *Idxs, unsigned NumIdxs); + IndexTy const *Idxs, unsigned NumIdxs); + template<typename IndexTy> static Constant *getInBoundsGetElementPtrTy(const Type *Ty, Constant *C, - Value* const *Idxs, + IndexTy const *Idxs, unsigned NumIdxs); static Constant *getExtractElementTy(const Type *Ty, Constant *Val, Constant *Idx); @@ -645,6 +647,14 @@ protected: static Constant *getInsertValueTy(const Type *Ty, Constant *Agg, Constant *Val, const unsigned *Idxs, unsigned NumIdxs); + 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); public: // Static methods to construct a ConstantExpr of different kinds. Note that |