Next: src/tree, Previous: src/inlining, Up: Project Layout [Contents][Index]
Namespace temp
, delivered for TC-5.
Provides the class template Identifier
built upon
misc::variant
and used to implement temp::Temp
and
temp::Label
. Also contains the generic
IdentifierCompareVisitor
, used to compare two identifiers.
Identifier
handles maps of Identifiers
. For instance, the
Temp
t5
might be allocated the register $t2
, in
which case, when outputting t5
, we should print $t2
. Maps
stored in the xalloc’d slot Identifier::map
of streams implements
such a correspondence. In addition, the operator<<
of the
Identifier
class template itself "knows" when such a mapping is
active, and uses it.
We need labels for jump
s, for functions, strings etc.
Implemented as an instantiation of the temp::Identifier
scheme.
So called temporaries are pseudo-registers: we may allocate as
many temporaries as we want. Eventually the register allocator will map
those temporaries to either an actual register, or it will allocate a
slot in the activation block (aka frame) of the current function.
Implemented as an instantiation of the temp::Identifier
scheme.
A set of temporaries, along with its operator<<
.