retdec
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
retdec::llvmir2hll::FuncInfo Class Referenceabstract

Base class for all classes storing information about a function. More...

#include <call_info_obtainer.h>

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

Public Member Functions

virtual ~FuncInfo ()=default
 
ShPtr< FunctiongetFunc () const
 Returns the function for which the piece of information has been computed. More...
 
virtual bool isNeverRead (ShPtr< Variable > var) const =0
 Returns true if var is never read in the function, false otherwise. More...
 
virtual bool mayBeRead (ShPtr< Variable > var) const =0
 Returns true if var may be read in the function, false otherwise. More...
 
virtual bool isAlwaysRead (ShPtr< Variable > var) const =0
 Returns true if var is always read in the function, false otherwise. More...
 
virtual bool isNeverModified (ShPtr< Variable > var) const =0
 Returns true if there is no assign into var in the function, false otherwise. More...
 
virtual bool mayBeModified (ShPtr< Variable > var) const =0
 Returns true if the value of var may be changed in the function, false otherwise. More...
 
virtual bool isAlwaysModified (ShPtr< Variable > var) const =0
 Returns true if the value of var is always changed in the function, false otherwise. More...
 
virtual bool valueIsNeverChanged (ShPtr< Variable > var) const =0
 Returns true if the value of var is never changed in the call, false otherwise. More...
 
virtual bool isAlwaysModifiedBeforeRead (ShPtr< Variable > var) const =0
 Returns true if the given variable is modified prior to being read in the function, false otherwise. More...
 

Protected Member Functions

 FuncInfo (ShPtr< Function > func)
 Constructs a new piece of information about the given function. More...
 

Protected Attributes

ShPtr< Functionfunc
 Function for which this piece of information is computed. More...
 

Friends

class CallInfoObtainer
 

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

Base class for all classes storing information about a function.

Instances of this class have reference object semantics.

Constructor & Destructor Documentation

◆ ~FuncInfo()

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

◆ FuncInfo()

retdec::llvmir2hll::FuncInfo::FuncInfo ( ShPtr< Function func)
explicitprotected

Constructs a new piece of information about the given function.

Member Function Documentation

◆ getFunc()

ShPtr< Function > retdec::llvmir2hll::FuncInfo::getFunc ( ) const

Returns the function for which the piece of information has been computed.

◆ isAlwaysModified()

virtual bool retdec::llvmir2hll::FuncInfo::isAlwaysModified ( ShPtr< Variable var) const
pure virtual

Returns true if the value of var is always changed in the function, false otherwise.

"Always changed" means that every time the function is called, var has a new assigned value. The new value may, however, be the same as the old value.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

◆ isAlwaysModifiedBeforeRead()

virtual bool retdec::llvmir2hll::FuncInfo::isAlwaysModifiedBeforeRead ( ShPtr< Variable var) const
pure virtual

Returns true if the given variable is modified prior to being read in the function, false otherwise.

When this function returns true, it doesn't mean that the variable is actually read or modified in the function. It only means that if the variable is read in the function, then it has been assigned a value before this read.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

◆ isAlwaysRead()

virtual bool retdec::llvmir2hll::FuncInfo::isAlwaysRead ( ShPtr< Variable var) const
pure virtual

Returns true if var is always read in the function, false otherwise.

"Always read" means that every time the function is called, var is read.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

◆ isNeverModified()

virtual bool retdec::llvmir2hll::FuncInfo::isNeverModified ( ShPtr< Variable var) const
pure virtual

Returns true if there is no assign into var in the function, false otherwise.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

◆ isNeverRead()

virtual bool retdec::llvmir2hll::FuncInfo::isNeverRead ( ShPtr< Variable var) const
pure virtual

Returns true if var is never read in the function, false otherwise.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

◆ mayBeModified()

virtual bool retdec::llvmir2hll::FuncInfo::mayBeModified ( ShPtr< Variable var) const
pure virtual

Returns true if the value of var may be changed in the function, false otherwise.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

◆ mayBeRead()

virtual bool retdec::llvmir2hll::FuncInfo::mayBeRead ( ShPtr< Variable var) const
pure virtual

Returns true if var may be read in the function, false otherwise.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

◆ valueIsNeverChanged()

virtual bool retdec::llvmir2hll::FuncInfo::valueIsNeverChanged ( ShPtr< Variable var) const
pure virtual

Returns true if the value of var is never changed in the call, false otherwise.

"Never changed" means that a new value may be assigned to var in the call, but when the called function returns, the value of var is always its original value.

Implemented in retdec::llvmir2hll::PessimFuncInfo, and retdec::llvmir2hll::OptimFuncInfo.

Friends And Related Function Documentation

◆ CallInfoObtainer

friend class CallInfoObtainer
friend

Member Data Documentation

◆ func

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

Function for which this piece of information is computed.


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