LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
frame::Access Class Reference

Variables have to be stored. There are two kinds of places: saved in a register, or in the frame. Access abstracts both. More...

#include <access.hh>

Inheritance diagram for frame::Access:

Public Member Functions

 Access ()
virtual ~Access ()
virtual std::ostream & dump (std::ostream &ostr) const =0
 Used for debugging.
virtual tree::rExp exp () const
 Return a Tree expression that gives the location of THIS. If it is in the frame, then the result is something like Mem (Temp fp + OFFSET).
virtual tree::rExp exp (const tree::rExp &fp) const =0
 Same as above, but use FP instead of `Temp fp'. Useful to access escaped variables.
virtual Accessclone () const =0
 Return a copy of the actual Access.

Detailed Description

Variables have to be stored. There are two kinds of places: saved in a register, or in the frame. Access abstracts both.

Actually, so called register here are temporaries, i.e., we pretend there is an infinite set of registers. Later in the compiler, when allocating the registers, temporaries will be mapped onto real registers (maybe spilling some temporaries into the frame).

An Access is the abstraction of this: either In_Register, or In_Frame.

Constructor & Destructor Documentation

frame::Access::Access ( )
frame::Access::~Access ( )
virtual

Member Function Documentation

virtual Access* frame::Access::clone ( ) const
pure virtual

Return a copy of the actual Access.

Implemented in frame::In_Frame, and frame::In_Register.

Referenced by frame::Frame::Frame().

virtual std::ostream& frame::Access::dump ( std::ostream &  ostr) const
pure virtual

Used for debugging.

Implemented in frame::In_Frame, and frame::In_Register.

Referenced by frame::operator<<().

tree::rExp frame::Access::exp ( ) const
virtual

Return a Tree expression that gives the location of THIS. If it is in the frame, then the result is something like Mem (Temp fp + OFFSET).

Referenced by translate::Access::exp().

virtual tree::rExp frame::Access::exp ( const tree::rExp &  fp) const
pure virtual

Same as above, but use FP instead of `Temp fp'. Useful to access escaped variables.

Implemented in frame::In_Frame, and frame::In_Register.


The documentation for this class was generated from the following files: