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

Information about a value. More...

#include <value_analysis.h>

Collaboration diagram for retdec::llvmir2hll::ValueData:
Collaboration graph
[legend]

Public Types

using var_iterator = VarSet::const_iterator
 Variables iterator. More...
 
using call_iterator = CallVector::const_iterator
 Calls iterator. More...
 

Public Member Functions

 ValueData (const ValueData &other)=default
 
ValueDataoperator= (const ValueData &other)=default
 
bool operator== (const ValueData &other) const
 Returns true if the current object is equal to other, false otherwise. More...
 
bool operator!= (const ValueData &other) const
 Returns true if the current object is not equal to other, false otherwise. More...
 
Directly Used Variables Accessors
const VarSetgetDirReadVars () const
 Returns the variables that are directly read. More...
 
const VarSetgetDirWrittenVars () const
 Returns the variables that are directly written into. More...
 
const VarSetgetDirAccessedVars () const
 Returns the set of all directly accessed variables. More...
 
std::size_t getNumOfDirReadVars () const
 Returns the number of directly read variables. More...
 
std::size_t getNumOfDirWrittenVars () const
 Returns the number of directly written variables. More...
 
std::size_t getNumOfDirAccessedVars () const
 Returns the number of directly accessed variables. More...
 
std::size_t getDirNumOfUses (ShPtr< Variable > var) const
 Returns the number of direct uses of var. More...
 
bool isDirRead (ShPtr< Variable > var) const
 Returns true if var is directly read, false otherwise. More...
 
bool isDirWritten (ShPtr< Variable > var) const
 Returns true if var is directly written, false otherwise. More...
 
bool isDirAccessed (ShPtr< Variable > var) const
 Returns true if var is directly accessed, false otherwise. More...
 
var_iterator dir_read_begin () const
 Returns an iterator to the first directly read variable. More...
 
var_iterator dir_read_end () const
 Returns an iterator past the last directly read variable. More...
 
var_iterator dir_written_begin () const
 Returns an iterator to the first directly written variable. More...
 
var_iterator dir_written_end () const
 Returns an iterator past the last directly written variable. More...
 
var_iterator dir_all_begin () const
 Returns an iterator to the first directly accessed variable. More...
 
var_iterator dir_all_end () const
 Returns an iterator past the last directly accessed variable. More...
 
Indirectly Used Variables Accessors
const VarSetgetMayBeReadVars () const
 Returns the set of variables that may be indirectly read. More...
 
const VarSetgetMayBeWrittenVars () const
 Returns the set of variables into which may be indirectly written. More...
 
const VarSetgetMayBeAccessedVars () const
 Returns the set of variables that may be indirectly accessed. More...
 
bool mayBeIndirRead (ShPtr< Variable > var) const
 Returns true if var may be indirectly read, false otherwise. More...
 
bool mayBeIndirWritten (ShPtr< Variable > var) const
 Returns true if var may be indirectly written-into, false otherwise. More...
 
bool mayBeIndirAccessed (ShPtr< Variable > var) const
 Returns true if var may be indirectly accessed, false otherwise. More...
 
var_iterator may_be_read_begin () const
 Returns an iterator to the first variable that may be indirectly read. More...
 
var_iterator may_be_read_end () const
 Returns an iterator past the last variable that may be indirectly read. More...
 
var_iterator may_be_written_begin () const
 Returns an iterator to the first variable into which may be written. More...
 
var_iterator may_be_written_end () const
 Returns an iterator past the last variable into which may be written. More...
 
var_iterator may_be_accessed_begin () const
 Returns an iterator to the first variable that may be accessed. More...
 
var_iterator may_be_accessed_end () const
 Returns an iterator past the last variable that may be. More...
 
const VarSetgetMustBeReadVars () const
 Returns the set of variables that must be indirectly read. More...
 
const VarSetgetMustBeWrittenVars () const
 Returns the set of variables into which must be indirectly written. More...
 
const VarSetgetMustBeAccessedVars () const
 Returns the set of variables that must be indirectly accessed. More...
 
bool mustBeIndirRead (ShPtr< Variable > var) const
 Returns true if var must be indirectly read, false otherwise. More...
 
bool mustBeIndirWritten (ShPtr< Variable > var) const
 Returns true if var must be indirectly written-into, false otherwise. More...
 
bool mustBeIndirAccessed (ShPtr< Variable > var) const
 Returns true if var must be indirectly accessed, false otherwise. More...
 
var_iterator must_be_read_begin () const
 Returns an iterator to the first variable that must be indirectly read. More...
 
var_iterator must_be_read_end () const
 Returns an iterator past the last variable that must be indirectly read. More...
 
var_iterator must_be_written_begin () const
 Returns an iterator to the first variable into which must be written. More...
 
var_iterator must_be_written_end () const
 Returns an iterator past the last variable into which must be written. More...
 
var_iterator must_be_accessed_begin () const
 Returns an iterator to the first variable that must be accessed. More...
 
var_iterator must_be_accessed_end () const
 Returns an iterator past the last variable that must be accessed. More...
 
Function Calls Accessors
const CallVectorgetCalls () const
 Returns all function calls. More...
 
bool hasCalls () const
 Returns true if there are function calls, false otherwise. More...
 
std::size_t getNumOfCalls () const
 Returns the number of calls. More...
 
call_iterator call_begin () const
 Returns an iterator to the first call. More...
 
call_iterator call_end () const
 Returns an iterator past the last call. More...
 
Address Operators Accessors
bool hasAddressOps () const
 Returns true if there are any address operators, false otherwise. More...
 
bool hasAddressTaken (ShPtr< Variable > var) const
 Returns true if var has its address taken, false otherwise. More...
 
Dereferences Accessors
bool hasDerefs () const
 Returns true if there are any dereferences, false otherwise. More...
 
Array Accesses Accessors
bool hasArrayAccesses () const
 Returns true if there are any array accesses, false otherwise. More...
 
Struct Accesses Accessors
bool hasStructAccesses () const
 Returns true if there are any struct accesses, false otherwise. More...
 

Private Types

using VarCountMap = std::map< ShPtr< Variable >, std::size_t >
 Mapping of a variable into a count. More...
 

Private Member Functions

 ValueData ()
 Constructs a new ValueData object. More...
 
void clear ()
 Clears all private containers and variables. More...
 

Private Attributes

VarSet dirReadVars
 Set of variables that are directly read. More...
 
VarSet dirWrittenVars
 Set of variables into which something is directly written. More...
 
VarSet dirAllVars
 Set of all directly accessed variables (read or written). More...
 
VarCountMap dirNumOfVarUses
 Number of uses of a variable in direct accesses. More...
 
VarSet mayBeReadVars
 Set of variables that may be read. More...
 
VarSet mayBeWrittenVars
 Set of variables into which something may be written. More...
 
VarSet mayBeAccessedVars
 Set of variables which may be accessed. More...
 
VarSet mustBeReadVars
 Set of variables that must be read. More...
 
VarSet mustBeWrittenVars
 Set of variables into which something must be written. More...
 
VarSet mustBeAccessedVars
 Set of variables which must be accessed. More...
 
CallVector calls
 List of function calls. More...
 
VarSet addressTakenVars
 Set of variables whose address is taken. More...
 
bool containsDerefs
 Are there any dereferences? More...
 
bool containsArrayAccesses
 Are there any array accesses? More...
 
bool containsStructAccesses
 Are there any struct accesses? More...
 

Friends

class ValueAnalysis
 

Detailed Description

Information about a value.

Instance of this class can be created only by using ValueAnalysis.

Instances of this class have value object semantics.

Member Typedef Documentation

◆ call_iterator

using retdec::llvmir2hll::ValueData::call_iterator = CallVector::const_iterator

Calls iterator.

◆ var_iterator

using retdec::llvmir2hll::ValueData::var_iterator = VarSet::const_iterator

Variables iterator.

◆ VarCountMap

using retdec::llvmir2hll::ValueData::VarCountMap = std::map<ShPtr<Variable>, std::size_t>
private

Mapping of a variable into a count.

Constructor & Destructor Documentation

◆ ValueData() [1/2]

retdec::llvmir2hll::ValueData::ValueData ( const ValueData other)
default

◆ ValueData() [2/2]

retdec::llvmir2hll::ValueData::ValueData ( )
private

Constructs a new ValueData object.

Member Function Documentation

◆ call_begin()

ValueData::call_iterator retdec::llvmir2hll::ValueData::call_begin ( ) const

Returns an iterator to the first call.

◆ call_end()

ValueData::call_iterator retdec::llvmir2hll::ValueData::call_end ( ) const

Returns an iterator past the last call.

◆ clear()

void retdec::llvmir2hll::ValueData::clear ( )
private

Clears all private containers and variables.

◆ dir_all_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_all_begin ( ) const

Returns an iterator to the first directly accessed variable.

◆ dir_all_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_all_end ( ) const

Returns an iterator past the last directly accessed variable.

◆ dir_read_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_read_begin ( ) const

Returns an iterator to the first directly read variable.

◆ dir_read_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_read_end ( ) const

Returns an iterator past the last directly read variable.

◆ dir_written_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_written_begin ( ) const

Returns an iterator to the first directly written variable.

◆ dir_written_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_written_end ( ) const

Returns an iterator past the last directly written variable.

◆ getCalls()

const CallVector & retdec::llvmir2hll::ValueData::getCalls ( ) const

Returns all function calls.

◆ getDirAccessedVars()

const VarSet & retdec::llvmir2hll::ValueData::getDirAccessedVars ( ) const

Returns the set of all directly accessed variables.

◆ getDirNumOfUses()

std::size_t retdec::llvmir2hll::ValueData::getDirNumOfUses ( ShPtr< Variable var) const

Returns the number of direct uses of var.

Preconditions
  • var is non-null

◆ getDirReadVars()

const VarSet & retdec::llvmir2hll::ValueData::getDirReadVars ( ) const

Returns the variables that are directly read.

◆ getDirWrittenVars()

const VarSet & retdec::llvmir2hll::ValueData::getDirWrittenVars ( ) const

Returns the variables that are directly written into.

◆ getMayBeAccessedVars()

const VarSet & retdec::llvmir2hll::ValueData::getMayBeAccessedVars ( ) const

Returns the set of variables that may be indirectly accessed.

Variables which must be accessed (i.e. are always accessed) are not included into the result.

◆ getMayBeReadVars()

const VarSet & retdec::llvmir2hll::ValueData::getMayBeReadVars ( ) const

Returns the set of variables that may be indirectly read.

Variables which must be read (i.e. are always read) are not included into the result.

◆ getMayBeWrittenVars()

const VarSet & retdec::llvmir2hll::ValueData::getMayBeWrittenVars ( ) const

Returns the set of variables into which may be indirectly written.

Variables which must be written (i.e. are always written) are not included into the result.

◆ getMustBeAccessedVars()

const VarSet & retdec::llvmir2hll::ValueData::getMustBeAccessedVars ( ) const

Returns the set of variables that must be indirectly accessed.

◆ getMustBeReadVars()

const VarSet & retdec::llvmir2hll::ValueData::getMustBeReadVars ( ) const

Returns the set of variables that must be indirectly read.

◆ getMustBeWrittenVars()

const VarSet & retdec::llvmir2hll::ValueData::getMustBeWrittenVars ( ) const

Returns the set of variables into which must be indirectly written.

◆ getNumOfCalls()

std::size_t retdec::llvmir2hll::ValueData::getNumOfCalls ( ) const

Returns the number of calls.

◆ getNumOfDirAccessedVars()

std::size_t retdec::llvmir2hll::ValueData::getNumOfDirAccessedVars ( ) const

Returns the number of directly accessed variables.

◆ getNumOfDirReadVars()

std::size_t retdec::llvmir2hll::ValueData::getNumOfDirReadVars ( ) const

Returns the number of directly read variables.

◆ getNumOfDirWrittenVars()

std::size_t retdec::llvmir2hll::ValueData::getNumOfDirWrittenVars ( ) const

Returns the number of directly written variables.

◆ hasAddressOps()

bool retdec::llvmir2hll::ValueData::hasAddressOps ( ) const

Returns true if there are any address operators, false otherwise.

◆ hasAddressTaken()

bool retdec::llvmir2hll::ValueData::hasAddressTaken ( ShPtr< Variable var) const

Returns true if var has its address taken, false otherwise.

Preconditions
  • var is non-null

◆ hasArrayAccesses()

bool retdec::llvmir2hll::ValueData::hasArrayAccesses ( ) const

Returns true if there are any array accesses, false otherwise.

◆ hasCalls()

bool retdec::llvmir2hll::ValueData::hasCalls ( ) const

Returns true if there are function calls, false otherwise.

◆ hasDerefs()

bool retdec::llvmir2hll::ValueData::hasDerefs ( ) const

Returns true if there are any dereferences, false otherwise.

◆ hasStructAccesses()

bool retdec::llvmir2hll::ValueData::hasStructAccesses ( ) const

Returns true if there are any struct accesses, false otherwise.

◆ isDirAccessed()

bool retdec::llvmir2hll::ValueData::isDirAccessed ( ShPtr< Variable var) const

Returns true if var is directly accessed, false otherwise.

◆ isDirRead()

bool retdec::llvmir2hll::ValueData::isDirRead ( ShPtr< Variable var) const

Returns true if var is directly read, false otherwise.

◆ isDirWritten()

bool retdec::llvmir2hll::ValueData::isDirWritten ( ShPtr< Variable var) const

Returns true if var is directly written, false otherwise.

◆ may_be_accessed_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::may_be_accessed_begin ( ) const

Returns an iterator to the first variable that may be accessed.

Variables which must be accessed (i.e. are always accessed) are not included into the result.

◆ may_be_accessed_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::may_be_accessed_end ( ) const

Returns an iterator past the last variable that may be.

Variables which must be accessed (i.e. are always accessed) are not included into the result.

◆ may_be_read_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::may_be_read_begin ( ) const

Returns an iterator to the first variable that may be indirectly read.

Variables which must be read (i.e. are always read) are not included into the result.

◆ may_be_read_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::may_be_read_end ( ) const

Returns an iterator past the last variable that may be indirectly read.

Variables which must be read (i.e. are always read) are not included into the result.

◆ may_be_written_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::may_be_written_begin ( ) const

Returns an iterator to the first variable into which may be written.

Variables which must be written (i.e. are always written) are not included into the result.

◆ may_be_written_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::may_be_written_end ( ) const

Returns an iterator past the last variable into which may be written.

Variables which must be written (i.e. are always written) are not included into the result.

◆ mayBeIndirAccessed()

bool retdec::llvmir2hll::ValueData::mayBeIndirAccessed ( ShPtr< Variable var) const

Returns true if var may be indirectly accessed, false otherwise.

◆ mayBeIndirRead()

bool retdec::llvmir2hll::ValueData::mayBeIndirRead ( ShPtr< Variable var) const

Returns true if var may be indirectly read, false otherwise.

◆ mayBeIndirWritten()

bool retdec::llvmir2hll::ValueData::mayBeIndirWritten ( ShPtr< Variable var) const

Returns true if var may be indirectly written-into, false otherwise.

◆ must_be_accessed_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_accessed_begin ( ) const

