class PtrUseVisitor

Declaration

template <typename DerivedT>
class PtrUseVisitor : public PtrUseVisitorBase { /* full declaration omitted */ };

Description

A base class for visitors over the uses of a pointer value. Once constructed, a user can call \c visit on a pointer value, and this will walk its uses and visit each instruction using an InstVisitor. It also provides visit methods which will recurse through any pointer-to-pointer transformations such as GEPs and bitcasts. During the visit, the current Use* being visited is available to the subclass, as well as the current offset from the original base pointer if known. The recursive visit of uses is accomplished with a worklist, so the only ordering guarantee is that an instruction is visited before any uses of it are visited. Note that this does *not* mean before any of its users are visited! This is because users can be visited multiple times due to multiple, different uses of pointers derived from the same base. A particular Use will only be visited once, but a User may be visited multiple times, once per Use. This visits may notably have different offsets. All visit methods on the underlying InstVisitor return a boolean. This return short-circuits the visit, stopping it immediately. FIXME: Generalize this for all values rather than just instructions.

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:198

Inherits from: PtrUseVisitorBase

Templates

DerivedT

Member Variables

Inherited from PtrUseVisitorBase:

protected DL
protected PI
protected Worklist
protected VisitedUses
protected U
protected IsOffsetKnown
protected Offset

Method Overview

Inherited from PtrUseVisitorBase:

Methods

PtrUseVisitor<DerivedT>(
    const llvm::DataLayout& DL)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:205

Parameters

const llvm::DataLayout& DL

void visitAddrSpaceCastInst(
    llvm::AddrSpaceCastInst& ASC)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:251

Parameters

llvm::AddrSpaceCastInst& ASC

void visitBitCastInst(llvm::BitCastInst& BC)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:247

Parameters

llvm::BitCastInst& BC

void visitCallBase(llvm::CallBase& CB)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:290

Parameters

llvm::CallBase& CB

void visitDbgInfoIntrinsic(
    llvm::DbgInfoIntrinsic& I)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:275

Parameters

llvm::DbgInfoIntrinsic& I

void visitGetElementPtrInst(
    llvm::GetElementPtrInst& GEPI)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:259

Parameters

llvm::GetElementPtrInst& GEPI

void visitIntrinsicInst(llvm::IntrinsicInst& II)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:277

Parameters

llvm::IntrinsicInst& II

void visitMemIntrinsic(llvm::MemIntrinsic& I)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:276

Parameters

llvm::MemIntrinsic& I

llvm::detail::PtrUseVisitorBase::PtrInfo visitPtr(
    llvm::Instruction& I)

Description

Recursively visit the uses of the given pointer.

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:212

Parameters

llvm::Instruction& I

Returns

An info struct about the pointer. See \c PtrInfo for details.

void visitPtrToIntInst(llvm::PtrToIntInst& I)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:255

Parameters

llvm::PtrToIntInst& I

void visitStoreInst(llvm::StoreInst& SI)

Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:242

Parameters

llvm::StoreInst& SI