22 #ifndef LLVM_ANALYSIS_PTRUSEVISITOR_H
23 #define LLVM_ANALYSIS_PTRUSEVISITOR_H
192 template <
typename DerivedT>
225 static_cast<DerivedT*
>(
this)->
visit(I);
Value * getValueOperand()
bool isEscaped() const
Is the pointer escaped at some point?
void visitCallSite(CallSite CS)
Base class for instruction visitors.
void visitCallSite(CallSite CS)
void visitMemIntrinsic(MemIntrinsic &I)
Use * U
The use currently being visited.
SmallPtrSet< Use *, 8 > VisitedUses
A set of visited uses to break cycles in unreachable code.
Intrinsic::ID getIntrinsicID() const
Implementation of non-dependent functionality for PtrUseVisitor.
Instruction * getAbortingInst() const
Get the instruction causing the visit to abort.
This class provides information about the result of a visit.
void setAborted(Instruction *I=0)
Mark the visit as aborted. Intended for use in a void return.
PtrUseVisitor(const DataLayout &DL)
void setEscapedAndAborted(Instruction *I=0)
Mark the pointer as escaped, and the visit as aborted. Intended for use in a void return...
void visitBitCastInst(BitCastInst &BC)
void visitIntrinsicInst(IntrinsicInst &I)
bool IsOffsetKnown
True if we have a known constant offset for the use currently being visited.
void visitStoreInst(StoreInst &SI)
void setPointer(PointerTy PtrVal)
PtrUseVisitorBase(const DataLayout &DL)
This file implements a class to represent arbitrary precision integral constant values and operations...
This class represents a cast from a pointer to an integer.
A struct of the data needed to visit a particular use.
void visit(Iterator Start, Iterator End)
A base class for visitors over the uses of a pointer value.
SmallVector< UseToVisit, 8 > Worklist
The worklist of to-visit uses.
This class represents a no-op cast from one type to another.
void visitDbgInfoIntrinsic(DbgInfoIntrinsic &I)
void setInt(IntType IntVal)
InstrTy * getInstruction() const
void enqueueUsers(Instruction &I)
Enqueue the users of this instruction in the visit worklist.
Integer representation type.
PtrInfo PI
The info collected about the pointer being visited thus far.
bool adjustOffsetForGEP(GetElementPtrInst &GEPI)
Walk the operands of a GEP and adjust the offset as appropriate.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
PointerTy getPointer() const
void visitGetElementPtrInst(GetElementPtrInst &GEPI)
PointerIntPair< Use *, 1, bool > UseAndIsOffsetKnownPair
Instruction * getEscapingInst() const
Get the instruction causing the pointer to escape.
Class for arbitrary precision integers.
void visitIntrinsicInst(IntrinsicInst &II)
void visitPtrToIntInst(PtrToIntInst &I)
UseAndIsOffsetKnownPair UseAndIsOffsetKnown
void reset()
Reset the pointer info, clearing all state.
void setEscaped(Instruction *I=0)
Mark the pointer as escaped. Intended for use in a void return.
APInt Offset
The constant offset of the use if that is known.
PtrInfo visitPtr(Instruction &I)
Recursively visit the uses of the given pointer.
bool isAborted() const
Did we abort the visit early?