LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::CallGraphNode Class Reference

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< iteratoredgesOut () const
 
bool hasChildren () const
 Returns true if this node has any child edges.
 

Friends

class CallGraph
 

Detailed Description

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.

Member Typedef Documentation

◆ iterator

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.

Member Function Documentation

◆ addAbstractEdge()

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.

◆ addCallEdge()

void llzk::CallGraphNode::addCallEdge ( CallGraphNode * node)

Add an outgoing call edge from this node.

Definition at line 59 of file CallGraph.cpp.

◆ addChildEdge()

void llzk::CallGraphNode::addChildEdge ( CallGraphNode * child)

Adds a reference edge to the given child node.

Definition at line 62 of file CallGraph.cpp.

◆ begin()

iterator llzk::CallGraphNode::begin ( ) const
inline

Definition at line 124 of file CallGraph.h.

◆ edgesOut()

llvm::iterator_range< iterator > llzk::CallGraphNode::edgesOut ( ) const
inline

Definition at line 127 of file CallGraph.h.

◆ end()

iterator llzk::CallGraphNode::end ( ) const
inline

Definition at line 125 of file CallGraph.h.

◆ getCallableRegion()

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.

◆ getCalledFunction()

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.

◆ hasChildren()

bool llzk::CallGraphNode::hasChildren ( ) const

Returns true if this node has any child edges.

Definition at line 65 of file CallGraph.cpp.

◆ isExternal()

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.

Friends And Related Symbol Documentation

◆ CallGraph

friend class CallGraph
friend

Definition at line 161 of file CallGraph.h.


The documentation for this class was generated from the following files: