retdec
|
A base class for all alias analyses. More...
#include <alias_analysis.h>
Public Member Functions | |
virtual | ~AliasAnalysis ()=default |
virtual void | init (ShPtr< Module > module) |
Initializes the analysis. More... | |
virtual bool | isInitialized () const |
Returns true if the analysis has been initialized, false otherwise. More... | |
virtual const VarSet & | mayPointTo (ShPtr< Variable > var) const =0 |
Returns the set of variables to which var may point to. More... | |
virtual ShPtr< Variable > | pointsTo (ShPtr< Variable > var) const =0 |
Returns the variable to which var always points. More... | |
virtual bool | mayBePointed (ShPtr< Variable > var) const =0 |
Returns true if a pointer may point to var, false otherwise. More... | |
virtual std::string | getId () const =0 |
Returns the ID of the analysis. More... | |
Protected Member Functions | |
AliasAnalysis ()=default | |
Protected Attributes | |
ShPtr< Module > | module |
The current module. More... | |
VarSet | globalVars |
Additional Inherited Members | |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable ()=default | |
~NonCopyable ()=default | |
A base class for all alias analyses.
Use create() to create instances. After create(), the alias analysis has to be initialized by calling init(). If this member function is not called prior to calling analysis member functions, like mayPointTo()
, the behavior of these member functions is undefined.
Instances of this class have reference object semantics.
|
virtualdefault |
|
protecteddefault |
|
pure virtual |
Returns the ID of the analysis.
Implemented in retdec::llvmir2hll::SimpleAliasAnalysis, and retdec::llvmir2hll::BasicAliasAnalysis.
Initializes the analysis.
[in] | module | The module to be analyzed. |
This member function has to be called (1) when an instance of this class (or its subclass) is created and (2) whenever the current module is changed in a way that may change the results of the alias analysis.
Reimplemented in retdec::llvmir2hll::SimpleAliasAnalysis, and retdec::llvmir2hll::BasicAliasAnalysis.
|
virtual |
Returns true
if the analysis has been initialized, false
otherwise.
|
pure virtual |
Returns true
if a pointer may point to var, false
otherwise.
Implemented in retdec::llvmir2hll::SimpleAliasAnalysis.
|
pure virtual |
Returns the set of variables to which var may point to.
If var is not a pointer, the empty set is returned. If pointsTo(var)
returns a variable (non-null), then this function returns the singleton set containing the result of pointsTo(var)
.
If the analysis hasn't been initialized, the behavior of this member function is undefined.
Implemented in retdec::llvmir2hll::SimpleAliasAnalysis.
|
pure virtual |
Returns the variable to which var always points.
If the variable may point to several variables or it is unknown to what the variable points to, the null pointer is returned.
If the analysis hasn't been initialized, the behavior of this member function is undefined.
Implemented in retdec::llvmir2hll::SimpleAliasAnalysis.
|
protected |
Global variables in module
. This is here to speedup the analysis. By using this set, we do not have to ask module
every time we need such information.