LLVM API Documentation
#include <Instructions.h>
Inheritance diagram for llvm::GetElementPtrInst:
Public Member Functions | |
GetElementPtrInst (Value *Ptr, const std::vector< Value * > &Idx, const std::string &Name="", Instruction *InsertBefore=0) | |
GetElementPtrInst (Value *Ptr, const std::vector< Value * > &Idx, const std::string &Name, BasicBlock *InsertAtEnd) | |
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, const std::string &Name, BasicBlock *InsertAtEnd) | |
~GetElementPtrInst () | |
virtual GetElementPtrInst * | clone () const |
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 |
unsigned | getNumIndices () const |
bool | hasIndices () const |
Static Public Member Functions | |
static const Type * | getIndexedType (const Type *Ptr, const std::vector< Value * > &Indices, 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) |
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 331 of file Instructions.h.
GetElementPtrInst::GetElementPtrInst | ( | Value * | Ptr, | |
const std::vector< Value * > & | Idx, | |||
const std::string & | Name = "" , |
|||
Instruction * | InsertBefore = 0 | |||
) |
Constructors - Create a getelementptr instruction with a base pointer an list of indices. The first ctor can optionally insert before an existing instruction, the second appends the new instruction to the specified BasicBlock.
Definition at line 711 of file Instructions.cpp.
GetElementPtrInst::GetElementPtrInst | ( | Value * | Ptr, | |
const std::vector< Value * > & | Idx, | |||
const std::string & | Name, | |||
BasicBlock * | InsertAtEnd | |||
) |
Definition at line 719 of file Instructions.cpp.
GetElementPtrInst::GetElementPtrInst | ( | Value * | Ptr, | |
Value * | Idx, | |||
const std::string & | Name = "" , |
|||
Instruction * | InsertBefore = 0 | |||
) |
Constructors - These two constructors are convenience methods because one and two index getelementptr instructions are so common.
Definition at line 727 of file Instructions.cpp.
References Idx.
GetElementPtrInst::GetElementPtrInst | ( | Value * | Ptr, | |
Value * | Idx, | |||
const std::string & | Name, | |||
BasicBlock * | InsertAtEnd | |||
) |
GetElementPtrInst::GetElementPtrInst | ( | Value * | Ptr, | |
Value * | Idx0, | |||
Value * | Idx1, | |||
const std::string & | Name = "" , |
|||
Instruction * | InsertBefore = 0 | |||
) |
Definition at line 741 of file Instructions.cpp.
GetElementPtrInst::GetElementPtrInst | ( | Value * | Ptr, | |
Value * | Idx0, | |||
Value * | Idx1, | |||
const std::string & | Name, | |||
BasicBlock * | InsertAtEnd | |||
) |
Definition at line 749 of file Instructions.cpp.
GetElementPtrInst::~GetElementPtrInst | ( | ) |
GetElementPtrInst * GetElementPtrInst::clone | ( | ) | 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 1309 of file Instructions.cpp.
const PointerType* llvm::GetElementPtrInst::getType | ( | ) | const [inline] |
All values are typed, get the type of this value.
Reimplemented from llvm::Value.
Definition at line 368 of file Instructions.h.
References llvm::Value::getType().
Referenced by llvm::ExpressionConvertibleToType(), OptimizeGEPExpression(), and ReplaceUsesOfGEPInst().
const Type * GetElementPtrInst::getIndexedType | ( | const Type * | Ptr, | |
const std::vector< Value * > & | Indices, | |||
bool | AllowStructLeaf = false | |||
) | [static] |
getIndexedType - Returns the type of the element that would be loaded with a load instruction with the specified parameters.
A null type is returned if the indices are invalid for the specified pointer type.
Definition at line 767 of file Instructions.cpp.
References llvm::Type::getForwardedType(), and Ty.
Referenced by llvm::ConstantFoldGetElementPtr(), llvm::ConvertExpressionToType(), llvm::ExpressionConvertibleToType(), llvm::ConstantExpr::getGetElementPtr(), llvm::ConstantExpr::getGetElementPtrTy(), and llvm::BytecodeReader::ParseInstruction().
const Type * GetElementPtrInst::getIndexedType | ( | const Type * | Ptr, | |
Value * | Idx0, | |||
Value * | Idx1, | |||
bool | AllowStructLeaf = false | |||
) | [static] |
Definition at line 804 of file Instructions.cpp.
References llvm::SequentialType::getElementType(), llvm::CompositeType::getTypeAtIndex(), llvm::CompositeType::indexValid(), llvm::SequentialType::indexValid(), and llvm::Type::isFirstClassType().
Definition at line 822 of file Instructions.cpp.
References llvm::SequentialType::getElementType(), Idx, and llvm::SequentialType::indexValid().
op_iterator llvm::GetElementPtrInst::idx_begin | ( | ) | [inline] |
Definition at line 385 of file Instructions.h.
References llvm::User::op_begin().
Referenced by llvm::ConvertExpressionToType(), and llvm::ExpressionConvertibleToType().
const_op_iterator llvm::GetElementPtrInst::idx_begin | ( | ) | const [inline] |
op_iterator llvm::GetElementPtrInst::idx_end | ( | ) | [inline] |
Definition at line 387 of file Instructions.h.
References llvm::User::op_end().
Referenced by llvm::ConvertExpressionToType(), and llvm::ExpressionConvertibleToType().
const_op_iterator llvm::GetElementPtrInst::idx_end | ( | ) | const [inline] |
Value* llvm::GetElementPtrInst::getPointerOperand | ( | ) | [inline] |
Definition at line 390 of file Instructions.h.
References llvm::User::getOperand().
Referenced by llvm::ConvertExpressionToType(), llvm::ExpressionConvertibleToType(), and llvm::Interpreter::visitGetElementPtrInst().
const Value* llvm::GetElementPtrInst::getPointerOperand | ( | ) | const [inline] |
static unsigned llvm::GetElementPtrInst::getPointerOperandIndex | ( | ) | [inline, static] |
unsigned llvm::GetElementPtrInst::getNumIndices | ( | ) | const [inline] |
bool llvm::GetElementPtrInst::hasIndices | ( | ) | const [inline] |
static bool llvm::GetElementPtrInst::classof | ( | const GetElementPtrInst * | ) | [inline, static] |
static bool llvm::GetElementPtrInst::classof | ( | const Instruction * | I | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Reimplemented from llvm::Instruction.
Definition at line 410 of file Instructions.h.
References llvm::Instruction::getOpcode().
static bool llvm::GetElementPtrInst::classof | ( | const Value * | V | ) | [inline, static] |