LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
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>
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 Access * | clone () const =0 |
Return a copy of the actual Access. |
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.
frame::Access::Access | ( | ) |
|
virtual |
|
pure virtual |
Return a copy of the actual Access.
Implemented in frame::In_Frame, and frame::In_Register.
Referenced by frame::Frame::Frame().
|
pure virtual |
Used for debugging.
Implemented in frame::In_Frame, and frame::In_Register.
Referenced by frame::operator<<().
|
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().
|
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.