The src/temp Directory¶
Namespace temp, delivered for TC-5.
File: libtemp.* (src/temp/)
The interface of the
tempmodule. It exports a single procedure,dump.
File: identifier.* (src/temp)
Provides the class template
Identifierbuilt uponmisc::variantand used to implementtemp::Tempandtemp::Label. Also contains the genericIdentifierCompareVisitor, used to compare two identifiers.
Identifierhandles maps ofIdentifiers. For instance, theTemp t5might be allocated the registered$t2, in which case, when outputtingt5, we should print$t2. Maps stored in the xalloc’d slotIdentifier::mapof streams implements such a correspondence. In addition, theoperator<<of theIdentifierclass template itself “knows” when such a mapping is active, and uses it.
File: label.* (src/temp)
We need labels for
jump, for functions, strings etc. Implemented as an instantiation of thetemp::Identifierscheme.
File: temp.* (src/temp)
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::Identifierscheme.
File: temp-set.* (src/temp)
A set of temporaries, along with its
operator<<.