retdec
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | List of all members
retdec::llvmir2hll::GraphvizCGWriter Class Reference

A CG writer in the dot format (graphviz). More...

#include <graphviz_cg_writer.h>

Inheritance diagram for retdec::llvmir2hll::GraphvizCGWriter:
Inheritance graph
[legend]
Collaboration diagram for retdec::llvmir2hll::GraphvizCGWriter:
Collaboration graph
[legend]

Public Member Functions

virtual std::string getId () const override
 Returns the ID of the writer. More...
 
virtual bool emitCG () override
 Emits the given CG into the given output stream. More...
 
- Public Member Functions inherited from retdec::llvmir2hll::CGWriter
virtual ~CGWriter ()=default
 

Static Public Member Functions

static ShPtr< CGWritercreate (ShPtr< CG > cg, std::ostream &out)
 Creates a new graphviz CG writer. More...
 

Private Types

using NodeLabelMapping = std::map< ShPtr< Function >, std::string >
 Mapping between a node and its label. More...
 

Private Member Functions

 GraphvizCGWriter (ShPtr< CG > cg, std::ostream &out)
 Constructs a new graphviz CG writer. More...
 
void emitNode (ShPtr< Function > caller, ShPtr< CG::CalledFuncs > callees)
 Emits the node given by caller and callees. More...
 
std::string getNodeLabelForFunc (ShPtr< Function > func)
 Returns a node label for the given function. More...
 

Additional Inherited Members

- Protected Member Functions inherited from retdec::llvmir2hll::CGWriter
 CGWriter (ShPtr< CG > cg, std::ostream &out)
 Constructs a new writer. More...
 
- Protected Attributes inherited from retdec::llvmir2hll::CGWriter
ShPtr< CGcg
 CG to be emitted. More...
 
std::ostream & out
 Stream, where the resulting CG will be emitted. More...
 

Detailed Description

A CG writer in the dot format (graphviz).

For more information on the dot format, see http://www.graphviz.org/.

Use create() to create instances. Instances of this class have reference object semantics.

Member Typedef Documentation

◆ NodeLabelMapping

Mapping between a node and its label.

Constructor & Destructor Documentation

◆ GraphvizCGWriter()

retdec::llvmir2hll::GraphvizCGWriter::GraphvizCGWriter ( ShPtr< CG cg,
std::ostream &  out 
)
private

Constructs a new graphviz CG writer.

See create() for the description of parameters.

Member Function Documentation

◆ create()

ShPtr< CGWriter > retdec::llvmir2hll::GraphvizCGWriter::create ( ShPtr< CG cg,
std::ostream &  out 
)
static

Creates a new graphviz CG writer.

Parameters
[in]cgCG to be emitted.
[in]outOutput stream into which the CG will be emitted.

◆ emitCG()

bool retdec::llvmir2hll::GraphvizCGWriter::emitCG ( )
overridevirtual

Emits the given CG into the given output stream.

The format of the written data depends on the subclass of this class.

Returns
true if some code has been emitted, false otherwise.

Implements retdec::llvmir2hll::CGWriter.

◆ emitNode()

void retdec::llvmir2hll::GraphvizCGWriter::emitNode ( ShPtr< Function caller,
ShPtr< CG::CalledFuncs callees 
)
private

Emits the node given by caller and callees.

◆ getId()

std::string retdec::llvmir2hll::GraphvizCGWriter::getId ( ) const
overridevirtual

Returns the ID of the writer.

Implements retdec::llvmir2hll::CGWriter.

◆ getNodeLabelForFunc()

std::string retdec::llvmir2hll::GraphvizCGWriter::getNodeLabelForFunc ( ShPtr< Function func)
private

Returns a node label for the given function.


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