Polaris: Symbol Class Reference

Symbol Class Reference

An abstract class to represent Fortran symbols (identifiers). More...

#include <Symbol.h>

Inheritance diagram for Symbol:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Symbol (const char *name, SYMBOL_CLASS cl)
 Constructor -- requires Symbol name and a SYMBOL_CLASS Note: class Symbol is abstract, so you cannot create an object of type Symbol.
virtual Symbolclone () const =0
 Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.
virtual Symbolclone_all () const =0
 Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.
Definitiondefinition_clone () const
 Clone constructor which returns a Definition* rather than a Symbol* by calling clone().
virtual ~Symbol ()
 Destructor.
virtual void print (ostream &o) const =0
 Print onto stream 'o'.
SYMBOL_CLASS sym_class () const
 Return the type of this Symbol.
const char * name_ref () const
 Return the Symbol name.
void name (const char *new_name)
 Change the Symbol name (such a change would be reflected in everything else in the Program which points to this Symbol).
BinRepoverflow_ref () const
virtual void fill_in (const BinRep &binstr, ExprTable &exprs, const Dictionary< VoidPtrDef > &stmts, const Dictionary< VoidPtrDef > &commons, const Dictionary< VoidPtrDef > &equivalences)=0
 None of the following methods are valid (they give error messages) in a derived class unless they are specifically overridden in that class.
virtual INITIAL_BOOL initial_value () const
virtual void initial_value (INITIAL_BOOL ourbool)
virtual EXTERNAL_BOOL external () const
virtual void external (EXTERNAL_BOOL ourbool)
virtual INTRINSIC_BOOL intrinsic () const
virtual void intrinsic (INTRINSIC_BOOL ourbool)
virtual const Statemententry_ref () const
virtual Statemententry_ref ()
virtual void entry (Statement *s)
virtual const Typetype () const
 Returns the type of the symbol, or else returns type VOID_TYPE if the symbol does not use a type (such as a SubroutineSymbol).
virtual void type (const Type &type)
virtual Equivalenceequivalence_ref () const
virtual void equivalence (Equivalence &e, int byte_base)
virtual void clear_equivalence ()
virtual void shared_expr (Expression *shared)
 'shared' must be an expression whose 'symbol' is this itself
virtual void set_to_private ()
 this symbol turns back to be a private by resetting _shared_expr to 0
virtual Expressionshared_expr () const
 _ If thie is VariableSymbol and shared data object, it returns to the _ pointer to its correspoding distribution expression
virtual const ArrayDimsdim () const
virtual ArrayDimsdim ()
virtual const SharedDimsshared_dim () const
virtual SharedDimsshared_dim ()
virtual FORMAL_BOOL formal () const
virtual void formal (FORMAL_BOOL ourbool)
virtual ALLOC_BOOL allocatable () const
virtual void allocatable (ALLOC_BOOL ourbool)
virtual GLOBAL_BOOL global () const
virtual void global (GLOBAL_BOOL ourbool)
virtual SAVED_BOOL saved () const
virtual void saved (SAVED_BOOL ourbool)
virtual const CommonBlockcommon_ref () const
virtual CommonBlockcommon_ref ()
virtual void common (CommonBlock &cb, int index)
 Insert this variable into common block cb at position index (0 = first element).
virtual void clear_common ()
 Remove this variable from a common block if it is in one.
virtual const Expressionexpr_ref () const
virtual Expressionexpr_ref ()
virtual void expr (Expression *e)
virtual int is_entry ()
virtual int is_scalar () const
virtual int is_array () const
virtual int is_shared () const
virtual int is_pointer () const
virtual const Symbolassoc_variable () const
virtual Symbolassoc_variable ()
virtual int size () const
 Return the size in bytes of the memory refered to by the symbol.
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.
virtual void exchange_convert (VDL &vdl)
 Convert the Symbol into the exchange format.
