retdec
|
Information about a value. More...
#include <value_analysis.h>
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 | |
ValueData & | operator= (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 VarSet & | getDirReadVars () const |
Returns the variables that are directly read. More... | |
const VarSet & | getDirWrittenVars () const |
Returns the variables that are directly written into. More... | |
const VarSet & | getDirAccessedVars () 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 VarSet & | getMayBeReadVars () const |
Returns the set of variables that may be indirectly read. More... | |
const VarSet & | getMayBeWrittenVars () const |
Returns the set of variables into which may be indirectly written. More... | |
const VarSet & | getMayBeAccessedVars () 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 VarSet & | getMustBeReadVars () const |
Returns the set of variables that must be indirectly read. More... | |
const VarSet & | getMustBeWrittenVars () const |
Returns the set of variables into which must be indirectly written. More... | |
const VarSet & | getMustBeAccessedVars () 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 CallVector & | getCalls () 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 |
Information about a value.
Instance of this class can be created only by using ValueAnalysis.
Instances of this class have value object semantics.
using retdec::llvmir2hll::ValueData::call_iterator = CallVector::const_iterator |
Calls iterator.
using retdec::llvmir2hll::ValueData::var_iterator = VarSet::const_iterator |
Variables iterator.
|
private |
Mapping of a variable into a count.
|
default |
|
private |
Constructs a new ValueData object.
ValueData::call_iterator retdec::llvmir2hll::ValueData::call_begin | ( | ) | const |
Returns an iterator to the first call.
ValueData::call_iterator retdec::llvmir2hll::ValueData::call_end | ( | ) | const |
Returns an iterator past the last call.
|
private |
Clears all private containers and variables.
ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_all_begin | ( | ) | const |
Returns an iterator to the first directly accessed variable.
ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_all_end | ( | ) | const |
Returns an iterator past the last directly accessed variable.
ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_read_begin | ( | ) | const |
Returns an iterator to the first directly read variable.
ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_read_end | ( | ) | const |
Returns an iterator past the last directly read variable.
ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_written_begin | ( | ) | const |
Returns an iterator to the first directly written variable.
ValueData::var_iterator retdec::llvmir2hll::ValueData::dir_written_end | ( | ) | const |
Returns an iterator past the last directly written variable.
const CallVector & retdec::llvmir2hll::ValueData::getCalls | ( | ) | const |
Returns all function calls.
const VarSet & retdec::llvmir2hll::ValueData::getDirAccessedVars | ( | ) | const |
Returns the set of all directly accessed variables.
Returns the number of direct uses of var.
const VarSet & retdec::llvmir2hll::ValueData::getDirReadVars | ( | ) | const |
Returns the variables that are directly read.
const VarSet & retdec::llvmir2hll::ValueData::getDirWrittenVars | ( | ) | const |
Returns the variables that are directly written into.
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.
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.
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.
const VarSet & retdec::llvmir2hll::ValueData::getMustBeAccessedVars | ( | ) | const |
Returns the set of variables that must be indirectly accessed.
const VarSet & retdec::llvmir2hll::ValueData::getMustBeReadVars | ( | ) | const |
Returns the set of variables that must be indirectly read.
const VarSet & retdec::llvmir2hll::ValueData::getMustBeWrittenVars | ( | ) | const |
Returns the set of variables into which must be indirectly written.
std::size_t retdec::llvmir2hll::ValueData::getNumOfCalls | ( | ) | const |
Returns the number of calls.
std::size_t retdec::llvmir2hll::ValueData::getNumOfDirAccessedVars | ( | ) | const |
Returns the number of directly accessed variables.
std::size_t retdec::llvmir2hll::ValueData::getNumOfDirReadVars | ( | ) | const |
Returns the number of directly read variables.
std::size_t retdec::llvmir2hll::ValueData::getNumOfDirWrittenVars | ( | ) | const |
Returns the number of directly written variables.
bool retdec::llvmir2hll::ValueData::hasAddressOps | ( | ) | const |
Returns true
if there are any address operators, false
otherwise.
Returns true
if var has its address taken, false
otherwise.
bool retdec::llvmir2hll::ValueData::hasArrayAccesses | ( | ) | const |
Returns true
if there are any array accesses, false
otherwise.
bool retdec::llvmir2hll::ValueData::hasCalls | ( | ) | const |
Returns true
if there are function calls, false
otherwise.
bool retdec::llvmir2hll::ValueData::hasDerefs | ( | ) | const |
Returns true
if there are any dereferences, false
otherwise.
bool retdec::llvmir2hll::ValueData::hasStructAccesses | ( | ) | const |
Returns true
if there are any struct accesses, false
otherwise.
Returns true
if var is directly accessed, false
otherwise.
Returns true
if var is directly read, false
otherwise.
Returns true
if var is directly written, false
otherwise.
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.
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.
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.
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.
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.
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.
Returns true
if var may be indirectly accessed, false
otherwise.
Returns true
if var may be indirectly read, false
otherwise.
Returns true
if var may be indirectly written-into, false
otherwise.
ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_accessed_begin | ( | ) | const |
Returns an iterator to the first variable that must be accessed.
ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_accessed_end | ( | ) | const |
Returns an iterator past the last variable that must be accessed.
ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_read_begin | ( | ) | const |
Returns an iterator to the first variable that must be indirectly read.
ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_read_end | ( | ) | const |
Returns an iterator past the last variable that must be indirectly read.
ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_written_begin | ( | ) | const |
Returns an iterator to the first variable into which must be written.
ValueData::var_iterator retdec::llvmir2hll::ValueData::must_be_written_end | ( | ) | const |
Returns an iterator past the last variable into which must be written.
Returns true
if var must be indirectly accessed, false
otherwise.
Returns true
if var must be indirectly read, false
otherwise.
Returns true
if var must be indirectly written-into, false
otherwise.
bool retdec::llvmir2hll::ValueData::operator!= | ( | const ValueData & | other | ) | const |
Returns true
if the current object is not equal to other, false
otherwise.
bool retdec::llvmir2hll::ValueData::operator== | ( | const ValueData & | other | ) | const |
Returns true
if the current object is equal to other, false
otherwise.
|
friend |
|
private |
Set of variables whose address is taken.
|
private |
List of function calls.
|
private |
Are there any array accesses?
|
private |
Are there any dereferences?
|
private |
Are there any struct accesses?
|
private |
Set of all directly accessed variables (read or written).
|
private |
Number of uses of a variable in direct accesses.
|
private |
Set of variables that are directly read.
|
private |
Set of variables into which something is directly written.
|
private |
Set of variables which may be accessed.
|
private |
Set of variables that may be read.
|
private |
Set of variables into which something may be written.
|
private |
Set of variables which must be accessed.
|
private |
Set of variables that must be read.
|
private |
Set of variables into which something must be written.