ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Diagnostic Class Reference

A data structure used for tracing in error disgnostic. More...

#include <diagnostic.h>

Collaboration diagram for Diagnostic:

Public Member Functions

 Diagnostic (enumPropertyAnn *property)
 Create a new Diagnostic. More...
 
bool is_diagnostic_value (enumValueAnn *v)
 Check if a value is traced by this Diagnostic. More...
 
void add_diagnostic_value (enumValueAnn *v)
 Add a value to be traced by this Diagnostic. More...
 
bool contain_diagnostic_value (enumvalue_set values) const
 Check if any value in a given set is traced by this Diagnostic. More...
 
void add_defuse (Location *loc, memoryDef *lhs, memoryUse *rhs)
 Remember a new definition/use pair for a location. More...
 
void reset (Location *loc)
 Erase all definitions and uses for a location. More...
 
void reset ()
 
void trace (ostream &out, Location *loc, pointerValue &pv)
 Performs tracing for the error diagnostic on the pointer value at a location. More...
 

Private Types

typedef map< memoryDef
*, memoryuse_set > 
def2uses
 
typedef pair< Location
*, memoryDef * > 
Location_pair
 Tracing is performed via pairs of Locations. More...
 
typedef list< Segment * > Segments
 For convenience, define ordered list of Segment's. More...
 

Private Member Functions

Segment * trace (Location *from, memoryDef *def)
 Helper functions for the other trace function. More...
 
Segment * trace (Location *from, Location *to)
 Helper functions for the other trace function. More...
 
int detect_cycle (Segment *cur, Segments &visited, bool specific=false)
 
void find_shortest (Segment *cur, Segments path, Segments &shortest)
 

Private Attributes

REF enumPropertyAnn_property
 The property to trace. More...
 
TREE enumvalue_set _diagnostic_values
 The set of values in the property to trace. More...
 
TREE map< Location *, def2uses_def2uses
 The definitions and uses at a location. More...
 
Segments segments
 Stores all segments computed. More...
 
Segments starts
 Each path (trace) starts with a Segment. More...
 
map< Location_pair, Segment * > segment_path
 Stores the Segment computed for each Location pair. More...
 

Detailed Description

A data structure used for tracing in error disgnostic.

Definition at line 14 of file diagnostic.h.

Member Typedef Documentation

typedef map<memoryDef*, memoryuse_set> Diagnostic::def2uses
private

Definition at line 16 of file diagnostic.h.

typedef pair<Location*,memoryDef*> Diagnostic::Location_pair
private

Tracing is performed via pairs of Locations.

For convenience, define type for such pairs.

Definition at line 60 of file diagnostic.h.

typedef list<Segment*> Diagnostic::Segments
private

For convenience, define ordered list of Segment's.

Definition at line 66 of file diagnostic.h.

Constructor & Destructor Documentation

Diagnostic::Diagnostic ( enumPropertyAnn property)
inline

Create a new Diagnostic.

Definition at line 27 of file diagnostic.h.

Member Function Documentation

bool Diagnostic::is_diagnostic_value ( enumValueAnn v)
inline

Check if a value is traced by this Diagnostic.

Definition at line 30 of file diagnostic.h.

References _diagnostic_values, and enumValueAnn::id().

Referenced by add_diagnostic_value().

void Diagnostic::add_diagnostic_value ( enumValueAnn v)
inline

Add a value to be traced by this Diagnostic.

Definition at line 35 of file diagnostic.h.

References _diagnostic_values, enumvalue_set::insert(), and is_diagnostic_value().

bool Diagnostic::contain_diagnostic_value ( enumvalue_set  values) const
inline

Check if any value in a given set is traced by this Diagnostic.

Definition at line 40 of file diagnostic.h.

References _diagnostic_values.

void Diagnostic::add_defuse ( Location *  loc,
memoryDef *  lhs,
memoryUse *  rhs 
)
inline

Remember a new definition/use pair for a location.

Definition at line 45 of file diagnostic.h.

References _def2uses.

void Diagnostic::reset ( Location *  loc)
inline

Erase all definitions and uses for a location.

Definition at line 50 of file diagnostic.h.

References _def2uses.

void Diagnostic::reset ( )
inline

Definition at line 51 of file diagnostic.h.

References _def2uses.

void Diagnostic::trace ( ostream &  out,
Location *  loc,
pointerValue &  pv 
)

Performs tracing for the error diagnostic on the pointer value at a location.

Segment* Diagnostic::trace ( Location *  from,
memoryDef *  def 
)
private

Helper functions for the other trace function.

Segment* Diagnostic::trace ( Location *  from,
Location *  to 
)
private

Helper functions for the other trace function.

int Diagnostic::detect_cycle ( Segment *  cur,
Segments visited,
bool  specific = false 
)
private
void Diagnostic::find_shortest ( Segment *  cur,
Segments  path,
Segments shortest 
)
private

Member Data Documentation

REF enumPropertyAnn* Diagnostic::_property
private

The property to trace.

Definition at line 19 of file diagnostic.h.

TREE enumvalue_set Diagnostic::_diagnostic_values
private

The set of values in the property to trace.

Definition at line 21 of file diagnostic.h.

Referenced by add_diagnostic_value(), contain_diagnostic_value(), and is_diagnostic_value().

TREE map<Location*,def2uses> Diagnostic::_def2uses
private

The definitions and uses at a location.

Definition at line 23 of file diagnostic.h.

Referenced by add_defuse(), and reset().

Segments Diagnostic::segments
private

Stores all segments computed.

Definition at line 72 of file diagnostic.h.

Segments Diagnostic::starts
private

Each path (trace) starts with a Segment.

Store the start of each path here.

Definition at line 75 of file diagnostic.h.

map<Location_pair,Segment*> Diagnostic::segment_path
private

Stores the Segment computed for each Location pair.

Definition at line 78 of file diagnostic.h.


The documentation for this class was generated from the following file: