Polaris: ProgramUnit Class Reference

ProgramUnit Class Reference

a class for Fortran program units More...

#include <ProgramUnit.h>

Inheritance diagram for ProgramUnit:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ProgramUnit (const char *pu_tag, PU_TYPE routine_type)
 ProgramUnit (const ProgramUnit &p)
 ProgramUnit (const char *pu_tag, const BinRep &bs)
 ProgramUnit (const char *pu_tag, const VDL &vdl_bs)
ProgramUnitoperator= (const ProgramUnit &pgm)
virtual ProgramUnitclone () const
 Return (and give control of) a new ProgramUnit which has been copied from this one.
virtual ~ProgramUnit ()
void burst_header (ostream &o) const
 Issue a page break and header information is the switch is enabled.
const char * pu_tag_ref () const
 Returns the pu_tag of the program unit (not to be confused with the routine_name).
PU_TYPE pu_class () const
 Returns the flavor of program unit.
const char * routine_name_ref () const
 Returns the name of this ProgramUnit, if there is such a name (otherwise returns an empty string [""]), collected from the Fortran source.
const char * original_file_ref () const
 Return a character pointer to the file from which this routine was obtained.
const StmtListstmts () const
StmtListstmts ()
 The Statement list.
const Symtabsymtab () const
Symtabsymtab ()
 The Symbol table.
const DataListdata () const
DataListdata ()
 The List of DATA statements.
const CommonBlockDictcommon_blocks () const
CommonBlockDictcommon_blocks ()
 The List of COMMON blocks.
const NamelistDictnamelists () const
NamelistDictnamelists ()
 The NAMELIST dictionary.
const EquivalenceDictequivalences () const
EquivalenceDictequivalences ()
 The EQIUVALENCE dictionary.
const FormatDBformats () const
FormatDBformats ()
 The FORMAT database.
PredicateRepositorypred_repos ()
 Repository for AbstractAccess predicates for this ProgramUnit.
PerformanceEstimator * perf_estimator ()
void set_perf_estimator (PerformanceEstimator *pe)
 Performance estimation data.
const WorkSpaceStackwork_stack () const
WorkSpaceStackwork_stack ()
 The stack of WorkSpaces for the ProgramUnit.
BinRepoverflow_ref () const
 Any unrecognized interchange objects.
DDgraphddgraph ()
 Outmoded. Call ddgraph_guarded() instead.
DDgraphddgraph_guarded ()
 Return a reference to the DDgraph associated with the program.
Boolean ddgraph_valid ()
 Return true if the program unit has a ddgraph.
void ddgraph (DDgraph *ddg)
 Set my DDgraph to the given object.
const DefLocMapgsa_deflocs_guarded () const
DefLocMapgsa_deflocs_guarded ()
 Return a reference to the DefLocMap associated with the program (which must be in GSA form).
const TranslateObjectgsa_names_guarded () const
TranslateObjectgsa_names_guarded ()
 Return a reference to the TranslateObject associated with the program (which must be in GSA form).
bool gsa_valid () const
 Is ProgramUnit in gsa form or not?
void gsa_deflocs (DefLocMap *new_map)
 Set my DefLocMap to the given object (or NULL).
void gsa_names (TranslateObject *new_names)
 Set my TranslateObject to the given object (or NULL).
Map< Statement, InlineObject > & inline_map_guarded ()
 Return a reference to the inline_map for this ProgramUnit.
bool inline_map_valid ()
 Does the inline_map exist?
void inline_map (Map< Statement, InlineObject > *map)
 Assign inline_map for this ProgramUnit.
RangeDictrange_dict_guarded ()
 Give access to the Range Dictionary in the ProgramUnit.
bool range_dict_valid ()
 Does the range dictionary exist?
void range_dict (RangeDict *rdict)
 Record the Range Dictionary for this ProgramUnit.
RefSet< ProgramUnit > & calls ()
RefSet< ProgramUnit > & called_by ()
void add_call (ProgramUnit &pgm)
void add_called_by (ProgramUnit &pgm)
 _
void multithread ()
void singlethread ()
void undefined_thread ()
 _ Set _multithread flag to True/False/No(initalized value)
int is_multithread () const
int is_thread_defined () const
 _ If True, this programunit has some doalls in it
Expressiondistribution_of (Symbol *sym)
 Return the corresponding DistributeExpr for sym if it is shared 'ARRAY'.
void clean_workspace (unsigned int pass_tag)
 Delete all WorkSpaces with the given pass tag from the program unit's WorkSpaceStack and all of the WorkSpaceStacks for the ProgramUnit's statements.
void clean ()
 Search through the ProgramUnit and find all symbol uses.
BinRepexchange ()
 Return a BinRep object which encapsulates the ProgramUnit in a portable format.
void display (ostream &o) const
 Display the program unit in a form which includes statement tags and other information.
void display_debug (ostream &o) const
 Display the program unit in a form which includes the symbol table and details of all the other program unit structures, useful for debugging.
virtual void print (ostream &o) const
 Satisfies the Definition requirements. Equivalent to display().
virtual int structures_OK () const
 Check the structure of the data for errors or inconsistency Return 0 and print error message if problems found, otherwise return 1 without message.
void write (ostream &o) const
 Display the program unit in FORTRAN format.
virtual Definitiondefinition_clone () const
 Copy and return a Definition.
void function_to_subroutine ()
 Convert a program unit of type FUNCTION_PU_TYPE into a program unit of type SUBROUTINE_PU_TYPE.
void subroutine_to_function ()
 Convert a program unit of type SUBROUTINE_PU_TYPE into a program unit of type FUNCTION_PU_TYPE.
void program_to_subroutine ()
 Convert a program unit of type PROGRAM_PU_TYPE into a program unit of type SUBROUTINE_PU_TYPE.

Protected Member Functions

void create_program_unit (const BinRep &bs)
void _propagate_symbol_dimensions ()
 Update the Type field of each symbol with specific dimension data.
void _propagate_types ()
 Propagate dimension information from the symbol table to every expression in the ProgramUnit.
void _propagate_types (Expression &)

Protected Attributes

PU_TYPE _routine_type
String _original_file
StmtList _statements
Symtab_symtab
DataList_data_list
DDgraph_ddgraph
CommonBlockDict_common_blocks
NamelistDict_namelists
EquivalenceDict_equivalences
FormatDB_formats
DefLocMap_gsa_deflocs
TranslateObject_gsa_names
PredicateRepository _repository
RefSet< ProgramUnit_calls
 ProgramUnits this ProgramUnit calls.
RefSet< ProgramUnit_called_by
 ProgramUnits which call this ProgramUnit.
PerformanceEstimator * _perf_estimator
Map< Statement, InlineObject > * _inline_map
RangeDict_ranges
BinRep_overflow
int _multithread
 _
WorkSpaceStack _work_stack
 Stack of WorkSpaces for this program unit.

Friends

class Program
ostream & operator<< (ostream &o, const ProgramUnit &pr)

Detailed Description

a class for Fortran program units

Base General utility routines

See also:
ProgramUnit.h

ProgramUnit.cc

ProgramUnit.h

Description

This class represents a Fortran program unit and contains all of the major structures of such an object. It also contains the statement copying/deleting/insertion routines as well as some block listing routines such as iterate_loop_body()

KNOWN/POSSIBLE BUGS/LIMITATIONS

Definition at line 70 of file ProgramUnit.h.


Constructor & Destructor Documentation

ProgramUnit::ProgramUnit const char *  pu_tag,
PU_TYPE  routine_type
 

Definition at line 176 of file ProgramUnit.cc.

References _common_blocks, _data_list, _ddgraph, _equivalences, _formats, _gsa_deflocs, _gsa_names, _inline_map, _namelists, _overflow, _perf_estimator, FormatDB::_pgm, StmtList::_pgm, _ranges, _routine_type, _statements, _symtab, BinRep::put_set(), and register_instance().

Referenced by clone().

ProgramUnit::ProgramUnit const ProgramUnit p  ) 
 

Definition at line 69 of file ProgramUnit.cc.

References _common_blocks, _data_list, _ddgraph, _equivalences, _formats, _gsa_deflocs, _gsa_names, _inline_map, _namelists, _overflow, _perf_estimator, _ranges, _symtab, and register_instance().

ProgramUnit::ProgramUnit const char *  pu_tag,
const BinRep bs
 

Definition at line 239 of file ProgramUnit.cc.

References _ddgraph, _formats, _gsa_deflocs, _gsa_names, _inline_map, _perf_estimator, FormatDB::_pgm, StmtList::_pgm, _ranges, _statements, create_program_unit(), and register_instance().

ProgramUnit::ProgramUnit const char *  pu_tag,
const VDL vdl_bs
 

Definition at line 213 of file ProgramUnit.cc.

References _ddgraph, _formats, _gsa_deflocs, _gsa_names, _inline_map, _perf_estimator, FormatDB::_pgm, StmtList::_pgm, _ranges, _statements, create_program_unit(), and register_instance().

ProgramUnit::~ProgramUnit  )  [virtual]
 

Definition at line 649 of file ProgramUnit.cc.

References _common_blocks, _data_list, _ddgraph, _equivalences, _formats, _gsa_deflocs, _gsa_names, _inline_map, _namelists, _overflow, _ranges, _symtab, and unregister_instance().


Member Function Documentation

void ProgramUnit::create_program_unit const BinRep bs  )  [protected]
 

... First, check if the BinRep contains a "messages" field which ... indicates that there were syntax errors or warnings in the the ... Fortran code. If that is the case, print out the errors.

... Now for the conversions. Most must take place in a fairly determined ... order. After each field is converted, it should be deleted from the ... dictionary so that what remains afterwards should all go into overflow.

... Get the file name.

... Get the routine type

... Do the initial conversion of the symbol table

... Don't delete the "symtab" field from dict yet--we need another ... pass on it first

... Create a temporary expression table

... (No reason to directly translate this)

... Read in the formats, if any

... Read in the namelists, if any

... Convert the statement list

... No "initial_statement" field was found. It could only then be ... a block data program unit

... Read in the equivalences, if any

... Read in the common blocks, if any

... Read in the data statements, if any

... Prepare VoidPtrDef dictionaries for fillining in the symbol table.

... Fill in the symbol table now that everything else has been ... converted. Then delete that field from dict.

... Stick everything else into overflow

... Check whether there is a PROGRAM statement or not ... If not, add one!

... The following will only find the FLOW_ENTRY_STMT because ... we proved above that there are no ENTRY_STMTs in the program unit!

... Fill in the dimension entry in the 'Type' field of a Symbol

... Propagate size and dimension information from Types found in ... VariableSymbols to all expressions.

Definition at line 264 of file ProgramUnit.cc.

References _common_blocks, _data_list, _equivalences, _formats, _namelists, _original_file, _overflow, _propagate_symbol_dimensions(), _propagate_types(), _routine_type, _statements, _symtab, BLOCK_DATA_PU_TYPE, comma(), StmtList::convert(), StmtList::create_flow_graph(), Iterator< T >::current(), KeyIterator< S, T >::current_data(), dbx_program_debug_level, BinRep::del(), Symbol::entry(), ENTRY_STMT, exprs, False, Symtab::fill_in(), Symtab::find_ref(), BinRep::find_ref(), FUNCTION_PU_TYPE, id(), Symtab::ins(), BinRep::ins(), Dictionary< T >::ins(), StmtList::ins_after(), StmtList::iterate_entry_points(), Equivalence::name_ref(), Namelist::name_ref(), CommonBlock::name_ref(), StmtList::new_tag(), PROGRAM_PU_TYPE, pu_class(), BinRep::put_set(), Symbol::renaming_suggestion(), Statement::routine(), stmts(), StmtList::stmts_of_type(), SUBROUTINE_PU_TYPE, symtab(), BinRep::to_set(), BinRep::to_string(), True, KeyIterator< S, T >::valid(), Iterator< T >::valid(), and warn_overflow_map().

Referenced by ProgramUnit().

void ProgramUnit::_propagate_symbol_dimensions  )  [protected]
 

Update the Type field of each symbol with specific dimension data.

Definition at line 630 of file ProgramUnit.cc.

References Symbol::dim(), List< T >::entries(), Type::rank_known(), Type::redimension(), Symbol::sym_class(), symtab(), True, Symbol::type(), and VARIABLE_CLASS.

Referenced by create_program_unit().

void ProgramUnit::_propagate_types  )  [protected]
 

Propagate dimension information from the symbol table to every expression in the ProgramUnit.

... Set Function symbol type to type of return expr?

Definition at line 611 of file ProgramUnit.cc.

References Statement::iterate_expressions(), propagate_expr_types(), RETURN_STMT, stmts(), and List< T >::valid().

Referenced by create_program_unit().

void ProgramUnit::_propagate_types Expression  )  [protected]
 

ProgramUnit & ProgramUnit::operator= const ProgramUnit p  ) 
 

... For now, the RangeDict must be recomputed

... ORDER DEPENDENCY: Symtab relink requires StmtList to have been copied

... _

Definition at line 95 of file ProgramUnit.cc.

References _common_blocks, _data_list, _equivalences, _formats, _gsa_deflocs, _gsa_names, _inline_map, _multithread, _namelists, _original_file, _overflow, _perf_estimator, StmtList::_pgm, FormatDB::_pgm, _ranges, _routine_type, _statements, _symtab, _work_stack, DataList::clone(), BinRep::clone(), FormatDB::clone(), EquivalenceDict::clone(), NamelistDict::clone(), CommonBlockDict::clone(), Symtab::clone(), relink_all_lptrs(), EquivalenceDict::relink_ptrs(), NamelistDict::relink_ptrs(), CommonBlockDict::relink_ptrs(), Symtab::relink_ptrs(), and DataList::relink_ptrs().

ProgramUnit * ProgramUnit::clone  )  const [virtual]
 

Return (and give control of) a new ProgramUnit which has been copied from this one.

Definition at line 165 of file ProgramUnit.cc.

References ProgramUnit().

Referenced by definition_clone(), and Predicates::Predicates().

void ProgramUnit::burst_header ostream &  o  )  const
 

Issue a page break and header information is the switch is enabled.

Definition at line 680 of file ProgramUnit.cc.

References _original_file, String::defined(), polaris_major_version, polaris_minor_version, and switch_value().

Referenced by write().

const char * ProgramUnit::pu_tag_ref  )  const
 

Returns the pu_tag of the program unit (not to be confused with the routine_name).

The pu_tag has nothing to do with the Fortran source, but is just an identifier useful in has tables, etc.

Definition at line 674 of file ProgramUnit.cc.

Referenced by clear_substituted_pu(), coalese_loop_pu(), expand_substituted_pu(), localize_goto_pu(), normalize_loop_pu(), peel_first_loop_pu(), peel_last_loop_pu(), preroll_loop_pu(), print_pu(), propagate_constants_pu(), reverse_loop_pu(), strip_horiz_loop_pu(), strip_vert_loop_pu(), substitute_parameters_pu(), unroll_loop_pu(), and write_pu().

PU_TYPE ProgramUnit::pu_class  )  const [inline]
 

Returns the flavor of program unit.

Definition at line 536 of file ProgramUnit.h.

References _routine_type.

Referenced by build_def_map(), SSAProgramUnit::convert_to_standard(), create_program_unit(), exchange(), find_main_pgm(), main(), MakeGSA_test(), InlineObject::map_existing_common_block(), and write().

const char * ProgramUnit::routine_name_ref  )  const
 

Returns the name of this ProgramUnit, if there is such a name (otherwise returns an empty string [""]), collected from the Fortran source.

I.e. if this program unit is a SUBROUTINE called "SUB1", then routine_name_ref() returns "SUB1". This information is obtained by grabbing the the first ENTRY statement in the program, if any.

Definition at line 829 of file ProgramUnit.cc.

References Iterator< T >::current(), ENTRY_STMT, Symbol::name_ref(), Statement::routine_guarded(), Statement::routine_valid(), stmts(), StmtList::stmts_of_type(), Expression::symbol(), and Iterator< T >::valid().

Referenced by EvolutionGraph::_build(), EvolutionGraph::_p_abort(), Translator::actual(), build_def_map(), build_in_out_set(), Program::compute_call_lists(), find_pgm(), main(), operator<<(), Predicates::print(), IPCPProcData::print(), GlobalDefSite::print(), IntraPCodeDomain::print(), and print_dmap().

const char * ProgramUnit::original_file_ref  )  const
 

Return a character pointer to the file from which this routine was obtained.

Definition at line 844 of file ProgramUnit.cc.

References _original_file, and String::defined().

const StmtList & ProgramUnit::stmts  )  const [inline]
 

Definition at line 416 of file ProgramUnit.h.

References _statements.

Referenced by EvolutionGraph::_add_approximations(), EvolutionGraph::_build(), _find_call_sites(), _propagate_types(), EvolutionGraph::_relax(), Translator::actual(), IPCPProcData::add_constant_set(), add_dummy_eta_assignments_after_loops(), add_dummy_global_assignments_at_calls(), IPCPProcData::add_maymods(), clean_workspace(), coalese_loop_pu(), Program::compute_call_lists(), SSAProgramUnit::convert_to_SSA(), SSAProgramUnit::convert_to_standard(), create_program_unit(), EvolutionGraph::EvolutionGraph(), exchange(), IntraPCodeDomain::expand_context_after(), IntraPCodeDomain::expand_context_before(), generate_maymods(), SSAProgramUnit::insert_phi_stmt(), main(), MakeGSA_test(), modify_dummy_eta_assignments_after_loops(), move_saved_vars(), normalize_loop_pu(), peel_first_loop_pu(), peel_last_loop_pu(), EvolutionGraph::perfect_trace_from_mu(), preroll_loop_pu(), process(), Program::read(), InlineObject::remap_arg_names(), remove_dummy_assignments(), remove_maymod_assertions(), SSAControlRangeDict::representative_stmt(), GSAControlRangeDict::representative_stmt(), reverse_loop_pu(), routine_name_ref(), split_multiple_entries(), strip_horiz_loop_pu(), strip_vert_loop_pu(), SSAFullRangeDict::touch(), GSAFullRangeDict::touch(), TranslateObject::translate_GSA_symbol_refs(), InlineObject::translate_symbol_refs(), and unroll_loop_pu().

StmtList & ProgramUnit::stmts  )  [inline]
 

The Statement list.

Definition at line 422 of file ProgramUnit.h.

References _statements.

const Symtab & ProgramUnit::symtab  )  const [inline]
 

Definition at line 428 of file ProgramUnit.h.

References _symtab.

Referenced by EvolutionGraph::_build(), _propagate_symbol_dimensions(), TranslateObject::_translate_symbol_refs_expr(), IPCPProcData::add_maymods(), already_ip_ssa(), build_def_map(), build_in_out_set(), clean(), Program::compute_call_lists(), create_program_unit(), exchange(), SSAProgramUnit::init_SSA_stack(), InitializeGSAStack(), IPCPProcData::IPCPProcData(), main(), MakeGSA_test(), EvolutionGraph::min_distance(), move_saved_vars(), SSAProgramUnit::place_phi_functions(), InlineObject::remap_arg_names(), SSAProgramUnit::rename_variables(), SSAProgramUnit::SEARCH(), SEARCH(), split_multiple_entries(), TranslateObject::translate_GSA_symbol_refs(), and TranslateObject::TranslateObject().

Symtab & ProgramUnit::symtab  )  [inline]
 

The Symbol table.

Definition at line 434 of file ProgramUnit.h.

References _symtab.

const DataList & ProgramUnit::data  )  const [inline]
 

Definition at line 440 of file ProgramUnit.h.

References _data_list.

Referenced by exchange(), and move_saved_vars().

DataList & ProgramUnit::data  )  [inline]
 

The List of DATA statements.

Definition at line 446 of file ProgramUnit.h.

References _data_list.

const CommonBlockDict & ProgramUnit::common_blocks  )  const [inline]
 

Definition at line 452 of file ProgramUnit.h.

References _common_blocks.

Referenced by exchange(), and move_saved_vars().

CommonBlockDict & ProgramUnit::common_blocks  )  [inline]
 

The List of COMMON blocks.

Definition at line 458 of file ProgramUnit.h.

References _common_blocks.

const NamelistDict & ProgramUnit::namelists  )  const [inline]
 

Definition at line 464 of file ProgramUnit.h.

References _namelists.

Referenced by exchange().

NamelistDict & ProgramUnit::namelists  )  [inline]
 

The NAMELIST dictionary.

Definition at line 470 of file ProgramUnit.h.

References _namelists.

const EquivalenceDict & ProgramUnit::equivalences  )  const [inline]
 

Definition at line 476 of file ProgramUnit.h.

References _equivalences.

Referenced by clean(), exchange(), and move_saved_vars().

EquivalenceDict & ProgramUnit::equivalences  )  [inline]
 

The EQIUVALENCE dictionary.

Definition at line 482 of file ProgramUnit.h.

References _equivalences.

const FormatDB & ProgramUnit::formats  )  const [inline]
 

Definition at line 506 of file ProgramUnit.h.

References _formats.

Referenced by exchange(), and TranslateObject::TranslateObject().

FormatDB & ProgramUnit::formats  )  [inline]
 

The FORMAT database.

Definition at line 512 of file ProgramUnit.h.

References _formats.

PredicateRepository & ProgramUnit::pred_repos  )  [inline]
 

Repository for AbstractAccess predicates for this ProgramUnit.

Definition at line 488 of file ProgramUnit.h.

References _repository.

Referenced by AbstractAccess::exec_predicate_false(), AbstractAccess::exec_predicate_true(), Directive::generate_csrd_dep_overlap_directive(), Directive::generate_csrd_dep_ROvsRW_directive(), Directive::generate_csrd_dep_RWvsWF_directive(), Directive::generate_csrd_dep_WFvsRO_directive(), Directive::generate_csrd_overlap_directive(), Directive::generate_csrd_overlap_sort_directive(), Directive::generate_csrd_private_descr_directive(), Directive::generate_csrd_reduct_descr_directive(), Directive::generate_csrd_test_monotone_directive(), AbstractAccess::print(), AbstractAccess::remap_interface_vars(), and simplify_descriptors().

PerformanceEstimator * ProgramUnit::perf_estimator  )  [inline]
 

Definition at line 494 of file ProgramUnit.h.

References _perf_estimator.

void ProgramUnit::set_perf_estimator PerformanceEstimator *  pe  )  [inline]
 

Performance estimation data.

Definition at line 499 of file ProgramUnit.h.

References _perf_estimator.

const WorkSpaceStack & ProgramUnit::work_stack  )  const [inline]
 

Definition at line 518 of file ProgramUnit.h.

References _work_stack.

Referenced by clean_workspace().

WorkSpaceStack & ProgramUnit::work_stack  )  [inline]
 

The stack of WorkSpaces for the ProgramUnit.

Definition at line 524 of file ProgramUnit.h.

References _work_stack.

BinRep * ProgramUnit::overflow_ref  )  const [inline]
 

Any unrecognized interchange objects.

Definition at line 530 of file ProgramUnit.h.

References _overflow.

DDgraph & ProgramUnit::ddgraph  )  [inline]
 

Outmoded. Call ddgraph_guarded() instead.

Definition at line 323 of file ProgramUnit.h.

References _ddgraph.

DDgraph & ProgramUnit::ddgraph_guarded  )  [inline]
 

Return a reference to the DDgraph associated with the program.

Definition at line 330 of file ProgramUnit.h.

References _ddgraph.

Boolean ProgramUnit::ddgraph_valid  )  [inline]
 

Return true if the program unit has a ddgraph.

Definition at line 337 of file ProgramUnit.h.

References _ddgraph.

void ProgramUnit::ddgraph DDgraph ddg  ) 
 

Set my DDgraph to the given object.

Definition at line 1135 of file ProgramUnit.cc.

References _ddgraph.

const DefLocMap & ProgramUnit::gsa_deflocs_guarded  )  const [inline]
 

Definition at line 353 of file ProgramUnit.h.

References _gsa_deflocs.

Referenced by EvolutionGraph::_relax(), GSAFullRangeDict::data_touch(), get_gates_from_trace(), get_preds_from_trace(), EvolutionGraph::get_trace_details(), GSAControlRangeDict::stats(), GSAControlRangeDict::touch(), and trace_defs().

DefLocMap & ProgramUnit::gsa_deflocs_guarded  )  [inline]
 

Return a reference to the DefLocMap associated with the program (which must be in GSA form).

Definition at line 359 of file ProgramUnit.h.

References _gsa_deflocs.

const TranslateObject & ProgramUnit::gsa_names_guarded  )  const [inline]
 

Definition at line 365 of file ProgramUnit.h.

References _gsa_names.

TranslateObject & ProgramUnit::gsa_names_guarded  )  [inline]
 

Return a reference to the TranslateObject associated with the program (which must be in GSA form).

Definition at line 371 of file ProgramUnit.h.

References _gsa_names.

bool ProgramUnit::gsa_valid  )  const [inline]
 

Is ProgramUnit in gsa form or not?

Definition at line 343 of file ProgramUnit.h.

References _gsa_deflocs, and _gsa_names.

void ProgramUnit::gsa_deflocs DefLocMap new_map  ) 
 

Set my DefLocMap to the given object (or NULL).

Definition at line 1144 of file ProgramUnit.cc.

References _gsa_deflocs.

void ProgramUnit::gsa_names TranslateObject new_names  ) 
 

Set my TranslateObject to the given object (or NULL).

Definition at line 1151 of file ProgramUnit.cc.

References _gsa_names.

Map< Statement, InlineObject > & ProgramUnit::inline_map_guarded  )  [inline]
 

Return a reference to the inline_map for this ProgramUnit.

Definition at line 398 of file ProgramUnit.h.

References _inline_map.

bool ProgramUnit::inline_map_valid  )  [inline]
 