void renaming_suggestion (String &new_name)
 Given that some other symbol with the same name as this symbol needs to be inserted into the same symbol table, give a new name suggestion for the other symbol.

Protected Member Functions

void _ref_error (const char *func_name) const
int _get_size (const BinRep &insp, const BinRep &binstr_context) const
virtual void _dims (ArrayDims *)

Protected Attributes

SYMBOL_CLASS _sym_class
BinRep_overflow
int _last_renaming_append
 _last_renaming_append is an integer which caches the last appended integer which was added to a name of this base to avoid naming conflicts in the symbol table

Friends

class Symtab
class PostPass
ostream & operator<< (ostream &o, const Symbol &other)

Detailed Description

An abstract class to represent Fortran symbols (identifiers).

Polaris C++ VDL

See also:
Symbol.h

Symbol.h

Symbol.cc

Description

The abstract class Symbol represents a Fortran symbol in the C++ VDL symbol table. Since this class is abstract, all of the real work is done by inherited classes. This class sets up all possible methods for inherited classes and either defines default values for them or defines default errors for accessing them (for these, they are valid only if a derived classes inherits them, since not all possible fields are for all class types.

The reason for the structure of this class and its subclasses is that it was intended for Symtab to contain a list of pointers to the base class Symbol. Thus the Symtab list may contain pointers actually to any derived class of Symbol. All possible methods are supported by Symbol, thus no typecasting is necessary. However, the sym_class() method needs to be checked before accessing these methods, since some of them will give error messages for the inherited classes that do not support them.

Note: Although the source for all derived classes are in separate files, they are related enough that their header files are all included from this file and their methods are all contained in the single source file Symbol.cc

Definition at line 118 of file Symbol.h.


Constructor & Destructor Documentation

Symbol::Symbol const char *  name,
SYMBOL_CLASS  cl
[inline]
 

Constructor -- requires Symbol name and a SYMBOL_CLASS Note: class Symbol is abstract, so you cannot create an object of type Symbol.

Create one of the derived classes instead, or, if you are trying to copy a current symbol, consider the clone() method.

Definition at line 311 of file Symbol.h.

References _last_renaming_append, _overflow, _sym_class, name(), register_instance(), Definition::rename(), and upcase_ch().

Symbol::~Symbol  )  [virtual]
 

Destructor.

Definition at line 247 of file Symbol.cc.

References _overflow, and unregister_instance().


Member Function Documentation

void Symbol::_ref_error const char *  func_name  )  const [protected]
 

Definition at line 227 of file Symbol.cc.

References _sym_class, BLOCK_DATA_CLASS, and class_name.

Referenced by clear_common(), clear_equivalence(), dim(), and shared_dim().

int Symbol::_get_size const BinRep insp,
const BinRep binstr_context
const [protected]
 

... Pull the size out of this binstr insp -- it should already be ... positioned on the size itself (not the ["size", ...] tuple). ... If it is too large, cause an error and print a message. ... The binstr_context is simply the context of the entire binstr so ... that it may be printed out in case of an error to track down where the ... offending size was

Definition at line 199 of file Symbol.cc.

References size().

void Symbol::_dims ArrayDims  )  [protected, virtual]
 

Reimplemented in VariableSymbol.

Definition at line 289 of file Symbol.cc.

virtual Symbol* Symbol::clone  )  const [pure virtual]
 

Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.

Implemented in BlockDataSymbol, FunctionSymbol, NamelistSymbol, PointerSymbol, ProgramSymbol, SubroutineSymbol, SymbolicConstantSymbol, and VariableSymbol.

Referenced by _update_assign_succs(), coalese_loop(), definition_clone(), get_translated_evolution(), SSAProgramUnit::init_SSA_stack(), SSAProgramUnit::place_phi_functions(), precalc_loop(), SymbolAccessMap::remap_interface_vars(), SSAProgramUnit::rename_variables(), SSAProgramUnit::SEARCH(), stripmine_horiz_loop(), stripmine_vert_loop(), and trace_into_called_pgm().

