15 #ifndef LLVM_IR_DOMINATORS_H
16 #define LLVM_IR_DOMINATORS_H
36 template <
typename IRUnitT>
class AnalysisManager;
37 class PreservedAnalyses;
39 extern template class DomTreeNodeBase<BasicBlock>;
40 extern template class DominatorTreeBase<BasicBlock>;
44 extern template void Calculate<Function, Inverse<BasicBlock *>>(
45 DominatorTreeBase<GraphTraits<Inverse<BasicBlock *>>
::NodeType> &DT,
55 Start(Start_), End(End_) { }
74 :
Base(std::move(static_cast<
Base &>(Arg))) {}
76 Base::operator=(std::move(static_cast<Base &>(RHS)));
146 return df_end(getEntryNode(N));
161 return df_end(getEntryNode(N));
172 static void *
ID() {
return (
void *)&PassID; }
bool compare(const DominatorTree &Other) const
Returns false if the other dominator tree matches this dominator tree.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A Module instance is used to store all the information related to an LLVM module. ...
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
const BasicBlock * getStart() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Analysis pass which computes a DominatorTree.
const DominatorTree & getDomTree() const
NodeType::iterator ChildIteratorType
template void Calculate< Function, BasicBlock * >(DominatorTreeBase< GraphTraits< BasicBlock * >::NodeType > &DT, Function &F)
static StringRef name()
Provide access to a name for this pass for debugging purposes.
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
static nodes_iterator nodes_begin(DominatorTree *N)
void initializeDominatorTreeWrapperPassPass(PassRegistry &)
DominatorTree Result
Provide the result typedef for this analysis pass.
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
DominatorTreeWrapperPass()
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
std::vector< DomTreeNodeBase< NodeT > * >::iterator iterator
DominatorTree(DominatorTree &&Arg)
A Use represents the edge between a Value definition and its users.
static ChildIteratorType child_begin(NodeType *N)
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
DominatorTree & getDomTree()
DominatorTree run(Function &F)
Run the analysis pass over a function and produce a dominator tree.
static nodes_iterator nodes_end(DominatorTree *N)
bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
Base class for the actual dominator tree node.
DominatorTreePrinterPass(raw_ostream &OS)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
DominatorTree & operator=(DominatorTree &&RHS)
Core dominator tree base class.
PreservedAnalyses run(Function &F, AnalysisManager< Function > *AM)
An abstract set of preserved analyses following a transformation pass run.
bool isReachableFromEntry(const NodeT *A) const
isReachableFromEntry - Return true if A is dominated by the entry block of the function containing it...
LLVM Basic Block Representation.
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
static NodeType * getEntryNode(DominatorTree *DT)
df_iterator< T > df_end(const T &G)
Represent the analysis usage information of a pass.
static ChildIteratorType child_end(NodeType *N)
FunctionPass class - This class is used to implement most global optimizations.
static NodeType * getEntryNode(NodeType *N)
Printer pass for the DominatorTree.
void verifyDomTree() const
Verify the correctness of the domtree by re-computing it.
static nodes_iterator nodes_end(DomTreeNode *N)
Verifier pass for the DominatorTree.
const BasicBlock * getEnd() const
bool dominates(const Instruction *Def, const Use &U) const
Return true if Def dominates a use in User.
static void * ID()
Opaque, unique identifier for this analysis pass.
df_iterator< DomTreeNode * > nodes_iterator
DominatorTreeBase< BasicBlock > Base
df_iterator< T > df_begin(const T &G)
void setPreservesAll()
Set by analyses that do not transform their input at all.
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
PreservedAnalyses run(Function &F, AnalysisManager< Function > *AM)
DomTreeNodeBase< BasicBlock > DomTreeNode
bool isSingleEdge() const
BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_)
bool compare(const DominatorTreeBase &Other) const
compare - Return false if the other dominator tree base matches this dominator tree base...
static nodes_iterator nodes_begin(DomTreeNode *N)
This class implements an extremely fast bulk output stream that can only output to a stream...
This file defines a set of templates that efficiently compute a dominator tree over a generic graph...
StringRef - Represent a constant reference to a string, i.e.
A generic analysis pass manager with lazy running and caching of results.
Legacy analysis pass which computes a DominatorTree.