Does the inline_map exist?

Definition at line 410 of file ProgramUnit.h.

References _inline_map.

void ProgramUnit::inline_map Map< Statement, InlineObject > *  map  )  [inline]
 

Assign inline_map for this ProgramUnit.

Definition at line 404 of file ProgramUnit.h.

References _inline_map.

RangeDict & ProgramUnit::range_dict_guarded  )  [inline]
 

Give access to the Range Dictionary in the ProgramUnit.

Definition at line 377 of file ProgramUnit.h.

References _ranges.

Referenced by EvolutionGraph::_relax(), ar_intersect(), ar_subregion(), ar_subtract(), AbstractAccess::calc_overlap(), AbstractAccess::check_sort(), AbstractAccess::coalesce(), EvolutionGraph::EvolutionGraph(), intersect_ARDs(), EvolutionGraph::perfect_trace_from_mu(), and AbstractAccess::remap_interface_vars().

bool ProgramUnit::range_dict_valid  )  [inline]
 

Does the range dictionary exist?

Definition at line 392 of file ProgramUnit.h.

References _ranges.

Referenced by EvolutionGraph::EvolutionGraph().

void ProgramUnit::range_dict RangeDict rdict  )  [inline]
 

Record the Range Dictionary for this ProgramUnit.

Definition at line 383 of file ProgramUnit.h.

References _ranges.

Referenced by EvolutionGraph::EvolutionGraph().

RefSet< ProgramUnit > & ProgramUnit::calls  )  [inline]
 

Definition at line 574 of file ProgramUnit.h.

References _calls.

Referenced by _build_call_diamond(), and Program::compute_call_lists().

RefSet< ProgramUnit > & ProgramUnit::called_by  )  [inline]
 

Definition at line 580 of file ProgramUnit.h.

References _called_by.

Referenced by _build_call_diamond(), build_in_out_sets(), and Program::compute_call_lists().

void ProgramUnit::add_call ProgramUnit pgm  )  [inline]
 

Definition at line 586 of file ProgramUnit.h.

References _calls, and RefSet< T >::ins().

Referenced by Program::compute_call_lists().

void ProgramUnit::add_called_by ProgramUnit pgm  )  [inline]
 

_

Definition at line 592 of file ProgramUnit.h.

References _called_by, and RefSet< T >::ins().

Referenced by Program::compute_call_lists().

void ProgramUnit::multithread  )  [inline]
 

Definition at line 556 of file ProgramUnit.h.

References _multithread.

void ProgramUnit::singlethread  )  [inline]
 

Definition at line 568 of file ProgramUnit.h.

References _multithread.

void ProgramUnit::undefined_thread  )  [inline]
 

_ Set _multithread flag to True/False/No(initalized value)

Definition at line 562 of file ProgramUnit.h.

References _multithread.

int ProgramUnit::is_multithread  )  const [inline]
 

Definition at line 544 of file ProgramUnit.h.

References _multithread.

int ProgramUnit::is_thread_defined  )  const [inline]
 

_ If True, this programunit has some doalls in it

_ If False, it has not or may have doalls.(Conservative)

Definition at line 550 of file ProgramUnit.h.

References _multithread.

Expression * ProgramUnit::distribution_of Symbol sym  ) 
 

Return the corresponding DistributeExpr for sym if it is shared 'ARRAY'.

Return 0 either if it is scalar or if it is private array

Definition at line 1186 of file ProgramUnit.cc.

References _statements, Assertion::arg_list_guarded(), AS_SHARED, Statement::assertions(), Iterator< T >::current(), DISTRIBUTE_OP, StmtList::first(), Assertion::type(), List< T >::valid(), Iterator< T >::valid(), and VARIABLE_CLASS.

void ProgramUnit::clean_workspace unsigned int  pass_tag  ) 
 

Delete all WorkSpaces with the given pass tag from the program unit's WorkSpaceStack and all of the WorkSpaceStacks for the ProgramUnit's statements.

Definition at line 850 of file ProgramUnit.cc.

References Iterator< T >::current(), StmtList::iterator(), WorkSpaceStack::pop(), stmts(), Iterator< T >::valid(), Statement::work_stack(), and work_stack().

Referenced by SSAProgramUnit::convert_to_SSA(), main(), and MakeGSA_test().

void ProgramUnit::clean  ) 
 

Search through the ProgramUnit and find all symbol uses.

Remove any symbols from the Symtab that are not found.

Definition at line 904 of file ProgramUnit.cc.

References Assertion::arg_list_guarded(), Assertion::arg_list_valid(), Statement::assertions(), EquivalenceDict::clean(), Symbol::clear_common(), Symbol::clear_equivalence(), collect_all_symbols(), collect_symb_const(), Symbol::common_ref(), constant(), Symtab::del(), Symbol::dim(), e, eq(), Symbol::equivalence_ref(), equivalences(), Symbol::expr_ref(), Symbol::is_array(), Statement::iterate_expressions(), Statement::s_control_guarded(), Statement::s_control_valid(), symtab(), RefSet< T >::valid(), and List< T >::valid().

Referenced by Program::clean(), and SSAProgramUnit::convert_to_standard().

BinRep * ProgramUnit::exchange  ) 
 

Return a BinRep object which encapsulates the ProgramUnit in a portable format.