virtual Symbol* Symbol::clone_all  )  const [pure virtual]
 

Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.

Implemented in BlockDataSymbol, FunctionSymbol, NamelistSymbol, PointerSymbol, ProgramSymbol, SubroutineSymbol, SymbolicConstantSymbol, and VariableSymbol.

Referenced by move_saved_vars().

Definition * Symbol::definition_clone  )  const [virtual]
 

Clone constructor which returns a Definition* rather than a Symbol* by calling clone().

Implements Definition.

Definition at line 302 of file Symbol.cc.

References clone().

virtual void Symbol::print ostream &  o  )  const [pure virtual]
 

Print onto stream 'o'.

Implements Definition.

Implemented in BlockDataSymbol, FunctionSymbol, NamelistSymbol, PointerSymbol, ProgramSymbol, SubroutineSymbol, SymbolicConstantSymbol, and VariableSymbol.

Referenced by operator<<().

SYMBOL_CLASS Symbol::sym_class  )  const [inline]
 

Return the type of this Symbol.

Definition at line 336 of file Symbol.h.

References _sym_class.

Referenced by _collect_candidates(), _filter_vars(), _init_non_local_vars(), _loop_index_last_val(), _make_nonlocals_modified_at_calls(), ProgramUnit::_propagate_symbol_dimensions(), _refs_are_candidates(), clean_variables(), collect_all_symbols(), compute_abstract_access(), Program::compute_call_lists(), conformable_test(), DFS_S(), EntryStmt::fortran_write(), SSAProgramUnit::init_variable_set(), InitializeGSAStack(), is_array_symbol(), is_scalar_var(), last_gsa_symbol(), make_afi_node(), move_saved_vars(), parse_function_symbol(), parse_symbol(), propagate_outermost_DOs(), SymbolAccessMap::remap_interface_vars(), Symtab::rename_and_ins(), SSAProgramUnit::rename_variables(), SEARCH(), substitute_parameters(), trans_update_expr(), Variable_set_new(), and SymbolAccessMap::write().

const char * Symbol::name_ref  )  const [inline]
 

Return the Symbol name.

Definition at line 342 of file Symbol.h.

Referenced by IntrinsicCallExpr::_combine_top(), _delete_dead_code(), IntrinsicCallExpr::_fold_top(), _monotonicity_for_var(), _print(), _print_range_map(), _print_var_map(), _print_var_set(), _pull_ranges_out(), IPCPProcData::add_maymods(), already_ip_ssa(), build_def_map(), build_in_out_set(), clean_variables(), cleanup_program(), Program::compute_call_lists(), DefLocMap::DefLocMap(), DFS_S(), dir_format_name(), Program::entry_points(), NamelistSymbol::exchange_convert(), BlockDataSymbol::exchange_convert(), SymbolicConstantSymbol::exchange_convert(), VariableSymbol::exchange_convert(), SubroutineSymbol::exchange_convert(), FunctionSymbol::exchange_convert(), ProgramSymbol::exchange_convert(), exchange_convert(), NamelistDict::exchange_convert(), EquivalenceDict::exchange_convert(), CommonBlockDict::exchange_convert(), find_preds(), 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(), Directive::generate_omp_do_directive(), Directive::generate_omp_parallel_directive(), Directive::generate_sgi_parallel_directive(), has_known_iteration_space(), SSAProgramUnit::init_SSA_stack(), InitializeGSAStack(), IPCPProcData::IPCPProcData(), is_abs(), is_affine(), is_max(), is_min(), is_min_or_max(), is_mod(), is_pseudo_function(), last_gsa_symbol(), make_afi_node(), move_saved_vars(), IDExpr::node_compare(), node_name(), optimize_ssa_beta(), optimize_ssa_eta(), optimize_ssa_gamma(), optimize_ssa_mu(), optimize_ssa_zero(), parse_expr(), SSAProgramUnit::place_phi_functions(), RangeAccessor::pretty_print(), PointerSymbol::print(), SSAFullRangeDict::print(), SSAFullRangeData::print(), SSAControlRangeData::print(), RangeAccessor::print(), Namelist::print(), ReturnJumpFunction::print(), IPCPProcData::print(), GSAFullRangeDict::print(), GSAFullRangeData::print(), GSAControlRangeData::print(), EquivalenceMember::print(), DefLocMap::print(), ControlRangeDict::print(), CommonBlock::print(), BaseStmtRanges::print(), AbstractAccess::print(), IPCPConstants::print_constants(), IDExpr::print_debug(), print_dmap(), print_gmap(), print_in_out_sets(), propagate_outermost_DOs(), PointerSymbol::relink_dptrs(), VariableSymbol::relink_dptrs(), DistributeExpr::relink_eptrs(), IDExpr::relink_eptrs(), EquivalenceMember::relink_lptrs(), InlineObject::remap_arg_names(), remove_assigned_goto_stmts(), rename_variable_to_match(), ProgramUnit::routine_name_ref(), SSAProgramUnit::SEARCH(), SEARCH(), sort_sym_list(), split_multiple_entries(), Expression::standardize(), test_expr_str(), translate_common_var(), TranslateObject::TranslateObject(), SymbolAccessRefMap::write(), SymbolAccessMap::write(), NamelistDict::write(), Equivalence::write(), and CommonBlockDict::write().

