LLVM API Documentation
#include <Instructions.h>
Public Member Functions | |
| virtual GetElementPtrInst * | clone (LLVMContext &Context) const |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
| Transparently provide more efficient getOperand methods. | |
| const PointerType * | getType () const |
| op_iterator | idx_begin () |
| const_op_iterator | idx_begin () const |
| op_iterator | idx_end () |
| const_op_iterator | idx_end () const |
| Value * | getPointerOperand () |
| const Value * | getPointerOperand () const |
| const PointerType * | getPointerOperandType () const |
| unsigned | getNumIndices () const |
| bool | hasIndices () const |
| bool | hasAllZeroIndices () const |
| bool | hasAllConstantIndices () const |
Static Public Member Functions | |
| template<typename InputIterator> | |
| static GetElementPtrInst * | Create (Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, const Twine &NameStr="", Instruction *InsertBefore=0) |
| template<typename InputIterator> | |
| static GetElementPtrInst * | Create (Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| static GetElementPtrInst * | Create (Value *Ptr, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=0) |
| static GetElementPtrInst * | Create (Value *Ptr, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| template<typename InputIterator> | |
| static GetElementPtrInst * | CreateInBounds (Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, const Twine &NameStr="", Instruction *InsertBefore=0) |
| template<typename InputIterator> | |
| static GetElementPtrInst * | CreateInBounds (Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| static GetElementPtrInst * | CreateInBounds (Value *Ptr, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=0) |
| static GetElementPtrInst * | CreateInBounds (Value *Ptr, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd) |
| template<typename InputIterator> | |
| static const Type * | getIndexedType (const Type *Ptr, InputIterator IdxBegin, InputIterator IdxEnd) |
| static const Type * | getIndexedType (const Type *Ptr, Value *const *Idx, unsigned NumIdx) |
| static const Type * | getIndexedType (const Type *Ptr, uint64_t const *Idx, unsigned NumIdx) |
| static const Type * | getIndexedType (const Type *Ptr, Value *Idx) |
| static unsigned | getPointerOperandIndex () |
| static bool | classof (const GetElementPtrInst *) |
| static bool | classof (const Instruction *I) |
| Methods for support type inquiry through isa, cast, and dyn_cast:. | |
| static bool | classof (const Value *V) |
Definition at line 375 of file Instructions.h.
| static GetElementPtrInst* llvm::GetElementPtrInst::Create | ( | Value * | Ptr, | |
| InputIterator | IdxBegin, | |||
| InputIterator | IdxEnd, | |||
| const Twine & | NameStr = "", |
|||
| Instruction * | InsertBefore = 0 | |||
| ) | [inline, static] |
Definition at line 446 of file Instructions.h.
Referenced by llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstGEP1_32(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstGEP1_64(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstGEP2_32(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstGEP2_64(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateGEP(), llvm::NoFolder::CreateGetElementPtr(), CreateInBounds(), OptimizeGlobalAddressOfMalloc(), RewriteHeapSROALoadUser(), and SRAGlobal().
| static GetElementPtrInst* llvm::GetElementPtrInst::Create | ( | Value * | Ptr, | |
| InputIterator | IdxBegin, | |||
| InputIterator | IdxEnd, | |||
| const Twine & | NameStr, | |||
| BasicBlock * | InsertAtEnd | |||
| ) | [inline, static] |
Definition at line 456 of file Instructions.h.
| static GetElementPtrInst* llvm::GetElementPtrInst::Create | ( | Value * | Ptr, | |
| Value * | Idx, | |||
| const Twine & | NameStr = "", |
|||
| Instruction * | InsertBefore = 0 | |||
| ) | [inline, static] |
Constructors - These two creators are convenience methods because one index getelementptr instructions are so common.
Definition at line 468 of file Instructions.h.
| static GetElementPtrInst* llvm::GetElementPtrInst::Create | ( | Value * | Ptr, | |
| Value * | Idx, | |||
| const Twine & | NameStr, | |||
| BasicBlock * | InsertAtEnd | |||
| ) | [inline, static] |
Definition at line 473 of file Instructions.h.
| static GetElementPtrInst* llvm::GetElementPtrInst::CreateInBounds | ( | Value * | Ptr, | |
| InputIterator | IdxBegin, | |||
| InputIterator | IdxEnd, | |||
| const Twine & | NameStr = "", |
|||
| Instruction * | InsertBefore = 0 | |||
| ) | [inline, static] |
Create an "inbounds" getelementptr. See the documentation for the "inbounds" flag in LangRef.html for details.
Definition at line 482 of file Instructions.h.
References Create().
Referenced by llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstInBoundsGEP1_32(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstInBoundsGEP1_64(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstInBoundsGEP2_32(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstInBoundsGEP2_64(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateInBoundsGEP(), and llvm::NoFolder::CreateInBoundsGetElementPtr().
| static GetElementPtrInst* llvm::GetElementPtrInst::CreateInBounds | ( | Value * | Ptr, | |
| InputIterator | IdxBegin, | |||
| InputIterator | IdxEnd, | |||
| const Twine & | NameStr, | |||
| BasicBlock * | InsertAtEnd | |||
| ) | [inline, static] |
| static GetElementPtrInst* llvm::GetElementPtrInst::CreateInBounds | ( | Value * | Ptr, | |
| Value * | Idx, | |||
| const Twine & | NameStr = "", |
|||
| Instruction * | InsertBefore = 0 | |||
| ) | [inline, static] |
| static GetElementPtrInst* llvm::GetElementPtrInst::CreateInBounds | ( | Value * | Ptr, | |
| Value * | Idx, | |||
| const Twine & | NameStr, | |||
| BasicBlock * | InsertAtEnd | |||
| ) | [inline, static] |
| GetElementPtrInst * GetElementPtrInst::clone | ( | LLVMContext & | Context | ) | const [virtual] |
clone() - Create a copy of 'this' instruction that is identical in all ways except the following: The instruction has no parent The instruction has no name
Implements llvm::Instruction.
Definition at line 2865 of file Instructions.cpp.
References llvm::User::getNumOperands(), and llvm::Value::SubclassOptionalData.
| llvm::GetElementPtrInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Transparently provide more efficient getOperand methods.
| const PointerType* llvm::GetElementPtrInst::getType | ( | ) | const [inline] |
All values are typed, get the type of this value.
Reimplemented from llvm::Value.
Definition at line 523 of file Instructions.h.
References llvm::Intrinsic::getType().
| static const Type* llvm::GetElementPtrInst::getIndexedType | ( | const Type * | Ptr, | |
| InputIterator | IdxBegin, | |||
| InputIterator | IdxEnd | |||
| ) | [inline, static] |
getIndexedType - Returns the type of the element that would be loaded with a load instruction with the specified parameters.
Null is returned if the indices are invalid for the specified pointer type.
Definition at line 534 of file Instructions.h.
Definition at line 1125 of file Instructions.cpp.
References llvm::dyn_cast(), llvm::SequentialType::getElementType(), and llvm::SequentialType::indexValid().
| op_iterator llvm::GetElementPtrInst::idx_begin | ( | ) | [inline] |
| const_op_iterator llvm::GetElementPtrInst::idx_begin | ( | ) | const [inline] |
| op_iterator llvm::GetElementPtrInst::idx_end | ( | ) | [inline] |
| const_op_iterator llvm::GetElementPtrInst::idx_end | ( | ) | const [inline] |
| Value* llvm::GetElementPtrInst::getPointerOperand | ( | ) | [inline] |
Definition at line 555 of file Instructions.h.
References llvm::User::getOperand().
Referenced by getPointerOperandType(), and llvm::Interpreter::visitGetElementPtrInst().
| const Value* llvm::GetElementPtrInst::getPointerOperand | ( | ) | const [inline] |
| static unsigned llvm::GetElementPtrInst::getPointerOperandIndex | ( | ) | [inline, static] |
Definition at line 561 of file Instructions.h.
| const PointerType* llvm::GetElementPtrInst::getPointerOperandType | ( | ) | const [inline] |
getPointerOperandType - Method to return the pointer operand as a PointerType.
Definition at line 567 of file Instructions.h.
References getPointerOperand(), and llvm::Value::getType().
| unsigned llvm::GetElementPtrInst::getNumIndices | ( | ) | const [inline] |
| bool llvm::GetElementPtrInst::hasIndices | ( | ) | const [inline] |
| bool GetElementPtrInst::hasAllZeroIndices | ( | ) | const |
hasAllZeroIndices - Return true if all of the indices of this GEP are zeros. If so, the result pointer and the first operand have the same value, just potentially different types.
hasAllZeroIndices - Return true if all of the indices of this GEP are zeros. If so, the result pointer and the first operand have the same value, just potentially different types.
Definition at line 1139 of file Instructions.cpp.
References llvm::User::getNumOperands(), and llvm::User::getOperand().
Referenced by equals(), and isOnlyCopiedFromConstantGlobal().
| bool GetElementPtrInst::hasAllConstantIndices | ( | ) | const |
hasAllConstantIndices - Return true if all of the indices of this GEP are constant integers. If so, the result pointer and the first operand have a constant offset between them.
hasAllConstantIndices - Return true if all of the indices of this GEP are constant integers. If so, the result pointer and the first operand have a constant offset between them.
Definition at line 1153 of file Instructions.cpp.
References llvm::User::getNumOperands(), and llvm::User::getOperand().
Referenced by isSafeAndProfitableToSinkLoad().
| static bool llvm::GetElementPtrInst::classof | ( | const GetElementPtrInst * | ) | [inline, static] |
| static bool llvm::GetElementPtrInst::classof | ( | const Instruction * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Reimplemented from llvm::Instruction.
Definition at line 592 of file Instructions.h.
References llvm::Instruction::getOpcode().
Reimplemented from llvm::Instruction.
Definition at line 595 of file Instructions.h.
References classof().