mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-18 15:26:31 +00:00
Estimated hours taken: 3.5 Branches: main Simplify the structure of the compiler by removing the cycle parse_tree -> backend_libs -> check_hlds -> parse_tree from the package dependency graph. I've done this by factoring out the code in backend_libs.foreign and backend_libs.name_mangle that is needed by the frontend of the compiler and putting it in a new module, parse_tree.prog_foreign. This removes the dependency between the parse_tree and backend_libs packages. The obvious downside to this is that the name mangler is now split in two, although such a division was always in implicit in the predicates of the name_mangle module anyway, ie. between those bits that operate on the HLDS/MLDS/LLDS level data structures and those that don't. compiler/name_mangle.m: compiler/foreign.m: compiler/prog_foreign.m: Move code for dealing with foreign language procedures that is required by the parse_tree package into a new module, prog_foreign. Update the formatting in some of these modules so that they match our current coding standard. compiler/*.m: Update to reflect the above change. compiler/notes/compiler_design.html: Include the new module. Fix some spelling errors.