void Symbol::name const char *  new_name  )  [inline]
 

Change the Symbol name (such a change would be reflected in everything else in the Program which points to this Symbol).

Definition at line 348 of file Symbol.h.

References upcase_ch().

Referenced by SSAProgramUnit::init_SSA_stack(), is_affine(), rename_variable_to_match(), SSAProgramUnit::SEARCH(), and Symbol().

BinRep * Symbol::overflow_ref  )  const [inline]
 

Definition at line 330 of file Symbol.h.

References _overflow.

virtual void Symbol::fill_in const BinRep binstr,
ExprTable exprs,
const Dictionary< VoidPtrDef > &  stmts,
const Dictionary< VoidPtrDef > &  commons,
const Dictionary< VoidPtrDef > &  equivalences
[pure virtual]
 

None of the following methods are valid (they give error messages) in a derived class unless they are specifically overridden in that class.

There is ONE exception to this rule: The type() method returns a VOID type if there is no type associated with the Symbol subclass (e.g. ProgramSymbol::type() always returns a void Type, so that ProgramSymbol::type().is_void() always returns 1)

Implemented in BlockDataSymbol, FunctionSymbol, NamelistSymbol, PointerSymbol, ProgramSymbol, SubroutineSymbol, SymbolicConstantSymbol, and VariableSymbol.

INITIAL_BOOL Symbol::initial_value  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 440 of file Symbol.cc.

References NOT_INITIALIZED.

Referenced by mark_initialized(), and move_saved_vars().

virtual void Symbol::initial_value INITIAL_BOOL  ourbool  )  [virtual]
 

Reimplemented in VariableSymbol.

EXTERNAL_BOOL Symbol::external  )  const [virtual]
 

Reimplemented in FunctionSymbol, and SubroutineSymbol.

Definition at line 310 of file Symbol.cc.

References NOT_EXTERNAL.

Referenced by Program::compute_call_lists(), exchange_convert(), InitializeGSAStack(), and SEARCH().

virtual void Symbol::external EXTERNAL_BOOL  ourbool  )  [virtual]
 

Reimplemented in FunctionSymbol, and SubroutineSymbol.

INTRINSIC_BOOL Symbol::intrinsic  )  const [virtual]
 

Reimplemented in FunctionSymbol, and SubroutineSymbol.

Definition at line 322 of file Symbol.cc.

References NOT_INTRINSIC.

