class PtrUseVisitorBase
Declaration
class PtrUseVisitorBase { /* full declaration omitted */ };
Description
Implementation of non-dependent functionality for \c PtrUseVisitor. See \c PtrUseVisitor for the public interface and detailed comments about usage. This class is just a helper base class which is not templated and contains all common code to be shared between different instantiations of PtrUseVisitor.
Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:55
Member Variables
- protected const llvm::DataLayout& DL
- protected llvm::detail::PtrUseVisitorBase::PtrInfo PI
- The info collected about the pointer being visited thus far.
- protected SmallVector< llvm::detail::PtrUseVisitorBase::UseToVisit, 8> Worklist
- The worklist of to-visit uses.
- protected SmallPtrSet<llvm::Use*, 8> VisitedUses
- A set of visited uses to break cycles in unreachable code.
- protected llvm::Use* U
- The use currently being visited.
- protected bool IsOffsetKnown
- True if we have a known constant offset for the use currently being visited.
- protected llvm::APInt Offset
- The constant offset of the use if that is known.
Method Overview
- protected PtrUseVisitorBase(const llvm::DataLayout & DL)
- protected bool adjustOffsetForGEP(llvm::GetElementPtrInst & GEPI)
- protected void enqueueUsers(llvm::Instruction & I)
Methods
¶PtrUseVisitorBase(const llvm::DataLayout& DL)
PtrUseVisitorBase(const llvm::DataLayout& DL)
Description
Note that the constructor is protected because this class must be a base class, we can't create instances directly of this class.
Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:163
Parameters
- const llvm::DataLayout& DL
¶bool adjustOffsetForGEP(
llvm::GetElementPtrInst& GEPI)
bool adjustOffsetForGEP(
llvm::GetElementPtrInst& GEPI)
Description
Walk the operands of a GEP and adjust the offset as appropriate. This routine does the heavy lifting of the pointer walk by computing offsets and looking through GEPs.
Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:175
Parameters
- llvm::GetElementPtrInst& GEPI
¶void enqueueUsers(llvm::Instruction& I)
void enqueueUsers(llvm::Instruction& I)
Description
Enqueue the users of this instruction in the visit worklist. This will visit the users with the same offset of the current visit (including an unknown offset if that is the current state).
Declared at: llvm/include/llvm/Analysis/PtrUseVisitor.h:169