mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-17 06:47:17 +00:00
Estimated hours taken: 2 Improve the modularity of the code in purity.m by splitting it into two modules and fix a purity-related bug by moving some code from typecheck.m into the new module. compiler/post_typecheck.m: New module. Handles the typechecking stuff that happens after typecheck.m. compiler/purity.m: Move the typechecking related code in purity.m into post_typecheck.m. compiler/typecheck.m: Move the code for copying clauses to the proc_infos, etc. into new predicates in post_typecheck.m. This code is now called from purity.m rather than from typecheck.m. (I think the fact that it was being done in typecheck.m was a bug -- it meant that the goal_info flags computed by purity.m were not being copied across to the proc_infos.) compiler/mercury_compile.m: compiler/typecheck.m: Don't pass the ModeError parameter down to typecheck_pred, since with the above change it isn't needed anymore. compiler/mercury_compile.m: Run purity checking before writing the `.opt' files. This is necessary because writing out the `.opt' files requires that code in post_typecheck__finish_pred (formerly in typecheck.m) has been run. compiler/notes/compiler_design.html: Document these changes.