|
LLZK 0.1.0
Veridise's ZK Language IR
|
This is a port of mlir::CallGraph that has been adapted to use the custom symbol lookup helpers (see SymbolHelper.h). More...
#include <CallGraph.h>
Public Types | |
| using | iterator = NodeIterator |
| An iterator over the nodes of the graph. | |
Public Member Functions | |
| CallGraph (mlir::Operation *op) | |
| CallGraphNode * | getOrAddNode (mlir::Region *region, CallGraphNode *parentNode) |
| Get or add a call graph node for the given region. | |
| CallGraphNode * | lookupNode (mlir::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 (mlir::CallOpInterface call, mlir::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 |
| size_t | size () const |
| void | dump () const |
| Dump the graph in a human readable format. | |
| void | print (llvm::raw_ostream &os) const |
This is a port of mlir::CallGraph that has been adapted to use the custom symbol lookup helpers (see SymbolHelper.h).
Unfortunately the mlir::CallGraph is not readily extensible, so we will define our own with a similar interface.
Definition at line 167 of file CallGraph.h.
| using llzk::CallGraph::iterator = NodeIterator |
An iterator over the nodes of the graph.
Definition at line 219 of file CallGraph.h.
| llzk::CallGraph::CallGraph | ( | mlir::Operation * | op | ) |
Definition at line 110 of file CallGraph.cpp.
|
inline |
Definition at line 220 of file CallGraph.h.
| void llzk::CallGraph::dump | ( | ) | const |
Dump the graph in a human readable format.
Definition at line 199 of file CallGraph.cpp.
|
inline |
Definition at line 221 of file CallGraph.h.
| void llzk::CallGraph::eraseNode | ( | CallGraphNode * | node | ) |
Erase the given node from the callgraph.
Definition at line 177 of file CallGraph.cpp.
|
inline |
Return the callgraph node representing an external caller.
Definition at line 199 of file CallGraph.h.
| CallGraphNode * llzk::CallGraph::getOrAddNode | ( | mlir::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 128 of file CallGraph.cpp.
|
inline |
Return the callgraph node representing an indirect callee.
Definition at line 204 of file CallGraph.h.
| CallGraphNode * llzk::CallGraph::lookupNode | ( | mlir::Region * | region | ) | const |
Lookup a call graph node for the given region, or nullptr if none is registered.
Definition at line 155 of file CallGraph.cpp.
| void llzk::CallGraph::print | ( | llvm::raw_ostream & | os | ) | const |
Definition at line 200 of file CallGraph.cpp.
| CallGraphNode * llzk::CallGraph::resolveCallable | ( | mlir::CallOpInterface | call, |
| mlir::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.
This function has been modified to work with LLZK.
Definition at line 163 of file CallGraph.cpp.
|
inline |
Definition at line 223 of file CallGraph.h.