Jlm
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
jlm::rvsdg::DotWriter Class Reference

#include <DotWriter.hpp>

Inheritance diagram for jlm::rvsdg::DotWriter:
Inheritance graph
[legend]

Public Member Functions

virtual ~DotWriter () noexcept
 
util::graph::GraphWriteGraph (util::graph::Writer &writer, const Region &region)
 
util::graph::GraphWriteGraphs (util::graph::Writer &writer, const Region &region, bool emitTypeGraph)
 

Protected Member Functions

util::graph::NodeGetOrCreateTypeGraphNode (const Type &type, util::graph::Graph &typeGraph)
 
virtual void AnnotateTypeGraphNode (const Type &type, util::graph::Node &node)
 
virtual void AnnotateGraphNode (const Node &rvsdgNode, util::graph::Node &node, util::graph::Graph *typeGraph)
 
virtual void AnnotateEdge (const Input &rvsdgInput, util::graph::Edge &edge)
 
virtual void AnnotateRegionArgument (const RegionArgument &regionArgument, util::graph::Node &node, util::graph::Graph *typeGraph)
 

Private Member Functions

void CreateGraphNodes (util::graph::Graph &graph, const Region &region, util::graph::Graph *typeGraph, bool traverseRecursively)
 
void AttachNodeInput (util::graph::Port &inputPort, const Input &rvsdgInput)
 
void AttachNodeOutput (util::graph::Port &outputPort, const Output &rvsdgOutput, util::graph::Graph *typeGraph)
 

Detailed Description

Definition at line 15 of file DotWriter.hpp.

Constructor & Destructor Documentation

◆ ~DotWriter()

jlm::rvsdg::DotWriter::~DotWriter ( )
virtualdefaultnoexcept

Member Function Documentation

◆ AnnotateEdge()

void jlm::rvsdg::DotWriter::AnnotateEdge ( const Input rvsdgInput,
util::graph::Edge edge 
)
protectedvirtual

Reimplemented in jlm::llvm::LlvmDotWriter.

Definition at line 28 of file DotWriter.cpp.

◆ AnnotateGraphNode()

void jlm::rvsdg::DotWriter::AnnotateGraphNode ( const Node rvsdgNode,
util::graph::Node node,
util::graph::Graph typeGraph 
)
protectedvirtual

Reimplemented in jlm::llvm::LlvmDotWriter.

Definition at line 21 of file DotWriter.cpp.

◆ AnnotateRegionArgument()

void jlm::rvsdg::DotWriter::AnnotateRegionArgument ( const RegionArgument regionArgument,
util::graph::Node node,
util::graph::Graph typeGraph 
)
protectedvirtual

Reimplemented in jlm::llvm::LlvmDotWriter.

Definition at line 32 of file DotWriter.cpp.

◆ AnnotateTypeGraphNode()

void jlm::rvsdg::DotWriter::AnnotateTypeGraphNode ( const Type type,
util::graph::Node node 
)
protectedvirtual

Reimplemented in jlm::llvm::LlvmDotWriter, and jlm::hls::HlsDotWriter.

Definition at line 17 of file DotWriter.cpp.

◆ AttachNodeInput()

void jlm::rvsdg::DotWriter::AttachNodeInput ( util::graph::Port inputPort,
const Input rvsdgInput 
)
private

Attaches the given GraphWriter port to the input in the RVSDG it represents. Also adds an edge to the input port, from the node representing the input's origin.

Parameters
inputPortthe GraphWriter port representing the input
rvsdgInputthe RVSDG input

Definition at line 69 of file DotWriter.cpp.

◆ AttachNodeOutput()

void jlm::rvsdg::DotWriter::AttachNodeOutput ( util::graph::Port outputPort,
const Output rvsdgOutput,
util::graph::Graph typeGraph 
)
private

Attaches the given GraphWriter port to the output in RVSDG it represents. Also adds information to the output about its type, using a reference to the type graph.

Parameters
outputPortthe GraphWriter port representing the output
rvsdgOutputthe RVSDG output
typeGraphthe type graph, or nullptr if the output's type should not be included

Definition at line 92 of file DotWriter.cpp.

◆ CreateGraphNodes()

void jlm::rvsdg::DotWriter::CreateGraphNodes ( util::graph::Graph graph,
const Region region,
util::graph::Graph typeGraph,
bool  traverseRecursively 
)
private

Fill the given graph with nodes corresponding to the nodes of the given region. If typeGraph is not nullptr, all rvsdg outputs get a type reference to the type graph. If the type does not already exist in the type graph, it is created.

Definition at line 112 of file DotWriter.cpp.

◆ GetOrCreateTypeGraphNode()

util::graph::Node & jlm::rvsdg::DotWriter::GetOrCreateTypeGraphNode ( const Type type,
util::graph::Graph typeGraph 
)
protected

Creates a node in the typeGraph representing the given type, or returns such a node if it has already been created.

Definition at line 43 of file DotWriter.cpp.

◆ WriteGraph()

util::graph::Graph & jlm::rvsdg::DotWriter::WriteGraph ( util::graph::Writer writer,
const Region region 
)

Convert a region into a DOT graph. All nodes in each region become InOutNodes, with edges showing data and state dependencies. Arguments and results are represented using ArgumentNode and ResultNode, respectively. All created nodes, inputs, and outputs, get associated to the rvsdg nodes, inputs and outputs.

Parameters
writerThe writer to use
regionThe RVSDG region to convert.
Returns
A reference to the DOT graph corresponding to the region.

Definition at line 217 of file DotWriter.cpp.

◆ WriteGraphs()

util::graph::Graph & jlm::rvsdg::DotWriter::WriteGraphs ( util::graph::Writer writer,
const Region region,
bool  emitTypeGraph 
)

Recursively converts a region and all sub-regions into graphs and sub-graphs. All nodes in each region become InOutNodes, with edges showing data and state dependencies. Arguments and results are represented using ArgumentNode and ResultNode, respectively. All created nodes, inputs, and outputs, get associated to the rvsdg nodes, inputs and outputs.

Parameters
writerthe GraphWriter to use
regionthe RVSDG region to recursively traverse
emitTypeGraphif true, an additional graph containing nodes for all types is emitted
Returns
a reference to the top-level graph corresponding to the region

Definition at line 198 of file DotWriter.cpp.


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