InlineObject Class Reference#include <InlineObject.h>
Inheritance diagram for InlineObject:
[legend]List of all members.
Member Enumeration Documentation
|
|
- Enumeration values:
-
| NO_CLEANUP_NEEDED |
|
| CLEANUP_NEEDED |
|
Definition at line 46 of file InlineObject.h. |
Constructor & Destructor Documentation
| InlineObject::InlineObject |
( |
ProgramUnit & |
pgm |
) |
[inline] |
|
Member Function Documentation
| void InlineObject::remap_arg_names |
( |
Statement & |
s |
) |
|
|
|
|
insert formal->actual name mapping into _symbol_map
USED ONLY FOR ACCESS REGION ARGUMENT TRANSLATION.
... ostrstream *str_ref; ... char *data;
... CALL statement: find the pointer to the actual list in main ... pgm and the pointer to the contained entry name symbol
... Function call: find the pointer to the actual list in main ... pgm, the pointer to the contained entry name sym, and the ... pointer to the symbol for the temporary variable to which the ... function value is assigned in pgm (cloning it from main pgm)
... Map the entry name symbol to the temporary name in main program
_symbol_map.ins(*entry_name_ptr,
... Find the entry point and its parameter list
... Set c to point to current statement
... Define the default number of actual and formal entries in each list
... If mismatching numbers of arguments, error
... Build iterators for argument list and parameter list
... Prepare the formal-actual mapping.
... This must be in GSA form! CALL x(<beta>(ALPHA(,input),output), ... )
... Check for reshaping, if required
... Point at formal variable and expression in main program
... If both actual and formal are arrays, then check for reshaping
... Found both are arrays.
... If the declared upper bound of the formal is a variable, ... which is also a parameter, substitute the actual expression ... for the variable.
... Increment the iterators
Definition at line 2300 of file InlineObject.cc.
References _ar_reshape, actual_arg(), add(), ALPHA_OP, AR_READWRITE, Expression::arg_list(), ARRAY_REF_OP, Expression::base_variable_ref(), CALL_STMT, Expression::clone(), compute_abstract_access(), constant(), convert_case(), Iterator< T >::current(), VariableSymbol::dim(), List< T >::entries(), Symtab::find_ref(), FLOW_ENTRY_STMT, Symbol::formal(), Expression::function(), FUNCTION_CALL_OP, ID_OP, Map< S, T >::ins(), VariableSymbol::is_array(), is_integer_zero(), StmtList::iterate_entry_points(), ArrayBounds::lower_exists(), ArrayBounds::lower_guarded(), Symbol::name_ref(), Expression::op(), Expression::parameters_guarded(), Statement::parameters_guarded(), Expression::parameters_valid(), Statement::parameters_valid(), ArrayDims::print(), Iterator< T >::reset(), Statement::rhs(), Statement::routine_guarded(), simplify(), Statement::stmt_class(), ProgramUnit::stmts(), sub(), Expression::symbol(), ProgramUnit::symtab(), ArrayBounds::upper_exists(), ArrayBounds::upper_guarded(), and Iterator< T >::valid(). |
| void InlineObject::prepare_routines_for_arg_mapping |
( |
|
) |
|
|
| Listable * InlineObject::listable_clone |
( |
|
) |
const [inline, virtual] |
|
| void InlineObject::print |
( |
ostream & |
o |
) |
const [virtual] |
|
|
|
Return a reference to the inline workspace.
Definition at line 218 of file InlineObject.h. |
|
|
Map the variables from a COMMON in a called routine to a COMMON by the same name in a calling routine.
COMMON in called routine: common_local COMMON in calling routine: common_main_ptr Calling routine: pgm_main
... There's a similar common block in main pgm, so build ... common_map and common_main_map and perform overlapping ... common block processing
... Propagate SAVE if inlining into another subprogram
... Iterate over variables in common blocks
... Calculate offset information for contained variable
... If current main pgm variable doesn't overlap the ... contained variable, look at the next main pgm variable.
... Fall out of the loop if the main pgm common block runs ... out; this case will be implemented later.
... Generate subscript expression
... Absorb ID and subscript expressions into array ... reference.
... Generate equivalent variable (eventually, attempt ... to generate an alternate expression here for ... complex mapped to real)
... Point at base variable
... Delete ID expression because it wasn't absorbed
... Generate subscript expression
... Absorb ID and subscript expressions into array ... reference.
... Make the common block variables conform to one another
... Delete main program expression
... Increment common_offset by size of variable
Definition at line 1849 of file InlineObject.cc.
References Expression::arg_list(), array_reference(), Expression::base_variable_ref(), common_offset(), Iterator< T >::current(), VariableSizes::elem_size, List< T >::grab(), id(), CommonBlock::iterator(), make_conformable(), PROGRAM_PU_TYPE, ProgramUnit::pu_class(), VariableSizes::remap(), CommonBlock::saved(), VariableSizes::size, unlinearize_array_ref(), and Iterator< T >::valid(). |
|
|
Inline expansion of program represented by the InlineObject into the main program referred to by the InlineObject at statement s + recursive added (kjackson).
recursive indicates if this is a RECURSIVE_INLINE expansion
... If first inlining, make permanent changes
... Allocate work InlineObject from saved one
... Rename branch targets
... Remap argument uses
... Translate symbol references
... Merge pgm_work into main program, adding RECURSIVE_INLINE assertions ... to appropriate statements if necessary (kjackson)
... substitute any parameters which may have been inlined
... Return insertion point ref to caller
Definition at line 3868 of file InlineObject.cc.
References _remap_arg_uses(), _remap_merge_stmts(), _rename_branch_targets(), CLEANUP_NEEDED, float_entry_points(), IGNORE_REALS, prepare_routines_for_arg_mapping(), sink_return_points(), substitute_parameters(), switch_value(), translate_symbol_refs(), and Statement::write(). |
|
|
Make a parameter (or multi-dimensional variable) conformable with a main program expression.
... Check conformability of variables
... If complex passed to real, attempt to generate an alternate ... expression which avoids use of the equivalence
... Map non-constant references from name to main_name
... TODO: Handle conformable but different sized character variables ... properly
... Remap transformable references ... VariableSymbol *main_name_ptr = NULL;
... Map references from name to a constant
... Map references from name to main_name
... Get the dimension information for each symbol
... Absorb name_lb, main_name_lb as subexpressions of ... main_name_offptr
... If subscript, adjust main_name_offptr and iterate ... subscript iterator
... Insert main_name_offptr into lambda ref
... Increment variable iterators
... Insert lambda call reference into map
... Build a subscript reference for one to many ... dimension case.
... Insert into subscript_ref
... Linearize subscript reference
... If subscript on main_name, adjust lambda_ref
... Absorb main_name_lb as subexpresion of offset
... Insert offset into lambda ref
... Insert lambda call reference into map
... Insert lambda call reference into map
... Handle non-conformable case
... Insert test expression into list for later assertion
... Test expression is either irrelevantly true or ... catastrophically false
... Clean up main expression
Definition at line 1501 of file InlineObject.cc.
References add(), Expression::arg_list(), ARRAY_REF_OP, Expression::base_variable_ref(), Expression::bound(), Expression::clone(), comma(), COMPLEX_TYPE, conformable_test(), constant(), Iterator< T >::current(), Expression::data_ref(), VariableSymbol::dim(), List< T >::entries(), gen_alternate_expr(), List< T >::grab(), initial_array_ref(), RefMap< S, T >::ins(), Map< S, T >::ins(), List< T >::ins_first(), List< T >::ins_last(), INTEGER_TYPE, LOGICAL_CONSTANT_OP, ArrayBounds::lower_ref(), make_type(), NON_CONFORMABLE, Expression::op(), REAL_TYPE, Expression::string(), sub(), Expression::subscript(), TRANSFORMABLE_ARRAY, TRANSFORMABLE_CONSTANT, TRANSFORMABLE_SUBSTRING, and TRANSFORMABLE_SUBSTRING_ARRAY.
Referenced by map_existing_common_block(). |
|
|
Translate symbol references for all statements within the subprogram.
If there is no translation to do, return to caller
Translate each statement
Definition at line 3458 of file InlineObject.cc.
References BaseMapRoot::entries(), ENTRY_STMT, INLINE_CALL, StmtList::iterator(), NO_CLEANUP_NEEDED, StmtInfo::program_ref, Statement::stmt_class(), StmtInfo::stmt_ref, ProgramUnit::stmts(), and Iterator< T >::valid().
Referenced by inline_expand(). |
Friends And Related Function Documentation
| ostream& operator<< |
( |
ostream & |
o, |
|
|
const InlineObject & |
h |
|
) |
[friend] |
|
The documentation for this class was generated from the following files:
|