Allow creation of GEP constantexprs with a vector of value* operands as

well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16923 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2004-10-11 22:52:25 +00:00
parent 4b83380f33
commit 7fa6e666ec
5 changed files with 44 additions and 29 deletions

View File

@@ -533,7 +533,7 @@ protected:
static Constant *getSelectTy(const Type *Ty,
Constant *C1, Constant *C2, Constant *C3);
static Constant *getGetElementPtrTy(const Type *Ty, Constant *C,
const std::vector<Constant*> &IdxList);
const std::vector<Value*> &IdxList);
public:
// Static methods to construct a ConstantExpr of different kinds. Note that
@@ -584,10 +584,13 @@ public:
static Constant *getUShr(Constant *C1, Constant *C2); // unsigned shr
static Constant *getSShr(Constant *C1, Constant *C2); // signed shr
/// Getelementptr form...
/// Getelementptr form. std::vector<Value*> is only accepted for convenience:
/// all elements must be Constant's.
///
static Constant *getGetElementPtr(Constant *C,
const std::vector<Constant*> &IdxList);
static Constant *getGetElementPtr(Constant *C,
const std::vector<Value*> &IdxList);
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue.