diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-03 05:43:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-03 05:43:30 +0000 |
commit | 38bacf29e8716d1ca2f10c6e92fe7a12f358502c (patch) | |
tree | ac89900d4a4202f4d90be15750bd4d2596622685 /include/llvm/Instructions.h | |
parent | 4c42937b6449693eb008b8049bb78fbb56f0f884 (diff) |
add direct support for making GEP instrs with one index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r-- | include/llvm/Instructions.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 0981d6bb29..06d0490725 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -300,6 +300,7 @@ class GetElementPtrInst : public Instruction { } void init(Value *Ptr, const std::vector<Value*> &Idx); void init(Value *Ptr, Value *Idx0, Value *Idx1); + void init(Value *Ptr, Value *Idx); public: /// Constructors - Create a getelementptr instruction with a base pointer an /// list of indices. The first ctor can optionally insert before an existing @@ -310,8 +311,12 @@ public: GetElementPtrInst(Value *Ptr, const std::vector<Value*> &Idx, const std::string &Name, BasicBlock *InsertAtEnd); - /// Constructors - These two constructors are convenience methods because two - /// index getelementptr instructions are so common. + /// Constructors - These two constructors are convenience methods because one + /// and two index getelementptr instructions are so common. + GetElementPtrInst(Value *Ptr, Value *Idx, + const std::string &Name = "", Instruction *InsertBefore =0); + GetElementPtrInst(Value *Ptr, Value *Idx, + const std::string &Name, BasicBlock *InsertAtEnd); GetElementPtrInst(Value *Ptr, Value *Idx0, Value *Idx1, const std::string &Name = "", Instruction *InsertBefore =0); GetElementPtrInst(Value *Ptr, Value *Idx0, Value *Idx1, @@ -336,6 +341,7 @@ public: bool AllowStructLeaf = false); static const Type *getIndexedType(const Type *Ptr, Value *Idx0, Value *Idx1, bool AllowStructLeaf = false); + static const Type *getIndexedType(const Type *Ptr, Value *Idx); inline op_iterator idx_begin() { return op_begin()+1; } inline const_op_iterator idx_begin() const { return op_begin()+1; } |