Referenced by _coerce(), _loop_index_last_val(), build_in_out_set(), check_scalars_affine(), exchange_convert(), InitializeGSAStack(), Symtab::ins_intrinsic(), make_afi_node(), mod_expr(), parse_function_call(), parse_intrinsic_call(), Symtab::rename_and_ins(), SEARCH(), and translate_var().

virtual void Symbol::intrinsic INTRINSIC_BOOL  ourbool  )  [virtual]
 

Reimplemented in FunctionSymbol, and SubroutineSymbol.

const Statement * Symbol::entry_ref  )  const [virtual]
 

Reimplemented in FunctionSymbol, ProgramSymbol, and SubroutineSymbol.

Definition at line 334 of file Symbol.cc.

Referenced by exchange_convert(), InitializeGSAStack(), and SEARCH().

Statement * Symbol::entry_ref  )  [virtual]
 

Reimplemented in FunctionSymbol, ProgramSymbol, and SubroutineSymbol.

Definition at line 340 of file Symbol.cc.

virtual void Symbol::entry Statement s  )  [virtual]
 

Reimplemented in FunctionSymbol, ProgramSymbol, and SubroutineSymbol.

Referenced by ProgramUnit::create_program_unit().

const Type & Symbol::type  )  const [virtual]
 

Returns the type of the symbol, or else returns type VOID_TYPE if the symbol does not use a type (such as a SubroutineSymbol).

... This call should never happen.

Reimplemented in BlockDataSymbol, FunctionSymbol, NamelistSymbol, ProgramSymbol, SubroutineSymbol, SymbolicConstantSymbol, and VariableSymbol.

Definition at line 280 of file Symbol.cc.

References make_type(), and UNDEFINED_TYPE.

Referenced by _add_control_assigns(), EvolutionGraph::_add_evolutions(), _alias_consts(), EvolutionGraph::_build(), _coerce(), _collect_candidates(), EvolutionGraph::_compute_cyclic_evolutions(), EvolutionGraph::_contains_unknown_variants(), _create_data_assigns(), _filter_vars(), _make_nonlocals_modified_at_calls(), ProgramUnit::_propagate_symbol_dimensions(), _subst_ints_in_expr(), check_scalars_affine(), cleanup_program(), compute_abstract_access(), conformable_test(), IPCPProcData::create_jump_function(), SSAFullRangeDict::data_touch(), GSAFullRangeDict::data_touch(), exchange_convert(), id(), InitializeGSAStack(), new_array_variable(), new_function(), new_intrinsic(), new_subroutine(), new_variable(), precalc_loop(), print_gsa_data_range_stats(), remap_args_precalc_expr(), SEARCH(), SSAControlRangeDict::stats(), GSAControlRangeDict::stats(), SSAControlRangeDict::touch(), and GSAControlRangeDict::touch().

virtual void Symbol::type const Type type  )  [virtual]
 

Reimplemented in FunctionSymbol, and VariableSymbol.

Equivalence * Symbol::equivalence_ref  )  const [virtual]
 

Reimplemented in FunctionSymbol, and VariableSymbol.

Definition at line 358 of file Symbol.cc.

Referenced by ProgramUnit::clean(), Equivalence::del(), exchange_convert(), Equivalence::ins(), move_saved_vars(), and SSAProgramUnit::rename_variables().

virtual void Symbol::equivalence Equivalence e,
int  byte_base
[virtual]
 

Reimplemented in FunctionSymbol, and VariableSymbol.

Referenced by EquivalenceDict::clean(), and Equivalence::ins().

void Symbol::clear_equivalence  )  [virtual]
 

Reimplemented in FunctionSymbol, and VariableSymbol.

Definition at line 370 of file Symbol.cc.

References _ref_error().

Referenced by ProgramUnit::clean(), and Equivalence::del().

void Symbol::shared_expr Expression shared  )  [virtual]
 

'shared' must be an expression whose 'symbol' is this itself

and it must DISTRIBUTE_OP or ID_OP

