MLIR
15.0.0git
|
#include "mlir/Analysis/CallGraph.h"
Public Types | |
using | iterator = NodeIterator |
An iterator over the nodes of the graph. More... | |
Public Member Functions | |
CallGraph (Operation *op) | |
CallGraphNode * | getOrAddNode (Region *region, CallGraphNode *parentNode) |
Get or add a call graph node for the given region. More... | |
CallGraphNode * | lookupNode (Region *region) const |
Lookup a call graph node for the given region, or nullptr if none is registered. More... | |
CallGraphNode * | getExternalNode () const |
Return the callgraph node representing the indirect-external callee. More... | |
CallGraphNode * | resolveCallable (CallOpInterface call, SymbolTableCollection &symbolTable) const |
Resolve the callable for given callee to a node in the callgraph, or the external node if a valid node was not resolved. More... | |
void | eraseNode (CallGraphNode *node) |
Erase the given node from the callgraph. More... | |
iterator | begin () const |
iterator | end () const |
void | dump () const |
Dump the graph in a human readable format. More... | |
void | print (raw_ostream &os) const |
Definition at line 154 of file CallGraph.h.
using mlir::CallGraph::iterator = NodeIterator |
An iterator over the nodes of the graph.
Definition at line 203 of file CallGraph.h.
CallGraph::CallGraph | ( | Operation * | op | ) |
Definition at line 95 of file CallGraph.cpp.
References computeCallGraph().
|
inline |
Definition at line 204 of file CallGraph.h.
Referenced by llvm::GraphTraits< const mlir::CallGraph * >::nodes_begin().
void CallGraph::dump | ( | ) | const |
Dump the graph in a human readable format.
Definition at line 173 of file CallGraph.cpp.
References print().
|
inline |
Definition at line 205 of file CallGraph.h.
References print().
Referenced by llvm::GraphTraits< const mlir::CallGraph * >::nodes_end().
void CallGraph::eraseNode | ( | CallGraphNode * | node | ) |
Erase the given node from the callgraph.
Definition at line 153 of file CallGraph.cpp.
References mlir::CallGraphNode::getCallableRegion(), mlir::CallGraphNode::Edge::getTarget(), and mlir::CallGraphNode::hasChildren().
|
inline |
Return the callgraph node representing the indirect-external callee.
Definition at line 188 of file CallGraph.h.
Referenced by llvm::GraphTraits< const mlir::CallGraph * >::getEntryNode(), and resolveCallable().
CallGraphNode * CallGraph::getOrAddNode | ( | Region * | region, |
CallGraphNode * | parentNode | ||
) |
Get or add a call graph node for the given region.
parentNode
corresponds to the direct node in the callgraph that contains the parent operation of region
, or nullptr if there is no parent node.
Definition at line 107 of file CallGraph.cpp.
References mlir::CallGraphNode::addAbstractEdge(), mlir::CallGraphNode::addChildEdge(), and mlir::Region::getParentOp().
Referenced by computeCallGraph().
CallGraphNode * CallGraph::lookupNode | ( | Region * | region | ) | const |
Lookup a call graph node for the given region, or nullptr if none is registered.
Definition at line 133 of file CallGraph.cpp.
Referenced by collectCallOps(), inlineHistoryIncludes(), resolveCallable(), and walkReferencedSymbolNodes().
void CallGraph::print | ( | raw_ostream & | os | ) | const |
Definition at line 174 of file CallGraph.cpp.
References mlir::CallGraphNode::getCallableRegion(), mlir::Operation::getName(), mlir::Operation::getParentOp(), mlir::Region::getParentOp(), and mlir::CallGraphNode::isExternal().
Referenced by dump().
CallGraphNode * CallGraph::resolveCallable | ( | CallOpInterface | call, |
SymbolTableCollection & | symbolTable | ||
) | const |
Resolve the callable for given callee to a node in the callgraph, or the external node if a valid node was not resolved.
The provided symbol table is used when resolving calls that reference callables via a symbol reference.
Definition at line 141 of file CallGraph.cpp.
References getExternalNode(), and lookupNode().
Referenced by collectCallOps(), and computeCallGraph().