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

Builds a graph structure representing the relationships between symbols and their uses. More...

#include <SymbolUseGraph.h>

Public Types

using roots_iterator = SymbolUseGraphNode::iterator
 Iterator over the root nodes (i.e., nodes that have no predecessors).
 
using iterator = NodeIterator
 An iterator over the nodes of the graph.
 

Public Member Functions

 SymbolUseGraph (mlir::SymbolOpInterface rootSymbolOp)
 
const SymbolUseGraphNodelookupNode (mlir::ModuleOp pathRoot, mlir::SymbolRefAttr path) const
 Return the existing node for the symbol reference relative to the given module, else nullptr.
 
const SymbolUseGraphNodelookupNode (mlir::SymbolOpInterface symbolDef) const
 Return the existing node for the symbol definition op, else nullptr.
 
size_t size () const
 Return the total number of nodes in the graph.
 
roots_iterator roots_begin () const
 
roots_iterator roots_end () const
 
llvm::iterator_range< roots_iteratorrootsIter () const
 Range over root nodes (i.e., nodes that have no predecessors).
 
iterator begin () const
 
iterator end () const
 
llvm::iterator_range< iteratornodesIter () const
 Range over all nodes in the graph.
 
void dump () const
 Dump the graph in a human readable format.
 
void print (llvm::raw_ostream &os) const
 
void dumpToDotFile (std::string filename="") const
 Dump the graph to file in dot graph format.
 

Friends

struct llvm::GraphTraits< const llzk::SymbolUseGraph * >
 
struct llvm::GraphTraits< llvm::Inverse< const llzk::SymbolUseGraph * > >
 

Detailed Description

Builds a graph structure representing the relationships between symbols and their uses.

There is a node for each SymbolRef and the successors are the Symbols uses within this Symbol's defining Operation.

Definition at line 114 of file SymbolUseGraph.h.

Member Typedef Documentation

◆ iterator

using llzk::SymbolUseGraph::iterator = NodeIterator

An iterator over the nodes of the graph.

Definition at line 184 of file SymbolUseGraph.h.

◆ roots_iterator

Iterator over the root nodes (i.e., nodes that have no predecessors).

Definition at line 174 of file SymbolUseGraph.h.

Constructor & Destructor Documentation

◆ SymbolUseGraph()

llzk::SymbolUseGraph::SymbolUseGraph ( mlir::SymbolOpInterface rootSymbolOp)

Definition at line 84 of file SymbolUseGraph.cpp.

Member Function Documentation

◆ begin()

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

Definition at line 185 of file SymbolUseGraph.h.

◆ dump()

void llzk::SymbolUseGraph::dump ( ) const
inline

Dump the graph in a human readable format.

Definition at line 194 of file SymbolUseGraph.h.

◆ dumpToDotFile()

void llzk::SymbolUseGraph::dumpToDotFile ( std::string filename = "") const

Dump the graph to file in dot graph format.

Definition at line 257 of file SymbolUseGraph.cpp.

◆ end()

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

Definition at line 186 of file SymbolUseGraph.h.

◆ lookupNode() [1/2]

const SymbolUseGraphNode * llzk::SymbolUseGraph::lookupNode ( mlir::ModuleOp pathRoot,
mlir::SymbolRefAttr path ) const

Return the existing node for the symbol reference relative to the given module, else nullptr.

◆ lookupNode() [2/2]

const SymbolUseGraphNode * llzk::SymbolUseGraph::lookupNode ( mlir::SymbolOpInterface symbolDef) const

Return the existing node for the symbol definition op, else nullptr.

◆ nodesIter()

llvm::iterator_range< iterator > llzk::SymbolUseGraph::nodesIter ( ) const
inline

Range over all nodes in the graph.

Definition at line 189 of file SymbolUseGraph.h.

◆ print()

void llzk::SymbolUseGraph::print ( llvm::raw_ostream & os) const

Definition at line 216 of file SymbolUseGraph.cpp.

◆ roots_begin()

roots_iterator llzk::SymbolUseGraph::roots_begin ( ) const
inline

Definition at line 175 of file SymbolUseGraph.h.

◆ roots_end()

roots_iterator llzk::SymbolUseGraph::roots_end ( ) const
inline

Definition at line 176 of file SymbolUseGraph.h.

◆ rootsIter()

llvm::iterator_range< roots_iterator > llzk::SymbolUseGraph::rootsIter ( ) const
inline

Range over root nodes (i.e., nodes that have no predecessors).

Definition at line 179 of file SymbolUseGraph.h.

◆ size()

size_t llzk::SymbolUseGraph::size ( ) const
inline

Return the total number of nodes in the graph.

Definition at line 171 of file SymbolUseGraph.h.

Friends And Related Symbol Documentation

◆ llvm::GraphTraits< const llzk::SymbolUseGraph * >

friend struct llvm::GraphTraits< const llzk::SymbolUseGraph * >
friend

Definition at line 155 of file SymbolUseGraph.h.

◆ llvm::GraphTraits< llvm::Inverse< const llzk::SymbolUseGraph * > >

friend struct llvm::GraphTraits< llvm::Inverse< const llzk::SymbolUseGraph * > >
friend

Definition at line 155 of file SymbolUseGraph.h.


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