2019-02-05 02:44:07 +02:00
|
|
|
[CodegenModule::] Codegen Module.
|
|
|
|
|
|
|
|
Setting up the use of this module.
|
|
|
|
|
|
|
|
@h Introduction.
|
|
|
|
|
|
|
|
@d CODEGEN_MODULE TRUE
|
|
|
|
|
|
|
|
@h Setting up the memory manager.
|
|
|
|
We need to itemise the structures we'll want to allocate:
|
|
|
|
|
|
|
|
@e I6T_intervention_MT
|
2019-06-11 01:06:40 +03:00
|
|
|
@e codegen_pipeline_MT
|
2019-06-11 01:22:09 +03:00
|
|
|
@e pipeline_step_MT
|
2019-02-05 02:44:07 +02:00
|
|
|
@e uniqueness_count_MT
|
2019-04-08 11:03:53 +03:00
|
|
|
@e text_literal_holder_MT
|
2019-05-05 16:54:24 +03:00
|
|
|
@e routine_body_request_MT
|
2019-06-11 01:06:40 +03:00
|
|
|
@e pipeline_stage_MT
|
2019-06-26 19:27:54 +03:00
|
|
|
@e code_generation_target_MT
|
2019-06-27 01:50:30 +03:00
|
|
|
@e code_generation_MT
|
|
|
|
@e generated_segment_MT
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@ With allocation functions:
|
|
|
|
|
|
|
|
=
|
|
|
|
ALLOCATE_INDIVIDUALLY(I6T_intervention)
|
2019-06-11 01:06:40 +03:00
|
|
|
ALLOCATE_INDIVIDUALLY(codegen_pipeline)
|
2019-06-11 01:22:09 +03:00
|
|
|
ALLOCATE_INDIVIDUALLY(pipeline_step)
|
2019-02-05 02:44:07 +02:00
|
|
|
ALLOCATE_INDIVIDUALLY(uniqueness_count)
|
2019-04-08 11:03:53 +03:00
|
|
|
ALLOCATE_INDIVIDUALLY(text_literal_holder)
|
2019-05-05 16:54:24 +03:00
|
|
|
ALLOCATE_INDIVIDUALLY(routine_body_request)
|
2019-06-11 01:06:40 +03:00
|
|
|
ALLOCATE_INDIVIDUALLY(pipeline_stage)
|
2019-06-26 19:27:54 +03:00
|
|
|
ALLOCATE_INDIVIDUALLY(code_generation_target)
|
2019-06-27 01:50:30 +03:00
|
|
|
ALLOCATE_INDIVIDUALLY(code_generation)
|
|
|
|
ALLOCATE_INDIVIDUALLY(generated_segment)
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@h The beginning.
|
|
|
|
(The client doesn't need to call the start and end routines, because the
|
|
|
|
foundation module does that automatically.)
|
|
|
|
|
|
|
|
=
|
|
|
|
void CodegenModule::start(void) {
|
|
|
|
@<Register this module's memory allocation reasons@>;
|
|
|
|
@<Register this module's stream writers@>;
|
|
|
|
@<Register this module's debugging log aspects@>;
|
|
|
|
@<Register this module's debugging log writers@>;
|
|
|
|
@<Register this module's command line switches@>;
|
|
|
|
}
|
|
|
|
|
|
|
|
@
|
|
|
|
|
|
|
|
@e CODE_GENERATION_MREASON
|
|
|
|
|
|
|
|
@<Register this module's memory allocation reasons@> =
|
|
|
|
Memory::reason_name(CODE_GENERATION_MREASON, "code generation workspace for objects");
|
|
|
|
|
|
|
|
@<Register this module's stream writers@> =
|
2019-08-28 12:35:44 +03:00
|
|
|
;
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@
|
|
|
|
|
|
|
|
@e TEMPLATE_READING_DA
|
|
|
|
@e RESOLVING_CONDITIONAL_COMPILATION_DA
|
2019-04-11 17:23:45 +03:00
|
|
|
@e EXTERNAL_SYMBOL_RESOLUTION_DA
|
2019-07-16 14:53:24 +03:00
|
|
|
@e ELIMINATION_DA
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@<Register this module's debugging log aspects@> =
|
|
|
|
Log::declare_aspect(TEMPLATE_READING_DA, L"template reading", FALSE, FALSE);
|
|
|
|
Log::declare_aspect(RESOLVING_CONDITIONAL_COMPILATION_DA, L"resolving conditional compilation", FALSE, FALSE);
|
2019-04-11 17:23:45 +03:00
|
|
|
Log::declare_aspect(EXTERNAL_SYMBOL_RESOLUTION_DA, L"external symbol resolution", FALSE, FALSE);
|
2019-07-16 14:53:24 +03:00
|
|
|
Log::declare_aspect(ELIMINATION_DA, L"code elimination", FALSE, FALSE);
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@<Register this module's debugging log writers@> =
|
2019-08-28 12:35:44 +03:00
|
|
|
;
|
2019-02-05 02:44:07 +02:00
|
|
|
|
|
|
|
@<Register this module's command line switches@> =
|
|
|
|
;
|
|
|
|
|
|
|
|
@h The end.
|
|
|
|
|
|
|
|
=
|
|
|
|
void CodegenModule::end(void) {
|
|
|
|
}
|