Returns an iterator to the first variable that must be accessed.

◆ must_be_accessed_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_accessed_end ( ) const

Returns an iterator past the last variable that must be accessed.

◆ must_be_read_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_read_begin ( ) const

Returns an iterator to the first variable that must be indirectly read.

◆ must_be_read_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_read_end ( ) const

Returns an iterator past the last variable that must be indirectly read.

◆ must_be_written_begin()

ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_written_begin ( ) const

Returns an iterator to the first variable into which must be written.

◆ must_be_written_end()

ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_written_end ( ) const

Returns an iterator past the last variable into which must be written.

◆ mustBeIndirAccessed()

bool retdec::llvmir2hll::ValueData::mustBeIndirAccessed ( ShPtr< Variable var) const

Returns true if var must be indirectly accessed, false otherwise.

◆ mustBeIndirRead()

bool retdec::llvmir2hll::ValueData::mustBeIndirRead ( ShPtr< Variable var) const

Returns true if var must be indirectly read, false otherwise.

◆ mustBeIndirWritten()

bool retdec::llvmir2hll::ValueData::mustBeIndirWritten ( ShPtr< Variable var) const

Returns true if var must be indirectly written-into, false otherwise.

◆ operator!=()

bool retdec::llvmir2hll::ValueData::operator!= ( const ValueData other) const

Returns true if the current object is not equal to other, false otherwise.

◆ operator=()

ValueData& retdec::llvmir2hll::ValueData::operator= ( const ValueData other)
default

◆ operator==()

bool retdec::llvmir2hll::ValueData::operator== ( const ValueData other) const

Returns true if the current object is equal to other, false otherwise.

Friends And Related Function Documentation

◆ ValueAnalysis

friend class ValueAnalysis
friend

Member Data Documentation

◆ addressTakenVars

VarSet retdec::llvmir2hll::ValueData::addressTakenVars
private

Set of variables whose address is taken.

◆ calls

CallVector retdec::llvmir2hll::ValueData::calls
private

List of function calls.

◆ containsArrayAccesses

bool retdec::llvmir2hll::ValueData::containsArrayAccesses
private

Are there any array accesses?

◆ containsDerefs

bool retdec::llvmir2hll::ValueData::containsDerefs
private

Are there any dereferences?

◆ containsStructAccesses

bool retdec::llvmir2hll::ValueData::containsStructAccesses
private

Are there any struct accesses?

◆ dirAllVars

VarSet retdec::llvmir2hll::ValueData::dirAllVars
private

Set of all directly accessed variables (read or written).

◆ dirNumOfVarUses

VarCountMap retdec::llvmir2hll::ValueData::dirNumOfVarUses
private

Number of uses of a variable in direct accesses.

◆ dirReadVars

VarSet retdec::llvmir2hll::ValueData::dirReadVars
private

Set of variables that are directly read.

◆ dirWrittenVars

VarSet retdec::llvmir2hll::ValueData::dirWrittenVars
private

Set of variables into which something is directly written.

◆ mayBeAccessedVars

VarSet retdec::llvmir2hll::ValueData::mayBeAccessedVars
private

Set of variables which may be accessed.

◆ mayBeReadVars

VarSet retdec::llvmir2hll::ValueData::mayBeReadVars
private

Set of variables that may be read.

◆ mayBeWrittenVars

VarSet retdec::llvmir2hll::ValueData::mayBeWrittenVars
private

Set of variables into which something may be written.

◆ mustBeAccessedVars

VarSet retdec::llvmir2hll::ValueData::mustBeAccessedVars
private

Set of variables which must be accessed.

◆ mustBeReadVars

VarSet retdec::llvmir2hll::ValueData::mustBeReadVars
private

Set of variables that must be read.

◆ mustBeWrittenVars

VarSet retdec::llvmir2hll::ValueData::mustBeWrittenVars
private

Set of variables into which something must be written.


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