LLVM API Documentation

Public Member Functions | Static Public Member Functions | Friends
llvm::GEPOperator Class Reference

#include <Operator.h>

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

List of all members.

Public Member Functions

bool isInBounds () 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
TypegetPointerOperandType () const
unsigned getPointerAddressSpace () const
unsigned getNumIndices () const
bool hasIndices () const
bool hasAllZeroIndices () const
bool hasAllConstantIndices () const
bool accumulateConstantOffset (const DataLayout &DL, APInt &Offset) const
 Accumulate the constant address offset of this GEP if possible.

Static Public Member Functions

static unsigned getPointerOperandIndex ()

Friends

class GetElementPtrInst
class ConstantExpr

Detailed Description

Definition at line 357 of file Operator.h.


Member Function Documentation

bool llvm::GEPOperator::accumulateConstantOffset ( const DataLayout DL,
APInt Offset 
) const [inline]

Accumulate the constant address offset of this GEP if possible.

This routine accepts an APInt into which it will accumulate the constant offset of this GEP if the GEP is in fact constant. If the GEP is not all-constant, it returns false and the value of the offset APInt is undefined (it is *not* preserved!). The APInt passed into this routine must be at least as wide as the IntPtr type for the address space of the base GEP pointer.

Definition at line 444 of file Operator.h.

References llvm::dyn_cast(), llvm::gep_type_begin(), llvm::gep_type_end(), llvm::APInt::getBitWidth(), llvm::StructLayout::getElementOffset(), llvm::DataLayout::getPointerSizeInBits(), llvm::DataLayout::getStructLayout(), llvm::DataLayout::getTypeAllocSize(), llvm::ConstantInt::getValue(), llvm::ConstantInt::getZExtValue(), llvm::ConstantInt::isZero(), and llvm::APInt::sextOrTrunc().

Referenced by llvm::ObjectSizeOffsetVisitor::visitGEPOperator().

unsigned llvm::GEPOperator::getNumIndices ( ) const [inline]

Definition at line 404 of file Operator.h.

References llvm::User::getNumOperands().

unsigned llvm::GEPOperator::getPointerAddressSpace ( ) const [inline]

getPointerAddressSpace - Method to return the address space of the pointer operand.

Definition at line 400 of file Operator.h.

Referenced by isGEPKnownNonNull().

Value* llvm::GEPOperator::getPointerOperand ( ) [inline]
const Value* llvm::GEPOperator::getPointerOperand ( ) const [inline]

Definition at line 385 of file Operator.h.

References llvm::User::getOperand().

static unsigned llvm::GEPOperator::getPointerOperandIndex ( ) [inline, static]

Definition at line 388 of file Operator.h.

Type* llvm::GEPOperator::getPointerOperandType ( ) const [inline]

getPointerOperandType - Method to return the pointer operand as a PointerType.

Definition at line 394 of file Operator.h.

References getPointerOperand(), and llvm::Value::getType().

Referenced by llvm::DependenceAnalysis::depends(), and llvm::DependenceAnalysis::getSplitIteration().

bool llvm::GEPOperator::hasAllConstantIndices ( ) const [inline]

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 428 of file Operator.h.

References I.

Referenced by llvm::InstCombiner::FoldGEPICmp().

bool llvm::GEPOperator::hasAllZeroIndices ( ) const [inline]

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 415 of file Operator.h.

References llvm::CallingConv::C, and I.

Referenced by DecomposeGEPExpression(), and shouldMergeGEPs().

bool llvm::GEPOperator::hasIndices ( ) const [inline]

Definition at line 408 of file Operator.h.

References llvm::User::getNumOperands().

op_iterator llvm::GEPOperator::idx_begin ( ) [inline]
const_op_iterator llvm::GEPOperator::idx_begin ( ) const [inline]

Definition at line 378 of file Operator.h.

References llvm::User::op_begin().

op_iterator llvm::GEPOperator::idx_end ( ) [inline]
const_op_iterator llvm::GEPOperator::idx_end ( ) const [inline]

Definition at line 380 of file Operator.h.

References llvm::User::op_end().

bool llvm::GEPOperator::isInBounds ( ) const [inline]

isInBounds - Test whether this is an inbounds GEP, as defined by LangRef.html.

Definition at line 373 of file Operator.h.

References llvm::Value::SubclassOptionalData.

Referenced by llvm::InstCombiner::FoldGEPICmp(), and isGEPKnownNonNull().


Friends And Related Function Documentation

friend class ConstantExpr [friend]

Definition at line 364 of file Operator.h.

friend class GetElementPtrInst [friend]

Definition at line 363 of file Operator.h.


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