LLZK 0.1.0
Veridise's ZK Language IR
|
This is a simple port of the mlir::CallGraphNode with llzk::CallGraph as a friend class, for mlir::CallGraphNode has a private constructor and can only be constructed by mlir::CallGraph. More...
#include <CallGraph.h>
Classes | |
class | Edge |
This class represents a directed edge between two nodes in the callgraph. More... | |
Public Types | |
using | iterator = mlir::SmallVectorImpl<Edge>::const_iterator |
Iterator over the outgoing edges of this node. | |
Public Member Functions | |
bool | isExternal () const |
Returns true if this node is an external node. | |
mlir::Region * | getCallableRegion () const |
Returns the callable region this node represents. | |
llzk::function::FuncDefOp | getCalledFunction () const |
Returns the called function that the callable region represents. | |
void | addAbstractEdge (CallGraphNode *node) |
Adds an abstract reference edge to the given node. | |
void | addCallEdge (CallGraphNode *node) |
Add an outgoing call edge from this node. | |
void | addChildEdge (CallGraphNode *child) |
Adds a reference edge to the given child node. | |
iterator | begin () const |
iterator | end () const |
llvm::iterator_range< iterator > | edgesOut () const |
bool | hasChildren () const |
Returns true if this node has any child edges. | |
Friends | |
class | CallGraph |
This is a simple port of the mlir::CallGraphNode with llzk::CallGraph as a friend class, for mlir::CallGraphNode has a private constructor and can only be constructed by mlir::CallGraph.
mlir::CallGraphNode is also not polymorphic, so a port is cleaner than requiring casts on mlir::CallGraphNode return types.
Definition at line 39 of file CallGraph.h.
using llzk::CallGraphNode::iterator = mlir::SmallVectorImpl<Edge>::const_iterator |
Iterator over the outgoing edges of this node.
Definition at line 123 of file CallGraph.h.
void llzk::CallGraphNode::addAbstractEdge | ( | CallGraphNode * | node | ) |
Adds an abstract reference edge to the given node.
Adds an reference edge to the given node.
An abstract edge does not come from any observable operations, so this is only valid on the external node.
This is only valid on the external node.
Definition at line 53 of file CallGraph.cpp.
void llzk::CallGraphNode::addCallEdge | ( | CallGraphNode * | node | ) |
Add an outgoing call edge from this node.
Definition at line 59 of file CallGraph.cpp.
void llzk::CallGraphNode::addChildEdge | ( | CallGraphNode * | child | ) |
Adds a reference edge to the given child node.
Definition at line 62 of file CallGraph.cpp.
|
inline |
Definition at line 124 of file CallGraph.h.
|
inline |
Definition at line 127 of file CallGraph.h.
|
inline |
Definition at line 125 of file CallGraph.h.
mlir::Region * llzk::CallGraphNode::getCallableRegion | ( | ) | const |
Returns the callable region this node represents.
Return the callable region this node represents.
This can only be called on non-external nodes.
Definition at line 42 of file CallGraph.cpp.
FuncDefOp llzk::CallGraphNode::getCalledFunction | ( | ) | const |
Returns the called function that the callable region represents.
As per getCallableRegion, this can only be called on non-external nodes. This is an LLZK-specific addition.
Definition at line 47 of file CallGraph.cpp.
bool llzk::CallGraphNode::hasChildren | ( | ) | const |
Returns true if this node has any child edges.
Definition at line 65 of file CallGraph.cpp.
bool llzk::CallGraphNode::isExternal | ( | ) | const |
Returns true if this node is an external node.
Returns true if this node refers to the indirect/external node.
Definition at line 38 of file CallGraph.cpp.
|
friend |
Definition at line 161 of file CallGraph.h.