LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::GetElementPtrInst Class Reference

#include <Instructions.h>

Inheritance diagram for llvm::GetElementPtrInst:

Inheritance graph
[legend]
Collaboration diagram for llvm::GetElementPtrInst:

Collaboration graph
[legend]
List of all members.

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 *Idx0, Value *Idx1, const std::string &Name="", Instruction *InsertBefore=0)
 GetElementPtrInst (Value *Ptr, Value *Idx0, Value *Idx1, const std::string &Name, BasicBlock *InsertAtEnd)
virtual GetElementPtrInstclone () const
const PointerTypegetType () const
op_iterator idx_begin ()
const_op_iterator idx_begin () const
op_iterator idx_end ()
const_op_iterator idx_end () const
ValuegetPointerOperand ()
const ValuegetPointerOperand () const
unsigned getNumIndices () const
bool hasIndices () const

Static Public Member Functions

static const TypegetIndexedType (const Type *Ptr, const std::vector< Value * > &Indices, bool AllowStructLeaf=false)
static const TypegetIndexedType (const Type *Ptr, Value *Idx0, Value *Idx1, bool AllowStructLeaf=false)
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)

Detailed Description

GetElementPtrInst - an instruction for type-safe pointer arithmetic to access elements of arrays and structs

Definition at line 273 of file Instructions.h.


Constructor & Destructor Documentation

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 443 of file Instructions.cpp.

References llvm::cl::init().

GetElementPtrInst::GetElementPtrInst Value Ptr,
const std::vector< Value * > &  Idx,
const std::string &  Name,
BasicBlock InsertAtEnd
 

Definition at line 451 of file Instructions.cpp.

References llvm::cl::init().

GetElementPtrInst::GetElementPtrInst Value Ptr,
Value Idx0,
Value Idx1,
const std::string &  Name = "",
Instruction InsertBefore = 0
 

Constructors - These two constructors are convenience methods because two index getelementptr instructions are so common.

Definition at line 459 of file Instructions.cpp.

References llvm::cl::init().

GetElementPtrInst::GetElementPtrInst Value Ptr,
Value Idx0,
Value Idx1,
const std::string &  Name,
BasicBlock InsertAtEnd
 

Definition at line 467 of file Instructions.cpp.

References llvm::cl::init().


Member Function Documentation

static bool llvm::GetElementPtrInst::classof const Value V  )  [inline, static]
 

Reimplemented from llvm::Instruction.

Definition at line 347 of file Instructions.h.

References classof().

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 344 of file Instructions.h.

References llvm::Instruction::getOpcode().

static bool llvm::GetElementPtrInst::classof const GetElementPtrInst  )  [inline, static]
 

Definition at line 343 of file Instructions.h.

Referenced by classof().

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 797 of file Instructions.cpp.

const Type * GetElementPtrInst::getIndexedType const Type Ptr,
Value Idx0,
Value Idx1,
bool  AllowStructLeaf = false
[static]
 

Definition at line 518 of file Instructions.cpp.

References llvm::SequentialType::getElementType(), llvm::CompositeType::getTypeAtIndex(), llvm::CompositeType::indexValid(), llvm::SequentialType::indexValid(), and llvm::Type::isFirstClassType().

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 481 of file Instructions.cpp.

Referenced by llvm::ConstantFoldGetElementPtr(), llvm::ConvertExpressionToType(), llvm::ExpressionConvertibleToType(), llvm::ConstantExpr::getGetElementPtr(), llvm::ConstantExpr::getGetElementPtrTy(), and llvm::BytecodeReader::ParseInstruction().

unsigned llvm::GetElementPtrInst::getNumIndices  )  const [inline]
 

Definition at line 334 of file Instructions.h.

References llvm::User::getNumOperands().

Referenced by llvm::DecomposeArrayRef().

const Value* llvm::GetElementPtrInst::getPointerOperand  )  const [inline]
 

Definition at line 327 of file Instructions.h.

References llvm::User::getOperand().

Value* llvm::GetElementPtrInst::getPointerOperand  )  [inline]
 

Definition at line 324 of file Instructions.h.

References llvm::User::getOperand().

Referenced by llvm::ConvertExpressionToType(), llvm::DecomposeArrayRef(), llvm::ExpressionConvertibleToType(), and llvm::Interpreter::visitGetElementPtrInst().

static unsigned llvm::GetElementPtrInst::getPointerOperandIndex  )  [inline, static]
 

Definition at line 330 of file Instructions.h.

References U.

const PointerType* llvm::GetElementPtrInst::getType  )  const [inline]
 

All values are typed, get the type of this value.

Reimplemented from llvm::Value.

Definition at line 303 of file Instructions.h.

References llvm::Value::getType().

Referenced by llvm::ConvertExpressionToType(), llvm::ExpressionConvertibleToType(), and PeepholeOptimizeAddCast().

bool llvm::GetElementPtrInst::hasIndices  )  const [inline]
 

Definition at line 338 of file Instructions.h.

References llvm::User::getNumOperands().

const_op_iterator llvm::GetElementPtrInst::idx_begin  )  const [inline]
 

Definition at line 320 of file Instructions.h.

References llvm::User::op_begin().

op_iterator llvm::GetElementPtrInst::idx_begin  )  [inline]
 

Definition at line 319 of file Instructions.h.

References llvm::User::op_begin().

Referenced by llvm::ConvertExpressionToType(), ConvertOperandToType(), llvm::DecomposeArrayRef(), and llvm::ExpressionConvertibleToType().

const_op_iterator llvm::GetElementPtrInst::idx_end  )  const [inline]
 

Definition at line 322 of file Instructions.h.

References llvm::User::op_end().

op_iterator llvm::GetElementPtrInst::idx_end  )  [inline]
 

Definition at line 321 of file Instructions.h.

References llvm::User::op_end().

Referenced by llvm::ConvertExpressionToType(), ConvertOperandToType(), llvm::DecomposeArrayRef(), and llvm::ExpressionConvertibleToType().


The documentation for this class was generated from the following files: