Spicy
Public Types | Public Member Functions | List of all members
hilti::detail::cfg::CFG Class Reference

#include <cfg.h>

Public Types

using NodeId = uint64_t
 
using Graph = util::graph::DirectedGraph< GraphNode, NodeId >
 

Public Member Functions

 CFG (const Node *root)
 
void removeNode (Node *node)
 
std::string dot () const
 
const auto & dataflow () const
 
const Graphgraph () const
 

Detailed Description

Infrastructure to compute control and dataflow facts about a AST (sub)tree.

Member Typedef Documentation

◆ Graph

The underlying graph.

Constructor & Destructor Documentation

◆ CFG()

hilti::detail::cfg::CFG::CFG ( const Node root)

Construct a new CFG.

This automatically computes a control flow and data flow facts for the AST under the node.

Parameters
rootthe node pointing to the AST subtree to work on

Member Function Documentation

◆ dataflow()

const auto& hilti::detail::cfg::CFG::dataflow ( ) const
inline

Get dataflow facts.

◆ dot()

std::string hilti::detail::cfg::CFG::dot ( ) const

Compute a dot representation of the CFG.

Returns
a string with the dot representation

◆ graph()

const Graph& hilti::detail::cfg::CFG::graph ( ) const
inline

Get control flow.

◆ removeNode()

void hilti::detail::cfg::CFG::removeNode ( Node node)

Remove a node from the graph.

This function will connect all upstream neighbors to all downstream neighbors.

Parameters
nodethe node to remove

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