Polaris: CommonBlock Class Reference

CommonBlock Class Reference

For now, the copy constructor, operator= method, and definition_clone() method don't work because using them would create two common blocks for the same variable, resulting in inconsistencies. More...

#include <CommonBlock.h>

Inheritance diagram for CommonBlock:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CommonBlock (const char *name)
 Note: The name must begin and end with a slash, e.g. "/COM1/".
 CommonBlock (const char *name, const BinRep &binstr, const Symtab &symtab)
 Constructor from binstr Note: The name must begin and end with a slash, e.g.
 CommonBlock (const CommonBlock &other)
CommonBlockoperator= (const CommonBlock &other)
virtual ~CommonBlock ()
const char * name_ref () const
int saved () const
void saved (int)
BinRepoverflow_ref () const
int entries () const
 Returns the number of variables in this object.
Iterator< Symboliterator () const
 Return an iterator for the members of this common block.
void del (Symbol &symbol)
 Delete a variable from the members list -- this change is also automatically reflected in symbol by making the variable's common field point to NULL.
void ins (Symbol &symbol, int index)
 Insert a variable into the members list at position 'index' -- this change is also automatically reflected in symbol by making the variable's common field point to this structure.
virtual void print (ostream &o) const
 print onto stream
virtual Definitiondefinition_clone () const
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 relink_dptrs (ProgramUnit &p)
 Change the pointers found in a CommonBlock element to be pointers into the given ProgramUnit.

Protected Attributes

RefList< Symbol_body
unsigned _saved:1
BinRep_overflow

Friends

class VariableSymbol
ostream & operator<< (ostream &o, const CommonBlock &common)

Detailed Description

For now, the copy constructor, operator= method, and definition_clone() method don't work because using them would create two common blocks for the same variable, resulting in inconsistencies.

Bugs

currently disabled.

Definition at line 29 of file CommonBlock.h.


Constructor & Destructor Documentation

CommonBlock::CommonBlock const char *  name  ) 
 

Note: The name must begin and end with a slash, e.g. "/COM1/".

Definition at line 42 of file CommonBlock.cc.

References _overflow, and register_instance().

Referenced by definition_clone().

CommonBlock::CommonBlock const char *  name,
const BinRep binstr,
const Symtab symtab
 

Constructor from binstr Note: The name must begin and end with a slash, e.g.

"/COM1/"

Definition at line 82 of file CommonBlock.cc.

References _body, _overflow, _saved, BinRep::find_ref(), BinRep::ins(), RefList< T >::ins_last(), BinRep::put_set(), register_instance(), BinRep::to_string(), BinRep::to_tuple(), List< T >::valid(), and warn_overflow_map().

CommonBlock::CommonBlock const CommonBlock other  ) 
 

Definition at line 57 of file CommonBlock.cc.

References _overflow, and register_instance().

CommonBlock::~CommonBlock  )  [virtual]
 

Definition at line 185 of file CommonBlock.cc.

References _overflow, and unregister_instance().


Member Function Documentation

CommonBlock & CommonBlock::operator= const CommonBlock other  ) 
 

Definition at line 69 of file CommonBlock.cc.

References _body, _overflow, and _saved.

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

Definition at line 103 of file CommonBlock.h.

Referenced by build_def_map(), ProgramUnit::create_program_unit(), CommonBlockDict::exchange_convert(), gen_maymods(), PointerSymbol::print(), VariableSymbol::print(), PointerSymbol::relink_dptrs(), VariableSymbol::relink_dptrs(), SymbolAccessMap::remap_interface_vars(), and CommonBlockDict::write().

int CommonBlock::saved  )  const [inline]
 

Definition at line 109 of file CommonBlock.h.

References _saved.

Referenced by InlineObject::map_existing_common_block(), move_saved_vars(), and CommonBlockDict::write().

void CommonBlock::saved int   )  [inline]
 

Definition at line 97 of file CommonBlock.h.

References _saved.

BinRep * CommonBlock::overflow_ref  )  const [inline]
 

Definition at line 115 of file CommonBlock.h.

References _overflow.

int CommonBlock::entries  )  const [inline]
 

Returns the number of variables in this object.

Definition at line 121 of file CommonBlock.h.

References _body, and RefList< T >::entries().

Referenced by move_saved_vars(), and CommonBlockDict::write().

Iterator< Symbol > CommonBlock::iterator  )  const [inline]
 

Return an iterator for the members of this common block.

Definition at line 127 of file CommonBlock.h.

References _body.

Referenced by build_in_out_sets(), VariableSymbol::clear_common(), common_offset(), CommonBlockDict::exchange_convert(), make_common_maymod(), InlineObject::map_existing_common_block(), move_saved_vars(), and SymbolAccessMap::remap_interface_vars().

void CommonBlock::del Symbol symbol  ) 
 

Delete a variable from the members list -- this change is also automatically reflected in symbol by making the variable's common field point to NULL.

If the variable is not in this common block, an error occurs.

Definition at line 196 of file CommonBlock.cc.

References Symbol::clear_common(), Symbol::common_ref(), and symbol().

void CommonBlock::ins Symbol symbol,
int  index
 

Insert a variable into the members list at position 'index' -- this change is also automatically reflected in symbol by making the variable's common field point to this structure.

An index of 0 indicates the first position in the list. If the variable is already in another common block, then an error occurs, since this is likely a mistake.

Definition at line 215 of file CommonBlock.cc.

References Symbol::common(), Symbol::common_ref(), and symbol().

Referenced by move_saved_vars().

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

print onto stream

... _saved field

... _body field

... _overflow field

Implements Definition.

Definition at line 239 of file CommonBlock.cc.

References _body, _overflow, _saved, Iterator< T >::current(), Symbol::name_ref(), and Iterator< T >::valid().

Definition * CommonBlock::definition_clone  )  const [virtual]
 

Implements Definition.

Definition at line 275 of file CommonBlock.cc.

References CommonBlock().

int CommonBlock::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.

Definition at line 281 of file CommonBlock.cc.

void CommonBlock::relink_dptrs ProgramUnit p  )  [virtual]
 

Change the pointers found in a CommonBlock element to be pointers into the given ProgramUnit.

Implements RelinkableDef.

Definition at line 292 of file CommonBlock.cc.

Referenced by move_saved_vars().


Friends And Related Function Documentation

friend class VariableSymbol [friend]
 

Definition at line 31 of file CommonBlock.h.

ostream& operator<< ostream &  o,
const CommonBlock common
[friend]
 

Definition at line 232 of file CommonBlock.cc.


Member Data Documentation

RefList<Symbol> CommonBlock::_body [protected]
 

Definition at line 34 of file CommonBlock.h.

Referenced by VariableSymbol::clear_common(), VariableSymbol::common(), CommonBlock(), entries(), iterator(), operator=(), and print().

unsigned CommonBlock::_saved [protected]
 

Definition at line 35 of file CommonBlock.h.

Referenced by CommonBlock(), operator=(), print(), and saved().

BinRep* CommonBlock::_overflow [protected]
 

Definition at line 36 of file CommonBlock.h.

Referenced by CommonBlock(), operator=(), overflow_ref(), print(), and ~CommonBlock().


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:07 2005