Skip to content

[Refactor] Node-specific flags have been moved to their own class-specific fields

Summary

This merge request seeks to identify flags in the TNodeFlag enumeration that are specific only to one node type and moves them to fields exclusive to that node class.

This reduces the number of distinct values from 33 down to 21, thus allowing the set TNodeFlags to be stored in 4 bytes again, rather than 5, and still leave 11 bits free for future expansion without having to increase the byte size again.

Some flags, while mostly node-specific, tend to cascade through the branches and so are kept global. These are the remaining TNodeFlags:

         nf_swapable,
         nf_swapped,
         nf_error,
         nf_pass1_done,
         nf_write,
         nf_modify,
         nf_address_taken,
         nf_is_funcret,
         nf_isproperty,
         nf_processing,
         nf_no_lvalue,
         nf_usercode_entry,
         nf_absolute,
         nf_is_currency,
         nf_explicit,
         nf_internal,
         nf_load_procvar,
         nf_block_with_exit,
         nf_ignore_for_wpo,
         nf_generic_para,
         nf_do_not_execute

System

  • Processor architecture: All

Relevant logs and/or screenshots

There should be no change in code generation outside of the compiler itself (which has a number of different memory offsets and constants as a result of the changing of TNodeFlags and the PPU files).

Additional notes

Each node with specific flags has its own distinct commit, so these can be evaluated in turn if needs be.

Edited by J. Gareth "Kit" Moreton

Merge request reports