Polaris: Statement.h Source File

Statement.h

Go to the documentation of this file.
00001 #ifndef _STATEMENT_H
00002 #define _STATEMENT_H
00003 ///
00004 #ifdef POLARIS_GNU_PRAGMAS
00005 #pragma interface
00006 #endif
00007 ///
00008 /// \endcode
00009 /// \section Bugs Bugs
00010 /// Statement cloning/copying resets the fields successors, predecessors,
00011 /// in_refs, out_refs and act_refs.  Currently, it is up to the programmer
00012 /// to rebuild these fields as appropriate.
00013 ///
00014 /// List of Statement types
00015 ///
00016 enum STMT_TYPE {
00017     UNDEFINED_STMT = 0,
00018 ///
00019     DO_STMT,
00020     ENDDO_STMT,
00021     WHILE_STMT,
00022 ///
00023     ASSIGNMENT_STMT,
00024 ///
00025     IF_STMT,
00026     ELSEIF_STMT,
00027     IMPLIED_GOTO_STMT,
00028     ENDIF_STMT,
00029     ELSE_STMT,
00030 ///
00031     ASSIGN_STMT,
00032 ///
00033     READ_STMT,
00034     WRITE_STMT,
00035     PRINT_STMT,
00036     OPEN_STMT,
00037     CLOSE_STMT,
00038     REWIND_STMT,
00039     BACKSPACE_STMT,
00040     ENDFILE_STMT,
00041     INQUIRE_STMT,
00042 ///
00043     STOP_STMT,
00044     PAUSE_STMT,
00045 ///
00046     FLOW_ENTRY_STMT,
00047     FLOW_EXIT_STMT,
00048 ///
00049     BLOCK_ENTRY_STMT,
00050     BLOCK_EXIT_STMT,
00051 ///
00052     ENTRY_STMT,
00053     CALL_STMT,
00054     RETURN_STMT,
00055 ///
00056     LABEL_STMT,
00057     GOTO_STMT,
00058     ARITHMETIC_IF_STMT,
00059     COMPUTED_GOTO_STMT,
00060     ASSIGNED_GOTO_STMT,
00061 ///
00062     ALLOCATE_STMT,
00063     DEALLOCATE_STMT,
00064     NULLIFY_STMT,
00065 ///
00066     DIRECTIVE_STMT,
00067 ///
00068     STMT_PTR
00069 };
00070 ///
00071 enum ASSIGN_TYPE {
00072     INVALID_ASSIGN,
00073     EXECUTABLE_ASSIGN,
00074     FORMAT_ASSIGN
00075 };
00076 ///
00077 #include "ClassNames.h"
00078 #include <stream.h>
00079 #include <strstream.h>
00080 ///
00081 #include "../AbstractAccess.h"
00082 #include "../BinRep.h"
00083 #include "../Collection/Iterator.h"
00084 #include "../Collection/Mutator.h"
00085 #include "../Collection/List.h"
00086 #include "../Collection/RefList.h"
00087 #include "../Collection/RefSet.h"
00088 #include "../debug.h"
00089 #include "../define.h"
00090 #include "../Dictionary.h"
00091 #include "../Directive/AssertionList.h"
00092 #include "../Expression/Expression.h"
00093 #include "../Relinkable.h"
00094 #include "../split_line.h"
00095 #include "../String.h"
00096 #include "../StringElem.h"
00097 #include "../Symbol/Symbol.h"
00098 #include "../SymbolAccess.h"
00099 #include "../SymbolAccessMap.h"
00100 #include "../VoidPtrDef.h"
00101 #include "../WorkSpaceStack.h"
00102 ///
00103 class Symtab;
00104 class NamelistDict;
00105 class ExprTable;
00106 class VDL;
00107 
00108 #ifdef PERFORMANCE_EVAL
00109 class PerformanceEstimator;
00110 #endif
00111 
00112 #define DUMMY_EXPR (*((Expression *)0))
00113 
00114 const int  ROUTINE_EXPR = 0;
00115 const int  PARAMETERS = 1;
00116 const int  ALLOC_PARAMS = 0;
00117 const int  ARITHIF_EXPR = 0;
00118 const int  LHS = 0;
00119 const int  ASSIGNEDGOTO_EXPR = 0;
00120 const int  RHS = 1;
00121 const int  COMPUTEDGOTO_EXPR = 0;
00122 const int  DO_INDEX = 0;
00123 const int  DO_INIT = 1;
00124 const int  DO_LIMIT = 2;
00125 const int  DO_STEP = 3;
00126 const int  ELSEIF_EXPR = 0;
00127 const int  IO_LIST = 0;
00128 const int  IF_EXPR = 0;
00129 const int  PAUSE_EXPR = 0;
00130 const int  RETURN_EXPR = 0;
00131 const int  STOP_EXPR = 0;
00132 const int  WHILE_EXPR = 0;
00133 
00134 class Statement;
00135 class StmtList;
00136 
00137 void print_expr_list(  ostream& o, const RefSet<Expression> &exprs);
00138 void print_expr_list(  ostream& o, const RefList<Expression> &exprs);
00139 void print_expr_list(  ostream& o, const List<Expression> &exprs);
00140 
00141 void print_string_list(ostream& o, const List<StringElem>& strings);
00142 
00143 
00144 ///< \class s_control_type 
00145 /// \brief 
00146 ///< type for IOStmt list template
00147 
00148 ///< The s_control_type class is a special class used in IOStmt's.  Consider
00149 ///< the following three Fortran statements:
00150 ///<
00151 ///<   1) WRITE (*, 100)
00152 ///<   2) WRITE (*, 100, END=200)
00153 ///<   3) WRITE (*, '(1X)')
00154 ///<   4) WRITE (*, *)
00155 ///<
00156 ///< In all of these examples, a list of s_control_type's is used to
00157 ///< specify the options of the WRITE statement.  The s_control_type
00158 ///< consists of a string keyword, which can be one of  "UNIT", "FMT",
00159 ///< "ERR",  "END"; and an expression, which can be a StringConstExpr,
00160 ///< LabelExpr, or FormatExpr.
00161 ///<
00162 ///< In all of the above examples, the asterisk ('*') is represented by
00163 ///< an s_control_type of ["UNIT", <IOStarExpr>] (for the asterisks in
00164 ///< 1-3 and the first asterisk in 4) or ["FMT", <IoStarExpr>] (for
00165 ///< the second asterisk in 4).
00166 ///<
00167 ///< In examples 1 and 2, the line label '100' is represented by an
00168 ///< s_control_type of
00169 ///< ["FMT", <FormatExpr pointing to a Format class representing the
00170 ///<            format at statement 100>].
00171 ///<
00172 ///< In example 2, the 'END=200' is represented by an s_control_type
00173 ///< of ["END", <LabelExpr pointing to statement 200>]
00174 ///<
00175 ///< In example 3, the "'(1X)'" is represented by an s_control_type
00176 ///< of ["FMT", <StringConstExpr "'(1X)'">]
00177 
00178 class s_control_type : public Listable {
00179     friend ostream & operator << (ostream & o, const s_control_type & sct);
00180  public:
00181     String           keyword;
00182     List<Expression> expr;
00183 
00184     s_control_type();
00185     s_control_type(String & key, Expression *expr);
00186     virtual ~s_control_type();
00187     virtual Listable *listable_clone() const;
00188     virtual int       structures_OK() const;
00189     virtual void      print(ostream & o) const;
00190     virtual void      write(ostream & o) const;
00191 };
00192 
00193 
00194 ///< This a class used for a Hashtable to keep track of
00195 ///< \'next\' fields in the statements.  It is only used during
00196 ///< conversion from BinRep's.
00197 
00198 class NextEntry : public Definition {
00199  protected:
00200     String _next;
00201 
00202  public:
00203     virtual void    print(ostream & o) const;
00204 
00205     const char     *next_ref() const 
00206                 { return (const char *) _next; }
00207 
00208     void            next(const char *n) 
00209                 { _next = n; }
00210 
00211     NextEntry(const char *tag, BinRep & bstring)
00212         : Definition(tag) {
00213         p_assert(bstring.is_string(), "ERROR");
00214         String string_name;
00215         bstring.to_string(string_name);
00216         ///< cerr << tag << "(next) = " << string_name << ". ";
00217         _next = string_name;
00218     }
00219 
00220     ~NextEntry();
00221 
00222     virtual int structures_OK() const;
00223 
00224     virtual Definition *definition_clone() const;
00225 };
00226 
00227 
00228 
00229 ///< \note whenever a field is a List<>, there is no method to
00230 ///< insert data into it. There is only one method for these
00231 ///< fields which returns the list structure.  Then the List<>
00232 ///< methods can be used to insert and retrieve data.
00233 
00234 class FormatDB;
00235 class CDGNode;
00236 
00237 class Statement : public Relinkable {
00238     friend class StmtList;
00239 
00240  protected:
00241     ///< ---- helper functions for convert ---------
00242     void            make_overflow(Iterator<BinRep> & iter, const char *exname);
00243     void            empty_overflow();
00244     int             check_common_fields(String &field, BinRep & second, 
00245                                         ExprTable & etable,
00246                                         Dictionary<NextEntry> *next_table,
00247                                         char *caller);
00248     
00249     virtual void    _setptrs(Dictionary<VoidPtrDef> &tags, const FormatDB &formats);
00250 
00251     ///< Copies base values of this into other
00252     void            copy_base(const Statement & other);
00253 
00254     ///< These are fields common to all statement types
00255 
00256     STMT_TYPE       _type;      ///< Type of statement
00257 
00258     List<Expression>   _exprlist;
00259     ///< List of the all the expressions in a statement
00260 
00261     List<Statement>    _successors_list;    ///< List for _successors
00262     RefSet<Statement>  _successors;         ///< successors of control flow
00263     List<Statement>    _predecessors_list;  ///< List for _predecessors
00264     RefSet<Statement>  _predecessors;       ///< predecessors of control flow
00265 
00266     List<Expression>   _in_refs_list;       ///< List for _in_refs
00267     RefSet<Expression> _in_refs;            ///< expressions which read memory
00268     List<Expression>   _out_refs_list;      ///< List for _out_refs
00269     RefSet<Expression> _out_refs;           ///< expressions which write memory
00270     List<Expression>   _act_refs_list;      ///< List for _act_refs
00271     RefSet<Expression> _act_refs;           ///< all memory expressions?
00272 
00273     AssertionList      _assertion_list;     ///< A list of the assertions
00274 
00275     Statement         *_outer;              ///< innermost enclosing do loop
00276  
00277     List<StringElem>   _pre_directives;     ///< Statement directives
00278     List<StringElem>   _post_directives;    ///< before & after the stmt
00279 
00280     String           _state;
00281     String           _tag;     ///< (ex. S10)
00282     ///< xxx           _loop_info;
00283 
00284     int              _line;                 ///< line number
00285     WorkSpaceStack   _work_stack;           ///< Stack of WorkSpace objects
00286     BinRep          *_overflow;             ///< Any overflow information
00287 
00288     SymbolAccessMap * _access_table;  ///< Access Region access description
00289                                                 ///<  by symbol
00290                                                 ///<  for statement, or whole block
00291                                                 ///<  if this is a block-type stmt,
00292                                                 ///<  like DO.
00293     CDGNode* _cdgnode;                            ///< Control Dependence Graph node.
00294 
00295 #ifdef PERFORMANCE_EVAL
00296   PerformanceEstimator *_perf_estimator;
00297   unsigned long         _stmtProfile;
00298 #endif
00299 
00300     void _add_act_refs   (Expression &expr) ;
00301     ///< Given an expression in the statement, add to this statement's _act_refs
00302     
00303     void _add_act_params (Expression &expr) ;
00304     ///< Given an expression which is a parameter list, add to this 
00305     ///< statement's _act_refs
00306 
00307     void _add_in_refs    (Expression &expr) ;
00308     ///< Given an expression in the statement, add to this statement's _in_refs
00309 
00310     void _add_out_refs   (Expression &expr) ;
00311     ///< Given an expression in the statement, add to this statement's _out_refs
00312     ///< ONLY FINDS THE INDEX VARIABLE OF AN EQUAL_OP:  (A(I), I=1,N)
00313 
00314     void _add_ioread_sets(Expression &expr) ;
00315     ///< Given a top-level expression from a READ I/O list, add to the 
00316     ///< READ's in/out/act _refs.
00317 
00318     inline RefSet<Statement> &modify_succ();
00319     inline RefSet<Statement> &modify_pred();
00320     ///< Create a modifyable copy of _succ and _pred for internal use.
00321 
00322 #if 0
00323     ///< The tag is needed to avoid duplication.
00324     inline void tag(const char *s) 
00325                 { _tag = s; }
00326 #endif
00327 
00328     ProgramUnit* _program_unit;
00329 
00330  public:
00331 
00332     virtual Mutator<Expression> iterate_expressions();  
00333     ///< Return an iterator over stmt exprs
00334 
00335     virtual int iterate_in_exprs_valid() const;
00336     ///< Check if there are valid in_ref exprs
00337     virtual Mutator<Expression> iterate_in_exprs_guarded();
00338     ///< Return an iterator over in_ref exprs
00339 
00340     virtual int iterate_out_exprs_valid() const;
00341     ///< Check if there are valid out_ref exprs
00342     virtual Mutator<Expression> iterate_out_exprs_guarded();
00343     ///< Return an iterator over out_ref exprs
00344 
00345     virtual int iterate_in_out_exprs_valid() const;
00346     ///< Check if there are valid in_out_ref exprs
00347     virtual Mutator<Expression> iterate_in_out_exprs_guarded();
00348     ///< Return an iterator over in_out_ref exprs
00349 
00350     void simplify_expressions();  
00351     ///< Simplify all of the expressions in the statement.
00352 
00353     ///< Statement constructor takes two argument:
00354     ///< The statement type and the statement tag
00355 
00356     Statement(const char *l, STMT_TYPE st);
00357 
00358     virtual ~Statement();
00359 
00360     virtual Listable *listable_clone() const;
00361 
00362     virtual Statement *clone() const = 0;
00363     virtual int structures_OK() const = 0;
00364 
00365     int in_out_refs_structures_OK() const;
00366     
00367     virtual void convert(BinRep &stmt, ExprTable &etable, Symtab &symtab,
00368                          const NamelistDict &namelists,
00369                          const FormatDB &formats,
00370                          Dictionary<NextEntry> *next_table);
00371 
00372     virtual RefSet<Statement> *build_succ(const StmtList &stmts) const;
00373 
00374     virtual void build_refs();
00375     ///< Build _in_refs, _out_refs, and _act_refs for the given statement
00376 
00377     ///< methods which will retrieve data from common fields
00378 
00379     inline STMT_TYPE stmt_class() const 
00380                 { return _type; }
00381 
00382     inline const RefSet<Statement> &succ() const 
00383                 { return _successors; }
00384     inline const RefSet<Statement> &pred() const 
00385                 { return _predecessors;}
00386 
00387     inline const RefSet<Expression> &in_refs() const 
00388                 { return _in_refs; }
00389     inline const RefSet<Expression> &out_refs() const 
00390                 { return  _out_refs; }
00391     inline const RefSet<Expression> &act_refs() const 
00392                 { return _act_refs; }
00393 
00394     inline Statement      *next_ref() const
00395                 { return (Statement *) Listable::next_ref(); }
00396 
00397     inline Statement      *prev_ref() const
00398                 { return (Statement *) Listable::prev_ref(); }
00399 
00400     inline Statement      *outer_ref() const 
00401                 { return _outer; }
00402 
00403     inline int             line()  const 
00404                 { return _line; }
00405 
00406     inline BinRep         *overflow() const 
00407                 { return _overflow; }
00408 
00409     inline const char     *tag() const 
00410                 { return (const char *) _tag; }
00411 
00412     inline int tag_defined() const
00413                 { return _tag.defined(); }
00414 
00415     inline const char     *state() const 
00416                 { return (const char *) _state; }
00417 
00418     inline List<StringElem>&pre_directives() const 
00419                 { return (List<StringElem>&) _pre_directives; }
00420     inline List<StringElem>&post_directives() const 
00421                 { return (List<StringElem>&) _post_directives; }
00422 
00423     inline AssertionList & assertions() const
00424                 { return (AssertionList &) _assertion_list; }
00425 
00426     ///< methods which insert data into common fields
00427 
00428     inline void state(const char *s) 
00429                 { _state = s; }
00430 
00431     inline void line(int  l) 
00432                 { _line = l; }
00433 
00434     virtual void relink_lptrs( ProgramUnit &p );
00435     ///< Change pointers within the Statement expressions to 
00436     ///< point into the given ProgramUnit.
00437 
00438     virtual void relink_sptrs( ProgramUnit &p );
00439     ///< Change pointers in special statement fields
00440     
00441     ///< Return the stack of WorkSpaces associated with the statement
00442     inline WorkSpaceStack &work_stack() const
00443                 { return (WorkSpaceStack &) _work_stack; }
00444 
00445 #ifdef PERFORMANCE_EVAL
00446   inline PerformanceEstimator *perf_estimator();
00447   inline void set_perf_estimator(PerformanceEstimator *pe);
00448   ///< Performance estimation data
00449 
00450   unsigned long profile() { return _stmtProfile; }
00451   void set_profile(unsigned long profile) { _stmtProfile = profile; }
00452 #endif
00453 
00454     virtual void access_table( SymbolAccessMap * map )
00455     { if (_access_table) { delete _access_table; } _access_table = map; }
00456 
00457     ///< Check whether the access_table exists
00458     Boolean access_table_exists( );
00459 
00460     ///< Return a reference to the access_table (check access_table_exists() first!)
00461     SymbolAccessMap & access_table( );
00462 
00463     ///< Iterate through all symbols and SymbolAccess objects
00464     KeyIterator<Symbol, SymbolAccess> iter_access_table_guarded( );
00465 
00466     ///< Add some other statement's access_table to mine
00467     void incorporate_access_table ( const SymbolAccessMap & sam );
00468 
00469     ///< Check whether any info is entered into access_table for the given Symbol
00470     Boolean symbol_access_exists( Symbol & sym );
00471 
00472     ///< Once symbol_access_exists indicates that info exists, use one of the
00473     ///< following to get an Iterator for looking through the AbstractAccess info.
00474     virtual Iterator<AbstractAccess> iter_read_guarded( Symbol & sym );
00475     virtual Iterator<AbstractAccess> iter_write_guarded( Symbol & sym );
00476     virtual Iterator<AbstractAccess> iter_readwrite_guarded( Symbol & sym );
00477 
00478     ///< Insert a set of AbstractAccess objects into the SymbolAccessMap table for a statement
00479     void ins_access( SymbolAccessMap & map );
00480 
00481     ///< Insert a list of AbstractAccess into the access_table
00482     void ins_read_access( Symbol & sym, List<AbstractAccess> & readlist);
00483 
00484     ///< Insert a list of AbstractAccess into the access_table
00485     void ins_write_access( Symbol & sym, List<AbstractAccess> & writelist);
00486 
00487     ///< Insert a list of AbstractAccess into the access_table
00488     void ins_readwrite_access( Symbol & sym, List<AbstractAccess> & readwritelist);
00489 
00490     ///< Insert read AbstractAccess for a given symbol into the access_table
00491     void ins_read_access( Symbol & sym, AbstractAccess * );
00492 
00493     ///< Insert write AbstractAccess for a given symbol into the access_table
00494     void ins_write_access( Symbol & sym, AbstractAccess * );
00495 
00496     ///< Insert readwrite AbstractAccess for a given symbol into the access_table
00497     void ins_readwrite_access( Symbol & sym, AbstractAccess * );
00498 
00499     ///<  Update the flow graph information for a particular statement.
00500     void fix_flow( StmtList & stmts );
00501 
00502     ///<  Remove flow links for this statement.
00503     void del_flow( StmtList & stmts );
00504 
00505     ///< called when an unspecified method is called
00506     void error(char *) const;
00507 
00508     ProgramUnit* program_unit() {return _program_unit;};
00509     void program_unit(ProgramUnit* program_unit) {_program_unit=program_unit;};
00510 
00511     Iterator<Expression> iterate_all_expressions();
00512 
00513     ///< methods which retrieve statement specific data
00514     ///< Will be redefined by sub-classes if field exists
00515 
00516     virtual const Expression & lhs() const;
00517     virtual Expression & lhs();
00518     virtual const Expression & rhs() const;
00519     virtual Expression & rhs();
00520 
00521     virtual Statement *follow_ref() const;
00522     virtual Statement *lead_ref() const;
00523     virtual Statement *matching_if_ref() const;
00524     virtual Statement *matching_endif_ref() const;
00525     virtual const Expression & expr() const;
00526     virtual Expression & expr() ;
00527     
00528     virtual const Expression & index() const;
00529     virtual Expression & index();
00530     virtual const Expression & init() const;
00531     virtual Expression & init();
00532     virtual const Expression & limit() const;
00533     virtual Expression & limit();
00534     virtual const Expression & step() const;
00535     virtual Expression & step();
00536     virtual const Expression & expr_guarded() const;
00537     virtual Expression & expr_guarded() ;
00538     virtual int expr_valid() const;
00539 
00540     virtual String get_loop_name();
00541 
00542     virtual const Statement *target_ref() const;
00543     virtual Statement *target_ref() ;
00544     virtual ASSIGN_TYPE atype() const;
00545     virtual const Format *format_ref() const;
00546     virtual Format *format_ref();
00547 
00548     virtual const RefList<Statement> &label_list() const;
00549     virtual RefList<Statement> &label_list();
00550 
00551     virtual const List<s_control_type> &s_control_guarded() const;
00552     virtual List<s_control_type> &s_control_guarded();
00553     virtual int s_control_valid() const;
00554 
00555     virtual Boolean marked_parallel() const;  ///< True, if loop has an AS_PARALLEL 
00556                                       ///< assertion attached.
00557     virtual Boolean marked_serial() const;  ///< True, if loop has an AS_SERIAL 
00558                                       ///< assertion attached.
00559     virtual RefSet<Symbol> *private_vars_ref() const;///< Expressions from PRIVATE assertion
00560 
00561     virtual const Expression & io_list_guarded() const;
00562     virtual Expression & io_list_guarded();
00563     virtual int io_list_valid() const;
00564 
00565     virtual const Expression & routine_guarded() const;
00566     virtual Expression & routine_guarded();
00567     virtual int routine_valid() const;
00568 
00569     virtual const Expression & parameters_guarded() const;
00570     virtual Expression & parameters_guarded();
00571     virtual int parameters_valid() const;
00572 
00573     virtual int  value() const;
00574 
00575     ///< methods which insert statement specific data
00576     ///< will be redefined by sub-classes if field exists
00577 
00578     virtual void    lhs(Expression * e);
00579     virtual void    rhs(Expression * e);     
00580     virtual void    index(Expression * e);   
00581     virtual void    init(Expression * e);    
00582     virtual void    limit(Expression * e);   
00583     virtual void    step(Expression * e);    
00584     virtual void    expr(Expression * e);    
00585     virtual void    target(Statement * s);   
00586     virtual void    io_list(Expression * e); 
00587     virtual void    routine(Expression * e);     
00588     virtual void    parameters(Expression * e);
00589     virtual void    value(int  i);
00590 
00591     ///< This one is to satisfy Listable
00592     virtual void    print(ostream & o) const;
00593 
00594     virtual void    fortran_write(ostream & o, int &indent, 
00595                                   char *type = "") const = 0;
00596     virtual void    print_debug(ostream & o, int debug) const = 0;
00597 
00598     ///< prints the statement if debug = 0,
00599     ///< print only statement-specific debugging if debug = 1 (to be
00600     ///< used in conjunction with print_fields).
00601     ///< Print was primarily designed to be used by other functions, to
00602     ///< better output statements we suggest using the << operator to print
00603     ///< with debugging info or the write method to print in FORTRAN form
00604 
00605     virtual void    write(ostream & o, int &indent, char *type = "") const;
00606 
00607     ///< Write out the SymbolAccessMap
00608     void write_access_table( ostream & o );
00609 
00610     ///< prints the statement in FORTRAN form with indent
00611 
00612     void            print_fields(ostream & o) const;
00613 
00614     ///< prints all additional fields (fields defined in the base class) 
00615     ///< for debugging
00616  
00617     virtual void    exchange_convert( VDL &vdl );
00618     ///< Convert the Statement into the exchange format.
00619 
00620     CDGNode* cdgnode();
00621     void cdgnode(CDGNode* n);
00622 
00623     friend ostream & operator << (ostream & o, const Statement & st);
00624 };
00625 
00626 
00627 inline RefSet<Statement> &
00628 Statement::modify_succ()
00629 {
00630     return _successors;
00631 }
00632 
00633 inline RefSet<Statement> &
00634 Statement::modify_pred()
00635 {
00636     return _predecessors;
00637 }
00638 inline CDGNode* Statement::cdgnode(){
00639   return _cdgnode;
00640 }
00641 
00642 inline void Statement::cdgnode(CDGNode* n){
00643   _cdgnode=n;
00644 }
00645 
00646 #ifdef PERFORMANCE_EVAL
00647 inline PerformanceEstimator *
00648 Statement::perf_estimator()
00649 { 
00650   return _perf_estimator;
00651 }    
00652 
00653 inline void 
00654 Statement::set_perf_estimator(PerformanceEstimator *pe)
00655 { 
00656   _perf_estimator = pe; 
00657 }    
00658 #endif
00659 
00660 inline Iterator<Expression> 
00661 Statement::iterate_all_expressions()
00662 {
00663   return Iterator<Expression>(_exprlist);
00664 }
00665 
00666 void        print_target_labels(ostream& o, const RefSet<Statement>& stmts);
00667 void        print_stmt_list(ostream& o, const RefSet<Statement>& stmts);
00668 void        print_stmt_tags(ostream& o, const RefSet<Statement>& stmts);
00669 
00670 void        print_target_labels(ostream& o, const RefList<Statement>& stmts);
00671 void        print_stmt_list(ostream& o, const RefList<Statement>& stmts);
00672 void        print_stmt_tags(ostream& o, const RefList<Statement>& stmts);
00673 
00674 void        print_target_labels(ostream& o, const List<Statement>& stmts);
00675 void        print_stmt_list(ostream& o, const List<Statement>& stmts);
00676 void        print_stmt_tags(ostream& o, const List<Statement>& stmts);
00677 
00678 ///< There exist two flavors of constructors for the Statement
00679 ///< classes.
00680 ///<
00681 ///< One brand of constructors takes a single argument if the
00682 ///< the constructor specifies a specific statement (ex. DO,
00683 ///< ASSIGNMENT). That argument is the statement tag.
00684 ///< However, if the constructor's class specifies more than
00685 ///< one statement (ex. IOStmt) the constructor takes two arguments:
00686 ///< the statement type and then the statement tag.
00687 ///<
00688 ///< The second type of constructor accepts the arguments described
00689 ///< above followed by all arguments necessary to FULLY specify
00690 ///< the statement.  In situations where the statement is defined by
00691 ///< a list of some type, there exist constructors which allow
00692 ///< the statement to be defined up to some finite list size.
00693 
00694 #endif
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:06:12 2005