Skip to content

Task-based compilation of units

Michael Van Canneyt requested to merge unit_tasks into main

Enable compilation of FMX and other complex dependencies scenarios.

The logic of successive unit compilation is moved out of t(ppu)module.loadppu and into a new task_handler structure. The task handler also handles save/restore of the global state when switching between units.

The task handler uses the tmodule_state with some extra values (there are 4 waiting states).

As a result there is no more recursive loading of units, the compile_level is always 1 - so this variable is removed. Instead a is_initial field in tmodule which can be used to detect whether it is the first module (the only use of compile_level) Since the global state is now managed by the task list, the field globalstate was removed from tmodule, as it was no longer needed.

The routines in pmodule were split up to reflect the different waiting states that a module now can have, and the use of the current_module is removed from the routines in this unit (the current_module is still set, so it can still be used in other parts of the compiler).

this fixes at least issues #40449 and #40502

Merge request reports