|
MLIR 22.0.0git
|
#include "mlir/Analysis/CallGraph.h"
Public Types | |
| using | iterator = NodeIterator |
| An iterator over the nodes of the graph. | |
Public Member Functions | |
| CallGraph (Operation *op) | |
| CallGraphNode * | getOrAddNode (Region *region, CallGraphNode *parentNode) |
| Get or add a call graph node for the given region. | |
| CallGraphNode * | lookupNode (Region *region) const |
| Lookup a call graph node for the given region, or nullptr if none is registered. | |
| CallGraphNode * | getExternalCallerNode () const |
| Return the callgraph node representing an external caller. | |
| CallGraphNode * | getUnknownCalleeNode () const |
| Return the callgraph node representing an indirect callee. | |
| 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. | |
| void | eraseNode (CallGraphNode *node) |
| Erase the given node from the callgraph. | |
| iterator | begin () const |
| iterator | end () const |
| void | dump () const |
| Dump the graph in a human readable format. | |
| 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 208 of file CallGraph.h.
| CallGraph::CallGraph | ( | Operation * | op | ) |
Definition at line 99 of file CallGraph.cpp.
References computeCallGraph(), and nullptr.
|
inline |
Definition at line 209 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 179 of file CallGraph.cpp.
References print().
|
inline |
Definition at line 210 of file CallGraph.h.
Referenced by llvm::GraphTraits< const mlir::CallGraph * >::nodes_end().
| void CallGraph::eraseNode | ( | CallGraphNode * | node | ) |
Erase the given node from the callgraph.
Definition at line 158 of file CallGraph.cpp.
References eraseNode(), mlir::CallGraphNode::getCallableRegion(), mlir::CallGraphNode::Edge::getTarget(), and mlir::CallGraphNode::hasChildren().
Referenced by eraseNode().
|
inline |
Return the callgraph node representing an external caller.
Definition at line 188 of file CallGraph.h.
Referenced by llvm::GraphTraits< const mlir::CallGraph * >::getEntryNode(), and print().
| 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 113 of file CallGraph.cpp.
References mlir::CallGraphNode::addChildEdge(), and mlir::Region::getParentOp().
Referenced by computeCallGraph().
|
inline |
Return the callgraph node representing an indirect callee.
Definition at line 193 of file CallGraph.h.
Referenced by print(), and resolveCallable().
| CallGraphNode * CallGraph::lookupNode | ( | Region * | region | ) | const |
Lookup a call graph node for the given region, or nullptr if none is registered.
Definition at line 139 of file CallGraph.cpp.
References mlir::CallGraphNode::end(), and nullptr.
Referenced by collectCallOps(), resolveCallable(), and walkReferencedSymbolNodes().
| void CallGraph::print | ( | raw_ostream & | os | ) | const |
Definition at line 180 of file CallGraph.cpp.
References mlir::CallGraphNode::getCallableRegion(), getExternalCallerNode(), mlir::Region::getParentOp(), and getUnknownCalleeNode().
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.
Resolve the callable for given callee to a node in the callgraph, or the unknown callee 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 147 of file CallGraph.cpp.
References getUnknownCalleeNode(), and lookupNode().
Referenced by collectCallOps(), and computeCallGraph().