retdec
alias_analysis.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_ANALYSIS_ALIAS_ANALYSIS_ALIAS_ANALYSIS_H
8 #define RETDEC_LLVMIR2HLL_ANALYSIS_ALIAS_ANALYSIS_ALIAS_ANALYSIS_H
9 
10 #include <string>
11 
15 
16 namespace retdec {
17 namespace llvmir2hll {
18 
19 class Module;
20 class Variable;
21 
33 public:
34  virtual ~AliasAnalysis() = default;
35 
36  virtual void init(ShPtr<Module> module);
37  virtual bool isInitialized() const;
38 
49  virtual const VarSet &mayPointTo(ShPtr<Variable> var) const = 0;
50 
60  virtual ShPtr<Variable> pointsTo(ShPtr<Variable> var) const = 0;
61 
66  virtual bool mayBePointed(ShPtr<Variable> var) const = 0;
67 
71  virtual std::string getId() const = 0;
72 
73 protected:
74  AliasAnalysis() = default;
75 
76 protected:
79 
84 };
85 
86 } // namespace llvmir2hll
87 } // namespace retdec
88 
89 #endif
A base class for all alias analyses.
Definition: alias_analysis.h:32
virtual ShPtr< Variable > pointsTo(ShPtr< Variable > var) const =0
Returns the variable to which var always points.
VarSet globalVars
Definition: alias_analysis.h:83
ShPtr< Module > module
The current module.
Definition: alias_analysis.h:78
virtual void init(ShPtr< Module > module)
Initializes the analysis.
Definition: alias_analysis.cpp:26
virtual bool mayBePointed(ShPtr< Variable > var) const =0
Returns true if a pointer may point to var, false otherwise.
virtual std::string getId() const =0
Returns the ID of the analysis.
virtual const VarSet & mayPointTo(ShPtr< Variable > var) const =0
Returns the set of variables to which var may point to.
virtual bool isInitialized() const
Returns true if the analysis has been initialized, false otherwise.
Definition: alias_analysis.cpp:37
A mixin to make classes non-copyable.
Definition: non_copyable.h:27
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
std::set< ShPtr< Variable > > VarSet
Set of variables.
Definition: types.h:57
Definition: archive_wrapper.h:19
A mixin to make classes non-copyable.
Declarations, aliases, macros, etc. for the use of smart pointers.
Aliases for several useful types.