Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

SemanticHelper Class Reference

This class understands the semantics of IR nodes. More...

#include <utils/semantic_helper.h>

List of all members.


Static Public Members

unsigned get_src_var (const ExecutionObject* exp, suif_vector<VariableSymbol*>* lst = NULL)
Collect all source variables from an ExecutionObject. More...

unsigned get_dst_var (const Statement* stmt, suif_vector<VariableSymbol*>* lst = NULL)
Collect all destination variables from a Statement. More...


Detailed Description

This class understands the semantics of IR nodes.

Example: To retrieve all source var into a suif_vector:

    suif_vector<VariableSymbol*> vars;
    SemanticHelper::get_src_var( execution_Object, &vars);

To iterate over all source vars in an execution object:

    for (SemanticHelper::SrcVarIter iter(execution_object);
         iter.is_valid();
         iter.next()) {
      ... iter.current() ...

To retrieve all destination variables in a statement

     suif_vector<VariableSymbol*> vars;
     SemanticHelper::get_dst_var( statement, &vars );

To iterate over all destination variables in a statement

     for (SemanticHelper::DstVarIter iter(statement);
          iter.is_valid();
          iter.next()) {
       ... iter.current() ...

Member Function Documentation

unsigned SemanticHelper::get_src_var (const ExecutionObject * exp, suif_vector<VariableSymbol *>* lst = NULL) [static]

Collect all source variables from an ExecutionObject.

Parameters:
exp - the ExecutionObject.
lst - a vector to collect the variables.
Returns:
number of source variables found in exp.

The source variables will be appended to lst, and the number of variables appended will be returned.

unsigned SemanticHelper::get_dst_var (const Statement * stmt, suif_vector<VariableSymbol *>* lst = NULL) [static]

Collect all destination variables from a Statement.

Parameters:
exp - the Statement.
lst - a vector to collect the variables.
Returns:
number of destination variables found in exp.

The destination variables will be appended to lst, and the number of variables appended will be returned.

The documentation for this class was generated from the following files:
Generated at Wed Apr 25 17:35:04 2001 for NCI SUIF by doxygen  written by Dimitri van Heesch, © 1997-1999