Definition at line 1086 of file ProgramUnit.cc.

References _original_file, _overflow, common_blocks(), data(), VDL::data_ref(), String::defined(), VDL::end_object(), VDL::end_set(), equivalences(), StmtList::exchange_convert(), NamelistDict::exchange_convert(), FormatDB::exchange_convert(), DataList::exchange_convert(), EquivalenceDict::exchange_convert(), CommonBlockDict::exchange_convert(), Symtab::exchange_convert(), formats(), VDL::give_up_data(), Set< T >::ins(), List< T >::ins_last(), namelists(), pu_class(), routine_type_names, VDL::start_object(), VDL::start_set(), stmts(), symtab(), and BinRep::to_set().

Referenced by retrieve_pu().

void ProgramUnit::display ostream &  o  )  const
 

Display the program unit in a form which includes statement tags and other information.

To print a program unit in a correct Fortran format, use 'write(...)' instead.

Definition at line 706 of file ProgramUnit.cc.

References _common_blocks, _data_list, _equivalences, _formats, _namelists, _original_file, _statements, _symtab, String::defined(), StmtList::display(), FormatDB::write(), NamelistDict::write(), DataList::write(), EquivalenceDict::write(), CommonBlockDict::write(), and Symtab::write().

Referenced by display_debug(), main(), and print().

void ProgramUnit::display_debug ostream &  o  )  const
 

Display the program unit in a form which includes the symbol table and details of all the other program unit structures, useful for debugging.

To print a program in a more readable FORTRAN format, use 'display(...)' or 'write(...)' instead.

Definition at line 759 of file ProgramUnit.cc.

References _common_blocks, _data_list, _equivalences, _formats, _namelists, _overflow, _routine_type, _symtab, display(), and NUM_PU_TYPES.

Referenced by main(), and process().

void ProgramUnit::print ostream &  o  )  const [virtual]
 

Satisfies the Definition requirements. Equivalent to display().

Implements Definition.

Reimplemented in SSAProgramUnit.

Definition at line 801 of file ProgramUnit.cc.

References display().

Referenced by main(), operator<<(), SSAProgramUnit::print(), Program::print(), and print_pu().

int ProgramUnit::structures_OK void   )  const [virtual]
 

Check the structure of the data for errors or inconsistency Return 0 and print error message if problems found, otherwise return 1 without message.

... xxx || ! _symtab->structures_OK() ... xxx || ! _data->structures_OK()

... xxx || ! _formats->_structures_OK() ... xxx || ! (_overflow == 0 || _overflow->_structures_OK())

Implements Definition.

Definition at line 807 of file ProgramUnit.cc.

References _common_blocks, _equivalences, _namelists, _statements, EquivalenceDict::structures_OK(), NamelistDict::structures_OK(), CommonBlockDict::structures_OK(), and StmtList::structures_OK().

Referenced by process().

void ProgramUnit::write ostream &  o  )  const
 

Display the program unit in FORTRAN format.

... entries.current() is the first entry statement

Reimplemented in SSAProgramUnit.

Definition at line 726 of file ProgramUnit.cc.

References _common_blocks, _data_list, _equivalences, _formats, _namelists, _statements, _symtab, blank_wide_output(), BLOCK_DATA_PU_TYPE, burst_header(), Iterator< T >::current(), ENTRY_STMT, pu_class(), routine_type_names, StmtList::stmts_of_type(), Iterator< T >::valid(), FormatDB::write(), StmtList::write(), NamelistDict::write(), DataList::write(), EquivalenceDict::write(), CommonBlockDict::write(), Symtab::write(), and Statement::write().

Referenced by generate_maymods(), main(), process(), SSAProgramUnit::write(), Program::write(), and write_pu().

Definition * ProgramUnit::definition_clone  )  const [virtual]
 

Copy and return a Definition.

Implements Definition.

Definition at line 171 of file ProgramUnit.cc.

References clone().

void ProgramUnit::function_to_subroutine  ) 
 

Convert a program unit of type FUNCTION_PU_TYPE into a program unit of type SUBROUTINE_PU_TYPE.

This does NOT make any changes to the structure of the program unit, only to _routine_type.

Definition at line 1158 of file ProgramUnit.cc.

References _routine_type, FUNCTION_PU_TYPE, and SUBROUTINE_PU_TYPE.

void ProgramUnit::subroutine_to_function  ) 
 

Convert a program unit of type SUBROUTINE_PU_TYPE into a program unit of type FUNCTION_PU_TYPE.

This does NOT make any changes to the structure of the program unit, only to _routine_type.

Definition at line 1167 of file ProgramUnit.cc.

References _routine_type, FUNCTION_PU_TYPE, and SUBROUTINE_PU_TYPE.

void ProgramUnit::program_to_subroutine  ) 
 

Convert a program unit of type PROGRAM_PU_TYPE into a program unit of type SUBROUTINE_PU_TYPE.

This does NOT make any changes to the structure of the program unit, only to _routine_type.

Definition at line 1176 of file ProgramUnit.cc.

References _routine_type, PROGRAM_PU_TYPE, and SUBROUTINE_PU_TYPE.


Friends And Related Function Documentation

friend class Program [friend]
 

Definition at line 71 of file ProgramUnit.h.

ostream& operator<< ostream &  o,
const ProgramUnit pr
[friend]
 

