ROSE
0.9.6a
|
Local variable. More...
#include <annvariable.h>
Public Member Functions | |
annVariable (std::string name, std::string procedure_name, bool is_new, bool is_global, bool is_external, bool is_formal, bool is_io) | |
Create a new annotation variable. More... | |
~annVariable () | |
Destructor. More... | |
std::string & | name () |
Clear. More... | |
bool | is_new () const |
bool | is_used () const |
bool | is_defined () const |
bool | is_global () const |
bool | is_external () const |
bool | is_formal () const |
bool | is_io () const |
bool | is_deleted () const |
bool | is_property_variable () const |
void | set_used () |
void | set_defined () |
void | set_global () |
void | set_external () |
void | set_formal () |
void | set_io () |
void | set_deleted () |
void | set_property_variable () |
void | print (std::ostream &o) const |
Private Attributes | |
std::string | _name |
the variable name More... | |
Flags | |
bindings This field maps each context of use of this variable to it's actual pointer value in that context. We store all the contexts (and not just the current bindings) for two reasons. First, we use this data structure to store the memoryBlocks that represent heap allocations (uses of "new" in the on_exit annotations). Second, we use these contexts during other phases of the compiler, such as reports and actions. TestSynthetic declaration node | |
bool | _is_new |
bool | _is_used |
bool | _is_defined |
bool | _is_global |
bool | _is_external |
bool | _is_formal |
bool | _is_io |
bool | _is_deleted |
bool | _is_property_variable |
Friends | |
std::ostream & | operator<< (std::ostream &o, const annVariable &var) |
Get the bindings. More... | |
Local variable.
This class represents a local variable in the procedure annotations. A local variable has a name and a binding that is used to associate the actual memory objects assigned to it.
Definition at line 34 of file annvariable.h.
annVariable::annVariable | ( | std::string | name, |
std::string | procedure_name, | ||
bool | is_new, | ||
bool | is_global, | ||
bool | is_external, | ||
bool | is_formal, | ||
bool | is_io | ||
) |
Create a new annotation variable.
The is_external boolean determines whether or not to create a synthetic declNode for this variable. For external variables, we'll get the real declNode from the header files.
annVariable::~annVariable | ( | ) |
Destructor.
Note: we have to be careful here because we want to delete the synthetic declarations, but not the real ones (see the constructor above).
|
inline |
|
inline |
Definition at line 124 of file annvariable.h.
References _is_new.
|
inline |
Definition at line 125 of file annvariable.h.
References _is_used.
|
inline |
Definition at line 126 of file annvariable.h.
References _is_defined.
|
inline |
Definition at line 127 of file annvariable.h.
References _is_global.
|
inline |
Definition at line 128 of file annvariable.h.
References _is_external.
|
inline |
Definition at line 129 of file annvariable.h.
References _is_formal.
|
inline |
Definition at line 130 of file annvariable.h.
References _is_io.
|
inline |
Definition at line 131 of file annvariable.h.
References _is_deleted.
|
inline |
Definition at line 132 of file annvariable.h.
References _is_property_variable.
|
inline |
Definition at line 134 of file annvariable.h.
References _is_used.
|
inline |
Definition at line 135 of file annvariable.h.
References _is_defined.
|
inline |
Definition at line 136 of file annvariable.h.
References _is_global.
|
inline |
Definition at line 144 of file annvariable.h.
References _is_external.
|
inline |
Definition at line 146 of file annvariable.h.
References _is_formal.
|
inline |
Definition at line 154 of file annvariable.h.
References _is_io.
|
inline |
Definition at line 155 of file annvariable.h.
References _is_deleted.
|
inline |
Definition at line 156 of file annvariable.h.
References _is_property_variable.
void annVariable::print | ( | std::ostream & | o) | const |
|
friend |
Get the bindings.
Return the set of memoryBlocks bound to the variable in the given calling context. For globals, there is only one binding (this is taken care of internally). Get a fresh binding
This is used by the Analyzer when it is setting up the new bindings at a call site. It first clears the existing pointerValue then returns it. Create bindings
Set up a binding for the given calling context and initialize it with the given memoryBlock. Check for a binding
See if the variable has a binding in the given calling context.
Definition at line 213 of file annvariable.h.
|
private |
|
private |
Definition at line 72 of file annvariable.h.
Referenced by is_new().
|
private |
Definition at line 73 of file annvariable.h.
Referenced by is_used(), and set_used().
|
private |
Definition at line 74 of file annvariable.h.
Referenced by is_defined(), and set_defined().
|
private |
Definition at line 75 of file annvariable.h.
Referenced by is_global(), and set_global().
|
private |
Definition at line 76 of file annvariable.h.
Referenced by is_external(), and set_external().
|
private |
Definition at line 77 of file annvariable.h.
Referenced by is_formal(), and set_formal().
|
private |
Definition at line 78 of file annvariable.h.
|
private |
Definition at line 79 of file annvariable.h.
Referenced by is_deleted(), and set_deleted().
|
private |
Definition at line 80 of file annvariable.h.
Referenced by is_property_variable(), and set_property_variable().