ROSE
0.9.6a
|
A dataflow analysis property. More...
#include <enum_property.h>
Public Types | |
typedef std::vector < enumValueAnn * > | enumvalue_vec |
typedef enumvalue_vec::iterator | enumvalue_vec_p |
typedef enumvalue_vec::const_iterator | enumvalue_vec_cp |
Public Types inherited from propertyAnn | |
enum | propertyKind { EnumProperty, SetProperty } |
Public Member Functions | |
enumPropertyAnn (const parserID *name, Direction direction, bool enforce_weak_updates, const parserID *default_name, enumvalue_list *lowest_values, parserid_list *diagnostic_values=NULL) | |
Create a new property. More... | |
void | clear () |
Clear the analysis information. More... | |
bool | enforce_weak_updates () const |
Query whether it enforces weak updates. More... | |
enumValueAnn * | values () const |
Lattice. More... | |
enumValueAnn * | lookup (const std::string &name) |
Lookup a value by name. More... | |
enumValueAnn * | bottom () const |
Return the bottom element. More... | |
enumValueAnn * | top () const |
Return the top element. More... | |
enumValueAnn * | default_val () const |
Return the default element. More... | |
enumValueAnn * | meet (enumValueAnn *one, enumValueAnn *two) |
Meet function. More... | |
void | meet_with (enumvalue_set &first, const enumvalue_set &second) |
Set meet function. More... | |
bool | at_least (enumValueAnn *left, enumValueAnn *right) |
At-least function. More... | |
bool | at_most (enumValueAnn *left, enumValueAnn *right) |
At-most function. More... | |
void | precision_analysis (Analyzer *analyzer, int analyzed_properties) |
Precision analysis. More... | |
double | compute_accuracy (Analyzer *analyzer) |
Compute accuracy. More... | |
void | print (std::ostream &o) const |
Add flow-sensitive object. More... | |
enumValueAnn * | merge_enumvalue_set (enumvalue_set value_set) |
Merge enumvalue_set. More... | |
std::string | to_string (enumvalue_set value_set) |
Convert enum values to string. More... | |
void | reset_diagnostic () |
Reset error diagnostic. More... | |
Public Member Functions inherited from propertyAnn | |
propertyAnn (const parserID *name, Direction direction, propertyKind kind) | |
Create a new property. More... | |
void | set_id (int id) |
Set ID. More... | |
int | get_id () const |
Get the ID. More... | |
std::string & | name () |
Property name. More... | |
const std::string & | name () const |
bool | is_enabled () const |
Is enabled? More... | |
void | disable () |
Disable this analysis. More... | |
void | enable () |
Enable this analysis. More... | |
Direction | direction () const |
Direction. More... | |
propertyKind | kind () const |
Kind. More... | |
Public Member Functions inherited from Ann | |
Ann (int line) | |
int | line () const |
Private Member Functions | |
void | print (std::ostream &o, enumValueAnn *prop, int depth) const |
Performs error diagnostic. More... | |
void | number_values (enumValueAnn *prop, int &cur_index, int height, int &max_height) |
Number values. More... | |
Private Attributes | |
bool | _is_may_property |
May or must property. More... | |
bool | _enforce_weak_updates |
Strong or weak. More... | |
TREE enumValueAnn * | _values |
Pointer to the lattice elements. More... | |
TREE enumValueAnn * | _top |
Lattice top. More... | |
REF enumValueAnn * | _default |
Default value. More... | |
REF enumvalue_vec | _value_index |
Lattice elements ordered by index. More... | |
double | _number_of_flowvalues |
Flow-sensitive "must" values. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const enumPropertyAnn &anns) |
Look up a sub-block. More... | |
Additional Inherited Members | |
Protected Attributes inherited from propertyAnn | |
std::string | _name |
Name of the property. More... | |
int | _id |
ID. More... | |
bool | _is_enabled |
Enabled. More... | |
Direction | _direction |
Analysis direction. More... | |
propertyKind | _kind |
The kind of property. More... | |
A dataflow analysis property.
Definition at line 150 of file enum_property.h.
typedef std::vector< enumValueAnn *> enumPropertyAnn::enumvalue_vec |
Definition at line 154 of file enum_property.h.
typedef enumvalue_vec::iterator enumPropertyAnn::enumvalue_vec_p |
Definition at line 155 of file enum_property.h.
typedef enumvalue_vec::const_iterator enumPropertyAnn::enumvalue_vec_cp |
Definition at line 156 of file enum_property.h.
enumPropertyAnn::enumPropertyAnn | ( | const parserID * | name, |
Direction | direction, | ||
bool | enforce_weak_updates, | ||
const parserID * | default_name, | ||
enumvalue_list * | lowest_values, | ||
parserid_list * | diagnostic_values = NULL |
||
) |
Create a new property.
void enumPropertyAnn::clear | ( | ) |
Clear the analysis information.
Call this method to re-initialize the analysis information so that the property analyzer can be run again.
|
inline |
Query whether it enforces weak updates.
Definition at line 332 of file enum_property.h.
References _enforce_weak_updates.
|
inline |
enumValueAnn* enumPropertyAnn::lookup | ( | const std::string & | name) |
Lookup a value by name.
|
inline |
|
inline |
|
inline |
enumValueAnn* enumPropertyAnn::meet | ( | enumValueAnn * | one, |
enumValueAnn * | two | ||
) |
Meet function.
This version is for meeting individual elements.
void enumPropertyAnn::meet_with | ( | enumvalue_set & | first, |
const enumvalue_set & | second | ||
) |
Set meet function.
Depending on whether this is a "may" or "must" property. Side-effects the value of the first parameter.
bool enumPropertyAnn::at_least | ( | enumValueAnn * | left, |
enumValueAnn * | right | ||
) |
At-least function.
Return true if left >= right ( left ^ right == right). Includes the special case that if right is top, then return false.
bool enumPropertyAnn::at_most | ( | enumValueAnn * | left, |
enumValueAnn * | right | ||
) |
At-most function.
Return true if left <= right ( left ^ right == left)
void enumPropertyAnn::precision_analysis | ( | Analyzer * | analyzer, |
int | analyzed_properties | ||
) |
Precision analysis.
Post-process the results of analysis to determine a list of variables to make flow sensitive. NEW Precision analysis
double enumPropertyAnn::compute_accuracy | ( | Analyzer * | analyzer) |
Compute accuracy.
Print out accuracy information and return overall value.
void enumPropertyAnn::print | ( | std::ostream & | o) | const |
Add flow-sensitive object.
Record that in the future, this property block should be flow sensitive. Set flow sensitivity
For a given real blocks, see if it's property block for this property. Called by Analyzer::lookup_property_block() Count flow sensitive objectsOutput method
enumValueAnn* enumPropertyAnn::merge_enumvalue_set | ( | enumvalue_set | value_set) |
Merge enumvalue_set.
Visit the values in an enumvalue_set and merge them into a single value using the meet function.
std::string enumPropertyAnn::to_string | ( | enumvalue_set | value_set) |
Convert enum values to string.
void enumPropertyAnn::reset_diagnostic | ( | ) |
Reset error diagnostic.
|
private |
Performs error diagnostic.
Performs error diagnostic if any diagnostic values declared by the property is found in value_set. The precondition is that a condition involving this property (such as an enumPropertyExprAnn) with the pointer value pv, value set value_set, and location whereis already evaluated to be true; we now want to trace back from this location how pv gets this value. Compare the value at a location to a given value. Print out this property
|
private |
Number values.
|
friend |
Look up a sub-block.
Given a real memoryBlock, look up the corresponding sub-block for this property. Returns null if none exists. Add a sub-block
This method is called by the analyzer during pointer analysis to tell the property about the sub-blocks that it's creating for it. Test two variables
Test a particular property condition between two variables. Output operator
Definition at line 642 of file enum_property.h.
|
private |
May or must property.
When true, the sets of value are combined using union, making the property a "may" property. When false, the sets are combined using intersection, making this a "must" property.
Definition at line 201 of file enum_property.h.
|
private |
Strong or weak.
We can have properties that enforce weak updates, or not. It's up to the user to make sure that these are correct.
Definition at line 208 of file enum_property.h.
Referenced by enforce_weak_updates().
|
private |
Pointer to the lattice elements.
This pointer actually refers to the "bottom" element. All other elements are reachable by following the "more_specific" pointers.
Definition at line 215 of file enum_property.h.
|
private |
|
private |
Default value.
This is the value we'll use whenever there isn't a reaching definition (or use, depending on the direction). If none is provided, then TOP is used.
Definition at line 227 of file enum_property.h.
Referenced by default_val().
|
private |
Lattice elements ordered by index.
Definition at line 231 of file enum_property.h.
|
private |
Flow-sensitive "must" values.
Flow-insensitive "may" values Values of property blocks as input_to to a callee. Objects that need flow-sensitivity
Store a list of the real blocks that need flow sensitivity for this property. Tested objects
For trace-back adaptivity, keep track of all objects whose value is tested. Accuracy measurements
Store information about the accuracy of flow values at locations where the property is tested. We can use this information to compute an aggregate accuracy for the property. Error statements
Keep a list of the statements that have errors that depend on this property. Number of flow values
The number of possible flow values, exluding top and bottom.
Definition at line 292 of file enum_property.h.