[m-dev.] for review: move code_model to new module

Peter Ross peter.ross at miscrit.be
Tue Nov 21 20:47:52 AEDT 2000


On Mon, Nov 20, 2000 at 04:56:48PM +1100, Fergus Henderson wrote:
> Estimated hours taken: 6
> 
> Eliminated a lot of the dependencies on the the `code_model' type,
> and move that type from llds.m into a new module `code_model'.
> The aim of this change is to improve the modularity of the compiler by
> reducing the number of places in the compiler front-end that depend
> on back-end concepts and the number of places in the MLDS back-end
> which depend on the LLDS.
> 
> compiler/code_model.m:
> 	New module.  Contains the code_model type and associated
> 	procedures.
> 
> compiler/llds.m:
> 	Move the code_model type into code_model.m.
> 
> compiler/hlds_goal.m:
> 	Move the goal_info_get_code_model procedure into code_model.m,
> 	to avoid having the HLDS modules import code_model.
> 
> compiler/hlds_pred.m:
> 	Move the proc_info_interface_code_model procedure into code_model.m,
> 	to avoid having the HLDS modules import code_model.
> 
> compiler/hlds_out.m:
> 	Delete `hlds_out__write_code_model', since it wasn't being used.
> 
> compiler/goal_path.m:
> 	When computing the `maybe_cut' field for `some' goals,
> 	compute it by comparing the determinism rather than by
> 	comparing the goal_infos.
> 
> compiler/unique_modes.m:
> 	Use determinism and test for soln_count = at_most_many
> 	rather than using code_model and testing for model_non.
> 
> compiler/inlining.m:
> 	Test for determinism nondet/multi rather than testing
> 	for code_model model_non.
> 
> compiler/hlds_pred.m:
> compiler/det_report.m:
> 	Change valid_code_model_for_eval_method, which succeeded unless
> 	the eval_method was minimal_model and the code_model was model_det,
> 	to valid_determinism_for_eval_method, which succeeds unless the
> 	eval_method is minimal_model and the determinism cannot fail.
> 	As well as avoiding a dependency on code_model in the HLDS
> 	modules, this also fixes a bug where det_report could give
> 	misleading error messages, saying that `multi' was a valid
> 	determinism for `minimal_model' predicates, when in fact the
> 	compiler will always report a determinism error if you declare
> 	a `minimal_model' predicate with determinism `multi'.
> 	(Actually the code in which this bug occurs is in fact
> 	unreachable, but this is no doubt also a bug... I'll address
> 	that one in a separate change.)
> 
> compiler/lookup_switch.m:
> 	Simplify the code a bit by using globals__lookup_*_option
> 	rather than globals__get_option and then getopt__lookup_option.
> 
> compiler/*.m:
> 	Add `import_module' declarations for `code_model', and in some
> 	cases remove `import_module' declarations for `llds'.
> 
This looks fine.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list