mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
The remaining code of polymorphism.m is still less cohesive than
it ought to be, and could probably benefit from further reorganization
and/or breakup, but this diff is definitely a step in the right direction.
compiler/polymorphism_info.m:
A new module carved out of polymorphism.m, that defines
- the poly_info type,
- the types used in the fields in the poly_info type,
- the basic operations on the poly_info type and its component types,
- some very basic utility predicates used by several of polymorphism*.m.
It also contains the infrastructure needed for debugging the polymorphism
pass. This consists mainly of the mutables accessed from trace goals
in that pass.
Replace the bool type of one of these mutables with a bespoke type.
Attach the mutables to the I/O state, to avoid the need to make code
using those mutables semipure or impure.
compiler/polymorphism_type_info.m:
A new module carved out of polymorphism.m, that defines operations
that create type_infos, or extract type_infos from other type_infos
or typeclass_infos.
Add two new preds, polymorphism_make_type_info_{var,vars}_raw.
Unlike their old non-raw equivalents, these allow their callers to supply
module_infos, pred_infos and proc_infos without having to first construct
a poly_info from them.
compiler/polymorphism_lambda.m:
A new module carved out of polymorphism.m that manipulates lambda goals.
compiler/polymorphism.m:
Delete the code moved to the new modules.
Make the definition order of predicates in match their declaration order.
compiler/check_hlds.m:
Add the new modules to the check_hlds package.
compiler/notes/compiler_design.html:
Document the new modules. Fix some out-of-date and/or repetitive
existing documentation.
compiler/Mercury.options:
Require polymorphism.m to have matching declaration and definition orders
for its predicates.
compiler/complexity.m:
compiler/equiv_type_hlds.m:
compiler/higher_order.m:
compiler/ml_accurate_gc.m:
compiler/modecheck_goal.m:
compiler/modecheck_unify.m:
compiler/simplify_goal_unify.m:
compiler/size_prof.m:
compiler/ssdebug.m:
compiler/stm_expand.m:
compiler/table_gen.m:
compiler/try_expand.m:
Conform to the changes above.
Call polymorphism_make_type_info_{var,vars}_raw instead of their
non-raw equivalents.