Reimplemented in VariableSymbol.

Definition at line 376 of file Symbol.cc.

void Symbol::set_to_private  )  [virtual]
 

this symbol turns back to be a private by resetting _shared_expr to 0

... Nothing happens

Reimplemented in VariableSymbol.

Definition at line 384 of file Symbol.cc.

Expression * Symbol::shared_expr  )  const [virtual]
 

_ If thie is VariableSymbol and shared data object, it returns to the _ pointer to its correspoding distribution expression

_ The returned expression must be either ID_OP or DISTRIBUTE_OP. _ If this is private, it returns 0. (only applicable to Cray T3D)

Reimplemented in VariableSymbol.

Definition at line 390 of file Symbol.cc.

const ArrayDims & Symbol::dim  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 396 of file Symbol.cc.

References _ref_error().

Referenced by _add_subscript_constraints_to_ranges(), ProgramUnit::_propagate_symbol_dimensions(), alternate_expr_valid(), ProgramUnit::clean(), collect_all_symbols(), conformable_test(), enforce_standard_within_bounds(), InitializeGSAStack(), Predicates::Predicates(), SymbolAccessMap::remap_interface_vars(), SEARCH(), substitute_parameters(), SymbolAccessRefMap::write(), and SymbolAccessMap::write().

ArrayDims & Symbol::dim  )  [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 404 of file Symbol.cc.

References _ref_error().

const SharedDims & Symbol::shared_dim  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 412 of file Symbol.cc.

References _ref_error().

Referenced by InitializeGSAStack(), and SEARCH().

SharedDims & Symbol::shared_dim  )  [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 420 of file Symbol.cc.

References _ref_error().

FORMAL_BOOL Symbol::formal  )  const [virtual]
 

Reimplemented in FunctionSymbol, SubroutineSymbol, and VariableSymbol.

Definition at line 428 of file Symbol.cc.

References NOT_FORMAL.

Referenced by EvolutionGraph::_build(), _filter_arrays(), _init_non_local_vars(), _make_nonlocals_modified_at_calls(), exchange_convert(), InitializeGSAStack(), InlineObject::remap_arg_names(), SymbolAccessRefMap::remap_interface_vars(), SymbolAccessMap::remap_interface_vars(), SSAProgramUnit::rename_variables(), and SEARCH().

virtual void Symbol::formal FORMAL_BOOL  ourbool  )  [virtual]
 

Reimplemented in FunctionSymbol, SubroutineSymbol, and VariableSymbol.

ALLOC_BOOL Symbol::allocatable  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 470 of file Symbol.cc.

References NOT_ALLOCATABLE.

Referenced by exchange_convert().

virtual void Symbol::allocatable ALLOC_BOOL  ourbool  )  [virtual]
 

Reimplemented in VariableSymbol.

GLOBAL_BOOL Symbol::global  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 464 of file Symbol.cc.

References NOT_GLOBAL.

Referenced by exchange_convert().

virtual void Symbol::global GLOBAL_BOOL  ourbool  )  [virtual]
 

Reimplemented in VariableSymbol.

SAVED_BOOL Symbol::saved  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 452 of file Symbol.cc.

References NOT_SAVED.

Referenced by _init_non_local_vars(), InitializeGSAStack(), move_saved_vars(), SSAProgramUnit::rename_variables(), and SEARCH().

virtual void Symbol::saved SAVED_BOOL  ourbool  )  [virtual]
 

Reimplemented in VariableSymbol.

const CommonBlock * Symbol::common_ref  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 488 of file Symbol.cc.

Referenced by EvolutionGraph::_build(), _filter_arrays(), _init_non_local_vars(), _make_nonlocals_modified_at_calls(), add_dummy_global_assignments_at_calls(), build_def_map(), ProgramUnit::clean(), CommonBlock::del(), exchange_convert(), gen_maymods(), CommonBlock::ins(), interface_vars(), SymbolAccessMap::remap_interface_vars(), SSAProgramUnit::rename_variables(), SEARCH(), and untranslate_var().

CommonBlock * Symbol::common_ref  )  [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 494 of file Symbol.cc.

virtual void Symbol::common CommonBlock cb,
int  index
[virtual]
 

Insert this variable into common block cb at position index (0 = first element).

Reimplemented in VariableSymbol.

Referenced by CommonBlock::ins().

void Symbol::clear_common  )  [virtual]
 

Remove this variable from a common block if it is in one.

Reimplemented in VariableSymbol.

Definition at line 506 of file Symbol.cc.

References _ref_error().

Referenced by ProgramUnit::clean(), and CommonBlock::del().

const Expression * Symbol::expr_ref  )  const [virtual]
 

Reimplemented in SymbolicConstantSymbol.

Definition at line 512 of file Symbol.cc.

Referenced by ProgramUnit::clean(), collect_all_symbols(), expr_substitute_parameters(), InitializeGSAStack(), replace_parameters(), SEARCH(), and substitute_parameters().

Expression * Symbol::expr_ref  )  [virtual]
 

Reimplemented in SymbolicConstantSymbol.

Definition at line 518 of file Symbol.cc.

virtual void Symbol::expr Expression e  )  [virtual]
 

Reimplemented in SymbolicConstantSymbol.

Referenced by substitute_parameters().

int Symbol::is_entry  )  [virtual]
 

Reimplemented in FunctionSymbol, and SubroutineSymbol.

Definition at line 530 of file Symbol.cc.

References False.

int Symbol::is_scalar  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 536 of file Symbol.cc.

References False.

Referenced by EvolutionGraph::_add_evolutions(), EvolutionGraph::_build(), EvolutionGraph::_compute_cyclic_evolutions(), EvolutionGraph::_contains_unknown_variants(), _find_scalar_sources(), add_dummy_global_assignments_at_calls(), add_maymods(), adjust_gmap(), alternate_expr_valid(), check_scalars_affine(), Directive::generate_sgi_parallel_directive(), and translate_one_symbol().

int Symbol::is_array  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 542 of file Symbol.cc.

References False.

Referenced by _alias_consts(), _collect_candidates(), _compute_private_kill_sets(), _create_data_assigns(), _filter_vars(), IPCPProcData::add_consts_to_pgm(), add_maymods(), adjust_gmap(), ProgramUnit::clean(), collect_all_symbols(), compute_top_range_from_actuals(), SSAFullRangeDict::data_touch(), GSAFullRangeDict::data_touch(), is_array_symbol(), is_scalar_var(), make_afi_node(), Predicates::Predicates(), print_gsa_data_range_stats(), propagate_outermost_DOs(), SSAProgramUnit::rename_variables(), SSAControlRangeDict::stats(), GSAControlRangeDict::stats(), SSAControlRangeDict::touch(), GSAControlRangeDict::touch(), and translate_one_symbol().

int Symbol::is_shared  )  const [virtual]
 

Reimplemented in VariableSymbol.

Definition at line 548 of file Symbol.cc.

References False.

int Symbol::is_pointer  )  const [inline, virtual]
 

Reimplemented in PointerSymbol, and VariableSymbol.

Definition at line 354 of file Symbol.h.

const Symbol & Symbol::assoc_variable  )  const [virtual]
 

... This return should never happen.

Reimplemented in PointerSymbol.

Definition at line 260 of file Symbol.cc.

Symbol & Symbol::assoc_variable  )  [virtual]
 

... This return should never happen.

Reimplemented in PointerSymbol.

Definition at line 270 of file Symbol.cc.

int Symbol::size  )  const [virtual]
 

Return the size in bytes of the memory refered to by the symbol.

Reimplemented in VariableSymbol.

Definition at line 295 of file Symbol.cc.

Referenced by _AccessRegion::_AccessRegion(), _get_size(), EquivalenceDict::clean(), common_offset(), exchange_convert(), Equivalence::ins(), and Equivalence::write().

