LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
target::tasks Namespace Reference

Functions

std::unique_ptr< Targettarget (nullptr)
 Global target pointer.
void target_mips ()
 Select MIPS target.
void target_ia32 ()
 Select IA-32 target.
void target_display ()
 Describe the current target.
void inst_compute ()
 Perform the instruction selection.
void runtime_display ()
void inst_display ()
 Display the result of the instruction selection.
void nolimips_display ()
 Display the result of instruction selection with frame allocation.
 TASK_GROUP ("7. Target selection")
 TASK_DECLARE ("i|inst-compute","select the instructions", inst_compute,"lir-compute targeted")
 Perform the instruction selection.
 TASK_DECLARE ("R|runtime-display","display the runtime", runtime_display,"targeted")
 Display the runtime.
 BOOLEAN_TASK_DECLARE ("inst-debug","enable instructions verbose display", inst_debug_p,"")
 Report def, use and jump lists.
 BOOLEAN_TASK_DECLARE ("rule-trace","enable rule reducing display", rule_trace_p,"")
 Report rule reducing.
 BOOLEAN_TASK_DECLARE ("garbage-collection","enable garbage collection", gc_p,"")
 Enable support for the Boehm-Demers-Weiser garbage collector.
 TASK_DECLARE ("I|inst-display","display the instructions", inst_display,"inst-compute")
 Display the result of the instruction selection.
 TASK_DECLARE ("Y|nolimips-display","display Nolimips compatible instructions (i.e., allocate ""the frames and then display the instructions", nolimips_display,"inst-compute")
 Display the result of the instruction selection.
 DISJUNCTIVE_TASK_DECLARE ("targeted","default the target to MIPS","target-mips target-ia32")
 Make sure the target is defined.
 TASK_DECLARE ("target-mips","select MIPS as target", target_mips,"")
 Select MIPS target.
 TASK_DECLARE ("target-ia32","select IA-32 as target", target_ia32,"")
 Select IA-32 target.
 TASK_DECLARE ("target-display","display the current target", target_display,"targeted")
 Describe the current target.
 INT_TASK_DECLARE ("callee-save", 0, 99,"max number of callee save registers", limits.callee_save_max,"")
 The maximum number of callee save registers.
 INT_TASK_DECLARE ("caller-save", 0, 99,"max number of caller save registers", limits.caller_save_max,"")
 The maximum number of callee save registers.
 INT_TASK_DECLARE ("argument", 0, 99,"max number of argument registers", limits.argument_max,"")
 The maximum number of callee save registers.

Variables

CpuLimits limits
 A set of restrictions over the cpu.
std::unique_ptr< assem::Fragmentsfragments
 Global assembly fragment list.
std::unique_ptr< Targettarget
 Global target pointer (default is MIPS).

Function Documentation

target::tasks::BOOLEAN_TASK_DECLARE ( "inst-debug"  ,
"enable instructions verbose display"  ,
inst_debug_p  ,
""   
)

Report def, use and jump lists.

target::tasks::BOOLEAN_TASK_DECLARE ( "rule-trace"  ,
"enable rule reducing display"  ,
rule_trace_p  ,
""   
)

Report rule reducing.

target::tasks::BOOLEAN_TASK_DECLARE ( "garbage-collection"  ,
"enable garbage collection"  ,
gc_p  ,
""   
)

Enable support for the Boehm-Demers-Weiser garbage collector.

target::tasks::DISJUNCTIVE_TASK_DECLARE ( "targeted"  ,
"default the target to MIPS"  ,
"target-mips target-ia32"   
)

Make sure the target is defined.

void target::tasks::inst_compute ( )

Perform the instruction selection.

References translate::tasks::fragments, fragments, target::lir_to_assem(), and target.

void target::tasks::inst_display ( )

Display the result of the instruction selection.

References fragments, target::instructions_dump(), precondition, target, and temp::tasks::tempmap.

Referenced by nolimips_display().

target::tasks::INT_TASK_DECLARE ( "callee-save"  ,
,
99  ,
"max number of callee save registers"  ,
limits.  callee_save_max,
""   
)

The maximum number of callee save registers.

target::tasks::INT_TASK_DECLARE ( "caller-save"  ,
,
99  ,
"max number of caller save registers"  ,
limits.  caller_save_max,
""   
)

The maximum number of callee save registers.

target::tasks::INT_TASK_DECLARE ( "argument"  ,
,
99  ,
"max number of argument registers"  ,
limits.  argument_max,
""   
)

The maximum number of callee save registers.

void target::tasks::nolimips_display ( )

Display the result of instruction selection with frame allocation.

References fragments, target::frame_allocate(), inst_display(), precondition, and target.

void target::tasks::runtime_display ( )

References target::runtime_dump(), and target.

std::unique_ptr<Target> target::tasks::target ( nullptr  )

Global target pointer.

Pointer initialization is done in either target_mips or target_ia32, using target_set. One could want to set target in its construction, e.g., using target_set:

std::unique_ptr<Target> target (target_set (...));

but this would be dead wrong: target_set sets up several globals, such as temp::tasks::tempmap, that might not be instantiated yet! As a matter of fact, this is what happens on Mac OS X, where G++ chose another order to perform its static initialization. Since the standard does say we should never depend on such an order, the easiest is to have a task perform the default assignment.

In the long run, several of these globals should be removed. For instance, the temp::tasks::tempmap should probably be instantiated by the Target: therefore the dependencies issue will be magically resolved.

void target::tasks::target_display ( )

Describe the current target.

References target.

void target::tasks::target_ia32 ( )

Select IA-32 target.

void target::tasks::target_mips ( )

Select MIPS target.

References limits.

target::tasks::TASK_DECLARE ( "i|inst-compute"  ,
"select the instructions"  ,
inst_compute  ,
"lir-compute targeted"   
)

Perform the instruction selection.

target::tasks::TASK_DECLARE ( "R|runtime-display"  ,
"display the runtime"  ,
runtime_display  ,
"targeted"   
)

Display the runtime.

target::tasks::TASK_DECLARE ( "I|inst-display"  ,
"display the instructions"  ,
inst_display  ,
"inst-compute"   
)

Display the result of the instruction selection.

target::tasks::TASK_DECLARE ( "Y|nolimips-display"  )

Display the result of the instruction selection.

target::tasks::TASK_DECLARE ( "target-mips"  ,
"select MIPS as target"  ,
target_mips  ,
""   
)

Select MIPS target.

target::tasks::TASK_DECLARE ( "target-ia32"  ,
"select IA-32 as target"  ,
target_ia32  ,
""   
)

Select IA-32 target.

target::tasks::TASK_DECLARE ( "target-display"  ,
"display the current target"  ,
target_display  ,
"targeted"   
)

Describe the current target.

target::tasks::TASK_GROUP ( "7. Target selection"  )

Variable Documentation

CpuLimits target::tasks::limits

A set of restrictions over the cpu.

Referenced by target_mips().