retdec
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
retdec::llvmir2hll::CFGBuilder Class Referenceabstract

A base class for creators of control-flow graphs (CFGs) from functions. More...

#include <cfg_builder.h>

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

Public Member Functions

ShPtr< CFGgetCFG (ShPtr< Function > func)
 Returns a CFG of the given function func. More...
 

Protected Member Functions

 CFGBuilder ()=default
 

Protected Attributes

ShPtr< CFGcfg
 A CFG that is currently being built. More...
 
ShPtr< Functionfunc
 A function from which the CFG is being built. More...
 

Private Member Functions

void initializeNewCFG (ShPtr< Function > func)
 Creates a new CFG and initializes it. More...
 
virtual void buildCFG ()=0
 Builds cfg. More...
 
- 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 for creators of control-flow graphs (CFGs) from functions.

A subclass should:

Instances of this class have reference object semantics. The class implements the NVI ("non-virtual interface") pattern.

Constructor & Destructor Documentation

◆ CFGBuilder()

retdec::llvmir2hll::CFGBuilder::CFGBuilder ( )
protecteddefault

Member Function Documentation

◆ buildCFG()

virtual void retdec::llvmir2hll::CFGBuilder::buildCFG ( )
privatepure virtual

Builds cfg.

When this function is called, cfg and func are correctly initialized.

Implemented in retdec::llvmir2hll::RecursiveCFGBuilder, and retdec::llvmir2hll::NonRecursiveCFGBuilder.

◆ getCFG()

ShPtr< CFG > retdec::llvmir2hll::CFGBuilder::getCFG ( ShPtr< Function func)

Returns a CFG of the given function func.

Preconditions
  • func is non-null

◆ initializeNewCFG()

void retdec::llvmir2hll::CFGBuilder::initializeNewCFG ( ShPtr< Function func)
private

Creates a new CFG and initializes it.

Member Data Documentation

◆ cfg

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

A CFG that is currently being built.

◆ func

ShPtr<Function> retdec::llvmir2hll::CFGBuilder::func
protected

A function from which the CFG is being built.


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