int Symbol::structures_OK  )  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.

Implements Definition.

Reimplemented in BlockDataSymbol, FunctionSymbol, NamelistSymbol, PointerSymbol, ProgramSymbol, SubroutineSymbol, SymbolicConstantSymbol, and VariableSymbol.

Definition at line 557 of file Symbol.cc.

References _overflow.

Referenced by PhiPlaceDef::structures_OK(), and EquivalenceMember::structures_OK().

void Symbol::exchange_convert VDL vdl  )  [virtual]
 

Convert the Symbol into the exchange format.

Reimplemented in BlockDataSymbol, FunctionSymbol, NamelistSymbol, PointerSymbol, ProgramSymbol, SubroutineSymbol, SymbolicConstantSymbol, and VariableSymbol.

Definition at line 566 of file Symbol.cc.

References allocatable(), common_ref(), Expression::data_ref(), entry_ref(), equivalence_ref(), external(), BinRep::find_ref(), formal(), global(), Set< T >::ins(), List< T >::ins_last(), intrinsic(), IS_ALLOCATABLE, IS_EXTERNAL, IS_FORMAL, IS_GLOBAL, IS_INTRINSIC, name_ref(), size(), BinRep::to_set(), BinRep::to_tuple(), type(), UNDEFINED_TYPE, and UNKNOWN_TYPE.

Referenced by NamelistSymbol::exchange_convert(), BlockDataSymbol::exchange_convert(), SymbolicConstantSymbol::exchange_convert(), PointerSymbol::exchange_convert(), VariableSymbol::exchange_convert(), SubroutineSymbol::exchange_convert(), FunctionSymbol::exchange_convert(), and ProgramSymbol::exchange_convert().

void Symbol::renaming_suggestion String new_name  ) 
 

Given that some other symbol with the same name as this symbol needs to be inserted into the same symbol table, give a new name suggestion for the other symbol.

For example, if this symbol is named "I", the first time this function is called, it will suggest "I0" for the other symbol. The next time it will suggest "I1", etc.

This name suggestion is returned in the String parameter 'new_name'.

(

Note:
It should be rare that this function will be be used directly, since there could still be naming conflicts in a symbol table after using this function. The preferred method is to create a new symbol with the name being the base name that is desired, and then to use the Symtab::rename_and_ins() function, which references this function as many times as is needed.)

Definition at line 658 of file Symbol.cc.

References _last_renaming_append.

Referenced by ProgramUnit::create_program_unit(), and Symtab::rename_and_ins().


Friends And Related Function Documentation

friend class Symtab [friend]
 

Definition at line 120 of file Symbol.h.

friend class PostPass [friend]
 

Reimplemented in VariableSymbol.

Definition at line 121 of file Symbol.h.

ostream& operator<< ostream &  o,
const Symbol other
[friend]
 

Definition at line 192 of file Symbol.cc.


Member Data Documentation

SYMBOL_CLASS Symbol::_sym_class [protected]
 

Definition at line 124 of file Symbol.h.

Referenced by _ref_error(), sym_class(), and Symbol().

BinRep* Symbol::_overflow [protected]
 

Definition at line 125 of file Symbol.h.

Referenced by overflow_ref(), structures_OK(), Symbol(), and ~Symbol().

int Symbol::_last_renaming_append [protected]
 

_last_renaming_append is an integer which caches the last appended integer which was added to a name of this base to avoid naming conflicts in the symbol table

I.e. If this symbol name were "I", and three other "I"'s needed to be inserted with naming conflicts avoided, then this value would cached for "I" the values 0, 1, and 2 as the other "I" symbols were renamed to "I0", "I1", and "I2". It is not absolutely necessary, but it should save time reducing multiple renaming attempts.

Definition at line 128 of file Symbol.h.

Referenced by renaming_suggestion(), and Symbol().


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:08:27 2005