expression_address_local Class Reference

#include <local.h>

Inheritance diagram for expression_address_local:

expression_address expression List of all members.

Public Member Functions

virtual ~expression_address_local ()
 expression_address_local (const location &locn, unsigned offset, const type::pointer &type, const symbol *hint, translator_compile *cntxt)

Protected Member Functions

void traversal (int pprec)
expression::pointer fast_load () const
expression::pointer fast_store (const expression::pointer &rhs) const
bool is_constant () const
expression::pointer advance_by_words (long nwords, const type::pointer &new_type, const symbol *new_hint) const
const symbolget_symbol_hint () const

Private Member Functions

 expression_address_local ()
 expression_address_local (const expression_address_local &)
expression_address_localoperator= (const expression_address_local &)

Private Attributes

translator_compilecode
const symbolhint

Detailed Description

The expression_address_local class is used to represent a local (current stack frame) address constant.

Definition at line 32 of file local.h.


Constructor & Destructor Documentation

virtual expression_address_local::~expression_address_local (  )  [virtual]

The destructor.

expression_address_local::expression_address_local ( const location locn,
unsigned  offset,
const type::pointer type,
const symbol hint,
translator_compile cntxt 
)

The constructor.

Parameters:
locn The source file location of this expression
offset The word offset into the top-most stack frame
type The type of variable this expression represents
hint The symbol most recently related to this expression, or NULL for no hint.
cntxt The translation context

expression_address_local::expression_address_local (  )  [private]

The default constructor. Do not use.

expression_address_local::expression_address_local ( const expression_address_local  )  [private]

The copy constructor. Do not use.


Member Function Documentation

void expression_address_local::traversal ( int  pprec  )  [protected, virtual]

The traversal method may be used to traverse each of the declaractions in the list.

Parameters:
pprec The precedence of the parent expression node.

Implements expression.

expression::pointer expression_address_local::fast_load (  )  const [protected, virtual]

The fast_load method is used by the expression_load_indirect::optimize method to produce smaller code, if possible.

Note:
It is tempting to use a default implementation which returns self(), however this prevents the compiler from telling us we missed something.

Implements expression_address.

expression::pointer expression_address_local::fast_store ( const expression::pointer rhs  )  const [protected, virtual]

The fast_store method is used by the expression_store_indirect::optimize method to produce smaller code, if possible.

Parameters:
rhs The value to be stored.
Note:
It is tempting to use a default implementation which returns self(), however this prevents the compiler from telling us we missed something.

Implements expression_address.

bool expression_address_local::is_constant (  )  const [protected, virtual]

The is_constant method may be used to determine whether this expression node is a constant, or this tree would evaluate to a constant.

The default implementation is conservative, and always returns false.

Returns:
bool; true if constant, false if not.

Reimplemented from expression.

expression::pointer expression_address_local::advance_by_words ( long  nwords,
const type::pointer new_type,
const symbol new_hint 
) const [protected, virtual]

The advance_by_words method is used to create a new pointer constant from an old one, with the offset advanced by the given number of words.

Parameters:
nwords The number of words to advance.
new_type the new type of pointer, because usually the original is a record pointer, and the new one is a member pointer (i.e. not the same type).
new_hint New hit to attach to the new pointer node
Returns:
a new expression node.

Implements expression_address.

const symbol* expression_address_local::get_symbol_hint (  )  const [protected, virtual]

The get_symbol_hint method is used to get the symbol associated with the expression.

Returns:
pointer to a symbol, or NULL if there is no hint present

Reimplemented from expression.

expression_address_local& expression_address_local::operator= ( const expression_address_local  )  [private]

The assignment operator. Do not use.


Member Data Documentation

translator_compile& expression_address_local::code [private]

The code instance variable is used to remember where to send our generated code.

Definition at line 86 of file local.h.

const symbol* expression_address_local::hint [private]

The hint instance variable is used to remember the symbol most recently related to this expression, or NULL for no hint.

Definition at line 92 of file local.h.


The documentation for this class was generated from the following file:
Generated on Sun Feb 25 01:27:11 2007 for UCSDp-SystemCrossCompiler by  doxygen 1.5.1