retdec
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
retdec::llvmir2hll::CFGWriter Class Referenceabstract

A base class of all control-flow graph (CFG) writers. More...

#include <cfg_writer.h>

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

Public Member Functions

virtual ~CFGWriter ()=default
 
virtual std::string getId () const =0
 Returns the ID of the writer. More...
 
virtual bool emitCFG ()=0
 Emits the given CFG into the given output stream. More...
 

Protected Types

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

Protected Member Functions

 CFGWriter (ShPtr< CFG > cfg, std::ostream &out)
 Constructs a new writer. More...
 

Protected Attributes

ShPtr< CFGcfg
 CFG to be emitted. More...
 
std::ostream & out
 Stream, where the resulting CFG will be emitted. More...
 

Additional Inherited Members

- Private Member Functions inherited from retdec::utils::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 

Detailed Description

A base class of all control-flow graph (CFG) writers.

Every CFG writer should subclass this class and override emitCFG().

Instances of this class have reference object semantics.

Member Typedef Documentation

◆ NodeLabelMapping

using retdec::llvmir2hll::CFGWriter::NodeLabelMapping = std::map<ShPtr<CFG::Node>, std::string>
protected

Mapping between a node and its label.

Constructor & Destructor Documentation

◆ ~CFGWriter()

virtual retdec::llvmir2hll::CFGWriter::~CFGWriter ( )
virtualdefault

◆ CFGWriter()

retdec::llvmir2hll::CFGWriter::CFGWriter ( ShPtr< CFG cfg,
std::ostream &  out 
)
protected

Constructs a new writer.

Parameters
[in]cfgCFG to be emitted.
[in]outOutput stream where the CFG is emitted.

Member Function Documentation

◆ emitCFG()

virtual bool retdec::llvmir2hll::CFGWriter::emitCFG ( )
pure virtual

Emits the given CFG 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.

Implemented in retdec::llvmir2hll::GraphvizCFGWriter.

◆ getId()

virtual std::string retdec::llvmir2hll::CFGWriter::getId ( ) const
pure virtual

Returns the ID of the writer.

Implemented in retdec::llvmir2hll::GraphvizCFGWriter.

Member Data Documentation

◆ cfg

ShPtr<CFG> retdec::llvmir2hll::CFGWriter::cfg
protected

CFG to be emitted.

◆ out

std::ostream& retdec::llvmir2hll::CFGWriter::out
protected

Stream, where the resulting CFG will be emitted.


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