LLVM
8.0.1
|
A base class for visitors over the uses of a pointer value. More...
#include "llvm/Analysis/PtrUseVisitor.h"
Public Member Functions | |
PtrUseVisitor (const DataLayout &DL) | |
PtrInfo | visitPtr (Instruction &I) |
Recursively visit the uses of the given pointer. More... | |
Friends | |
class | InstVisitor< DerivedT > |
Additional Inherited Members | |
Protected Attributes inherited from llvm::detail::PtrUseVisitorBase | |
const DataLayout & | DL |
PtrInfo | PI |
The info collected about the pointer being visited thus far. More... | |
SmallVector< UseToVisit, 8 > | Worklist |
The worklist of to-visit uses. More... | |
SmallPtrSet< Use *, 8 > | VisitedUses |
A set of visited uses to break cycles in unreachable code. More... | |
Use * | U |
The use currently being visited. More... | |
bool | IsOffsetKnown |
True if we have a known constant offset for the use currently being visited. More... | |
APInt | Offset |
The constant offset of the use if that is known. More... | |
A base class for visitors over the uses of a pointer value.
Once constructed, a user can call 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.
Definition at line 207 of file PtrUseVisitor.h.
|
inline |
Definition at line 214 of file PtrUseVisitor.h.
|
inlineprotected |
Definition at line 256 of file PtrUseVisitor.h.
|
inlineprotected |
Definition at line 295 of file PtrUseVisitor.h.
|
inlineprotected |
Definition at line 280 of file PtrUseVisitor.h.
|
inlineprotected |
Definition at line 264 of file PtrUseVisitor.h.
|
inlineprotected |
Definition at line 282 of file PtrUseVisitor.h.
|
inlineprotected |
Definition at line 281 of file PtrUseVisitor.h.
|
inline |
Recursively visit the uses of the given pointer.
PtrInfo
for details. Definition at line 221 of file PtrUseVisitor.h.
Referenced by AllocaSlices::SliceBuilder::SliceBuilder().
|
inlineprotected |
Definition at line 260 of file PtrUseVisitor.h.
|
inlineprotected |
Definition at line 251 of file PtrUseVisitor.h.
|
friend |
Definition at line 209 of file PtrUseVisitor.h.