Polaris: InterProcConstProp.cc File Reference

InterProcConstProp.cc File Reference

Go to the source code of this file.

Functions

template ostream & operator<< (ostream &, const Database< String, IPCPProcData > &)
static Expression_norm_func_calls1 (Expression *expr, Statement &stmt, ProgramUnit &pgm)
 normalize_func_calls Normalize the structure of function calls so that they only occur in assignment statements at the top level.
static void _normalize_func_calls (ProgramUnit &pgm)
static void _add_call_returns (ProgramUnit &pgm)
 add_call_returns Add dummy statements, (represented by label statements), after each subroutine or function call.
static Statement_pgm_entry (ProgramUnit &pgm)
 pgm_entry Return the entry statement for the given program unit.


Detailed Description

Definition in file InterProcConstProp.cc.


Function Documentation

template ostream& operator<< ostream &  ,
const Database< String, IPCPProcData > & 
 

static Expression* _norm_func_calls1 Expression expr,
Statement stmt,
ProgramUnit pgm
[static]
 

normalize_func_calls Normalize the structure of function calls so that they only occur in assignment statements at the top level.

WARNING: This function assumes that all arguments in an expression and all expressions in a statement are executed left to right.

... Don't normalize function calls inside implied DO statements.

Definition at line 47 of file InterProcConstProp.cc.

References Expression::arg_list(), AS_SIDE_EFFECT_FREE, Statement::assertions(), assertions_of_type(), Mutator< T >::assign(), Assertion::clone(), Iterator< T >::current(), DO_OP, FUNCTION_CALL_OP, id(), List< T >::ins_before(), List< T >::ins_last(), NOT_FORMAL, NOT_SAVED, Mutator< T >::pull(), and Iterator< T >::valid().

Referenced by _normalize_func_calls().

static void _normalize_func_calls ProgramUnit pgm  )  [static]
 

... Now, check the arguments passed to the function call. ... If any are integer constants, assign the constants to ... variables and use the variables instead. This was done ... to prevent the problem where a constant is passed and ... IPVP places an assignment statement inside the routine, ... assigning the constant to the formal parameter (which ... breaks in some backend compilers).

... e.g. A= X(1) .... FUNCTION X(N) ; N = 1 ; ..... - jph

Definition at line 87 of file InterProcConstProp.cc.

References _norm_func_calls1(), Expression::arg_list(), Mutator< T >::assign(), ASSIGNMENT_STMT, Statement::build_refs(), CALL_STMT, Expression::clone(), contains_func_call(), Iterator< T >::current(), DO_STMT, RefSet< T >::entries(), FUNCTION_CALL_OP, id(), INTEGER_CONSTANT_OP, INTEGER_TYPE, Statement::iterate_expressions(), Expression::iterator(), NOT_FORMAL, NOT_SAVED, Expression::op(), Expression::parameters_guarded(), Statement::parameters_guarded(), Statement::pred(), Statement::prev_ref(), Mutator< T >::pull(), Statement::rhs(), Statement::stmt_class(), Iterator< T >::valid(), and WHILE_STMT.

static void _add_call_returns ProgramUnit pgm  )  [static]
 

add_call_returns Add dummy statements, (represented by label statements), after each subroutine or function call.

These statements are used by the constant propagator to hold any new constants generated by these calls.

Definition at line 196 of file InterProcConstProp.cc.

References CALL_STMT, contains_func_call(), Iterator< T >::current(), Statement::stmt_class(), and Iterator< T >::valid().

static Statement& _pgm_entry ProgramUnit pgm  )  [static]
 

pgm_entry Return the entry statement for the given program unit.

Definition at line 451 of file InterProcConstProp.cc.

References Iterator< T >::current(), ENTRY_STMT, and Iterator< T >::valid().

 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:06:22 2005