retdec
Public Member Functions | Private Attributes | Friends | List of all members
retdec::llvmir2hll::OptimFuncInfo Class Reference

Optimistic information about a function. More...

#include <optim_call_info_obtainer.h>

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

Public Member Functions

 OptimFuncInfo (ShPtr< Function > func)
 Constructs a new optimistic piece of information about the given function. More...
 
void debugPrint ()
 Emits the info to standard error. More...
 
virtual bool isNeverRead (ShPtr< Variable > var) const override
 Returns true if var is never read in the function, false otherwise. More...
 
virtual bool mayBeRead (ShPtr< Variable > var) const override
 Returns true if var may be read in the function, false otherwise. More...
 
virtual bool isAlwaysRead (ShPtr< Variable > var) const override
 Returns true if var is always read in the function, false otherwise. More...
 
virtual bool isNeverModified (ShPtr< Variable > var) const override
 Returns true if there is no assign into var in the function, false otherwise. More...
 
virtual bool mayBeModified (ShPtr< Variable > var) const override
 Returns true if the value of var may be changed in the function, false otherwise. More...
 
virtual bool isAlwaysModified (ShPtr< Variable > var) const override
 Returns true if the value of var is always changed in the function, false otherwise. More...
 
virtual bool valueIsNeverChanged (ShPtr< Variable > var) const override
 Returns true if the value of var is never changed in the call, false otherwise. More...
 
virtual bool isAlwaysModifiedBeforeRead (ShPtr< Variable > var) const override
 Returns true if the given variable is modified prior to being read in the function, false otherwise. More...
 
- Public Member Functions inherited from retdec::llvmir2hll::FuncInfo
virtual ~FuncInfo ()=default
 
ShPtr< FunctiongetFunc () const
 Returns the function for which the piece of information has been computed. More...
 

Private Attributes

VarSet neverReadVars
 Variables that are never read in this function. More...
 
VarSet mayBeReadVars
 Variables that may be read in this function. More...
 
VarSet alwaysReadVars
 Variables that are always read in this function. More...
 
VarSet neverModifiedVars
 Variables that are never modified in this function. More...
 
VarSet mayBeModifiedVars
 Variables that may be modified in this function. More...
 
VarSet alwaysModifiedVars
 Variables that are always modified in this function. More...
 
VarSet varsWithNeverChangedValue
 Variables whose value is never changed in this function. More...
 
VarSet varsAlwaysModifiedBeforeRead
 Variables which are always modified before read in this function. More...
 

Friends

class OptimCallInfoObtainer
 
class OptimFuncInfoCFGTraversal
 

Additional Inherited Members

- Protected Member Functions inherited from retdec::llvmir2hll::FuncInfo
 FuncInfo (ShPtr< Function > func)
 Constructs a new piece of information about the given function. More...
 
- Protected Attributes inherited from retdec::llvmir2hll::FuncInfo
ShPtr< Functionfunc
 Function for which this piece of information is computed. More...
 

Detailed Description

Optimistic information about a function.

Use OptimCallInfoObtainer to create instances.

Instances of this class have reference object semantics.

Constructor & Destructor Documentation

◆ OptimFuncInfo()

retdec::llvmir2hll::OptimFuncInfo::OptimFuncInfo ( ShPtr< Function func)
explicit

Constructs a new optimistic piece of information about the given function.

Member Function Documentation

◆ debugPrint()

void retdec::llvmir2hll::OptimFuncInfo::debugPrint ( )

Emits the info to standard error.

Only for debugging purposes.

◆ isAlwaysModified()

bool retdec::llvmir2hll::OptimFuncInfo::isAlwaysModified ( ShPtr< Variable var) const
overridevirtual

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.

Implements retdec::llvmir2hll::FuncInfo.

◆ isAlwaysModifiedBeforeRead()

bool retdec::llvmir2hll::OptimFuncInfo::isAlwaysModifiedBeforeRead ( ShPtr< Variable var) const
overridevirtual

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.

Implements retdec::llvmir2hll::FuncInfo.

◆ isAlwaysRead()

bool retdec::llvmir2hll::OptimFuncInfo::isAlwaysRead ( ShPtr< Variable var) const
overridevirtual

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.

Implements retdec::llvmir2hll::FuncInfo.

◆ isNeverModified()

bool retdec::llvmir2hll::OptimFuncInfo::isNeverModified ( ShPtr< Variable var) const
overridevirtual

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

Implements retdec::llvmir2hll::FuncInfo.

◆ isNeverRead()

bool retdec::llvmir2hll::OptimFuncInfo::isNeverRead ( ShPtr< Variable var) const
overridevirtual

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

Implements retdec::llvmir2hll::FuncInfo.

◆ mayBeModified()

bool retdec::llvmir2hll::OptimFuncInfo::mayBeModified ( ShPtr< Variable var) const
overridevirtual

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

Implements retdec::llvmir2hll::FuncInfo.

◆ mayBeRead()

bool retdec::llvmir2hll::OptimFuncInfo::mayBeRead ( ShPtr< Variable var) const
overridevirtual

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

Implements retdec::llvmir2hll::FuncInfo.

◆ valueIsNeverChanged()

bool retdec::llvmir2hll::OptimFuncInfo::valueIsNeverChanged ( ShPtr< Variable var) const
overridevirtual

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.

Implements retdec::llvmir2hll::FuncInfo.

Friends And Related Function Documentation

◆ OptimCallInfoObtainer

friend class OptimCallInfoObtainer
friend

◆ OptimFuncInfoCFGTraversal

friend class OptimFuncInfoCFGTraversal
friend

Member Data Documentation

◆ alwaysModifiedVars

VarSet retdec::llvmir2hll::OptimFuncInfo::alwaysModifiedVars
private

Variables that are always modified in this function.

◆ alwaysReadVars

VarSet retdec::llvmir2hll::OptimFuncInfo::alwaysReadVars
private

Variables that are always read in this function.

◆ mayBeModifiedVars

VarSet retdec::llvmir2hll::OptimFuncInfo::mayBeModifiedVars
private

Variables that may be modified in this function.

◆ mayBeReadVars

VarSet retdec::llvmir2hll::OptimFuncInfo::mayBeReadVars
private

Variables that may be read in this function.

◆ neverModifiedVars

VarSet retdec::llvmir2hll::OptimFuncInfo::neverModifiedVars
private

Variables that are never modified in this function.

◆ neverReadVars

VarSet retdec::llvmir2hll::OptimFuncInfo::neverReadVars
private

Variables that are never read in this function.

◆ varsAlwaysModifiedBeforeRead

VarSet retdec::llvmir2hll::OptimFuncInfo::varsAlwaysModifiedBeforeRead
private

Variables which are always modified before read in this function.

◆ varsWithNeverChangedValue

VarSet retdec::llvmir2hll::OptimFuncInfo::varsWithNeverChangedValue
private

Variables whose value is never changed in this function.


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