Definition at line 794 of file ProgramUnit.cc.


Member Data Documentation

PU_TYPE ProgramUnit::_routine_type [protected]
 

Definition at line 74 of file ProgramUnit.h.

Referenced by create_program_unit(), display_debug(), function_to_subroutine(), operator=(), program_to_subroutine(), ProgramUnit(), pu_class(), and subroutine_to_function().

String ProgramUnit::_original_file [protected]
 

Definition at line 75 of file ProgramUnit.h.

Referenced by burst_header(), create_program_unit(), display(), exchange(), operator=(), and original_file_ref().

StmtList ProgramUnit::_statements [protected]
 

Definition at line 76 of file ProgramUnit.h.

Referenced by create_program_unit(), display(), distribution_of(), operator=(), ProgramUnit(), stmts(), structures_OK(), and write().

Symtab* ProgramUnit::_symtab [protected]
 

Definition at line 77 of file ProgramUnit.h.

Referenced by create_program_unit(), display(), display_debug(), operator=(), ProgramUnit(), symtab(), write(), and ~ProgramUnit().

DataList* ProgramUnit::_data_list [protected]
 

Definition at line 78 of file ProgramUnit.h.

Referenced by create_program_unit(), data(), display(), display_debug(), operator=(), ProgramUnit(), write(), and ~ProgramUnit().

DDgraph* ProgramUnit::_ddgraph [protected]
 

Definition at line 79 of file ProgramUnit.h.

Referenced by ddgraph(), ddgraph_guarded(), ddgraph_valid(), ProgramUnit(), and ~ProgramUnit().

CommonBlockDict* ProgramUnit::_common_blocks [protected]
 

Definition at line 80 of file ProgramUnit.h.

Referenced by common_blocks(), create_program_unit(), display(), display_debug(), operator=(), ProgramUnit(), structures_OK(), write(), and ~ProgramUnit().

NamelistDict* ProgramUnit::_namelists [protected]
 

Definition at line 81 of file ProgramUnit.h.

Referenced by create_program_unit(), display(), display_debug(), namelists(), operator=(), ProgramUnit(), structures_OK(), write(), and ~ProgramUnit().

EquivalenceDict* ProgramUnit::_equivalences [protected]
 

Definition at line 82 of file ProgramUnit.h.

Referenced by create_program_unit(), display(), display_debug(), equivalences(), operator=(), ProgramUnit(), structures_OK(), write(), and ~ProgramUnit().

FormatDB* ProgramUnit::_formats [protected]
 

Definition at line 83 of file ProgramUnit.h.

Referenced by create_program_unit(), display(), display_debug(), formats(), operator=(), ProgramUnit(), write(), and ~ProgramUnit().

DefLocMap* ProgramUnit::_gsa_deflocs [protected]
 

Definition at line 84 of file ProgramUnit.h.

Referenced by gsa_deflocs(), gsa_deflocs_guarded(), gsa_valid(), operator=(), ProgramUnit(), and ~ProgramUnit().

TranslateObject* ProgramUnit::_gsa_names [protected]
 

Definition at line 85 of file ProgramUnit.h.

Referenced by gsa_names(), gsa_names_guarded(), gsa_valid(), operator=(), ProgramUnit(), and ~ProgramUnit().

PredicateRepository ProgramUnit::_repository [protected]
 

Definition at line 86 of file ProgramUnit.h.

Referenced by pred_repos().

RefSet<ProgramUnit> ProgramUnit::_calls [protected]
 

ProgramUnits this ProgramUnit calls.

Definition at line 88 of file ProgramUnit.h.

Referenced by add_call(), and calls().

RefSet<ProgramUnit> ProgramUnit::_called_by [protected]
 

ProgramUnits which call this ProgramUnit.

Definition at line 89 of file ProgramUnit.h.

Referenced by add_called_by(), and called_by().

PerformanceEstimator* ProgramUnit::_perf_estimator [protected]
 

Definition at line 92 of file ProgramUnit.h.

Referenced by operator=(), perf_estimator(), ProgramUnit(), and set_perf_estimator().

Map<Statement,InlineObject>* ProgramUnit::_inline_map [protected]
 

Definition at line 95 of file ProgramUnit.h.

Referenced by inline_map(), inline_map_guarded(), inline_map_valid(), operator=(), ProgramUnit(), and ~ProgramUnit().

RangeDict* ProgramUnit::_ranges [protected]
 

Definition at line 97 of file ProgramUnit.h.

Referenced by operator=(), ProgramUnit(), range_dict(), range_dict_guarded(), range_dict_valid(), and ~ProgramUnit().

BinRep* ProgramUnit::_overflow [protected]
 

Definition at line 98 of file ProgramUnit.h.

Referenced by create_program_unit(), display_debug(), exchange(), operator=(), overflow_ref(), ProgramUnit(), and ~ProgramUnit().

int ProgramUnit::_multithread [protected]
 

_

Definition at line 99 of file ProgramUnit.h.

Referenced by is_multithread(), is_thread_defined(), multithread(), operator=(), singlethread(), and undefined_thread().

WorkSpaceStack ProgramUnit::_work_stack [protected]
 

Stack of WorkSpaces for this program unit.

Definition at line 101 of file ProgramUnit.h.

Referenced by operator=(), and work_stack().


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:56 2005