Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
b54ab42d70 A simple tool for performing substitutions on the source files of the
Estimated hours taken: 0.5
Branches: main

tools/subst:
	A simple tool for performing substitutions on the source files of the
	compiler.

compiler/*.m:
	Change the names of the get predicates operating on module_infos to
	include "get" in the name, for uniformity. This was done mostly by
	the following sed script, with some manual cleanup afterwards to reduce
	excessive line lengths.

s/module_info_types/module_info_get_type_table/
s/module_info_set_types/module_info_set_type_table/
s/module_info_insts/module_info_get_inst_table/
s/module_info_set_insts/module_info_set_inst_table/
s/module_info_modes/module_info_get_mode_table/
s/module_info_set_modes/module_info_set_mode_table/
s/module_info_ctors/module_info_get_cons_table/
s/module_info_set_ctors/module_info_set_cons_table/
s/module_info_classes/module_info_get_class_table/
s/module_info_set_classes/module_info_set_class_table/
s/module_info_instances/module_info_get_instance_table/
s/module_info_set_instances/module_info_set_instance_table/
s/module_info_superclasses/module_info_get_superclass_table/
s/module_info_set_superclasses/module_info_set_superclass_table/
s/module_info_assertion_table/module_info_get_assertion_table/
s/module_info_exclusive_table/module_info_get_exclusive_table/
s/module_info_ctor_field_table/module_info_get_ctor_field_table/
s/module_info_name/module_info_get_name/
s/module_info_globals/module_info_get_globals/
s/module_info_contains_foreign_types/module_info_get_contains_foreign_types/
s/module_info_num_errors/module_info_get_num_errors/
s/module_info_type_ctor_gen_infos/module_info_get_type_ctor_gen_infos/
s/module_info_stratified_preds/module_info_get_stratified_preds/
s/module_info_unused_arg_info/module_info_get_unused_arg_info/
s/module_info_exception_info/module_info_get_exception_info/
s/module_info_type_spec_info/module_info_get_type_spec_info/
s/module_info_no_tag_types/module_info_get_no_tag_types/
s/module_info_analysis_info/module_info_get_analysis_info/
s/module_info_aditi_top_down_procs/module_info_get_aditi_top_down_procs/
2005-09-30 08:08:49 +00:00
Zoltan Somogyi
6df9a05856 This diff cleans up a bunch of modules. It has no algorithmic changes
Estimated hours taken: 10
Branches: main

This diff cleans up a bunch of modules. It has no algorithmic changes
other than in the formatting of error messages.

compiler/error_util.m:
	Delete the obsolete predicate append_punctuation, since the suffix
	format component can now do more, and do it more easily.

compiler/goal_util.m:
compiler/hlds_goal.m:
compiler/hlds_llds.m:
compiler/instmap.m:
compiler/const_prop.m:
	Change the argument order of some the predicates exported by these
	modules to make them easier to use with state variable syntax.

compiler/*.m:
	Convert a bunch of these modules to four space indentation, and fix
	departures from our coding style.

	Conform to the changed argument order above.

	Use suffixes instead of append_punctuation.

library/string.m:
	Add string.foldl2.

tests/invalid/circ_*.err_exp:
tests/warnings/unused_args_*.exp:
	Expect the updated error messages, which format sym_names consistently
	the same way as other messages.
2005-08-30 04:12:17 +00:00
Zoltan Somogyi
10536c5ee0 Divide make_hlds.m into submodules of manageable size.
Estimated hours taken: 12
Branches: main

Divide make_hlds.m into submodules of manageable size.

compiler/make_hlds.m:
	Distribute all the code that was previously here to new submodules.
	Include those submodules. Keep the existing interface of this module
	by defining predicates that do nothing except call the actual
	implementation in one of those submodules. The only changes visible
	from outside are the renaming of a predicate and the creation of a
	second name, make_hlds_qual_info, for qual_info. Both changes are
	designed to avoid ambiguity in the presence of intermodule
	optimization.

compiler/add_aditi.m:
	Submodule for dealing with aditi-specific issues.

compiler/add_class.m:
	Submodule for handling typeclasses.

compiler/add_clause.m:
	Submodule for handling the general processing of clauses.

compiler/add_pred.m:
	Submodule for handling new predicates.

compiler/add_special_pred.m:
	Submodule for handling special (unify/compare/index/init) predicates.

compiler/add_type.m:
	Submodule for handling new types.

compiler/add_mode.m:
	Submodule for handling new insts and modes.

compiler/add_solver.m:
	Submodule for handling new solver types.

compiler/add_pragma.m:
	Submodule for handling new pragmas.

compiler/state_var.m:
	Submodule for handling the state variable transformation.

compiler/superhomogeneous.m:
	Submodule for converting clauses to superhomogeneous form.

compiler/field_access.m:
	Submodule for field access syntax.

compiler/make_hlds_passes.m:
	Submodule containing the code that performs passes on the item list,
	adding things to the HLDS, calling the other submodules as necessary.

compiler/make_hlds_warn.m:
	Submodule that looks for constructs that merit warnings.

compiler/make_hlds_error.m:
	Submodule containing error messages used by more than one submodule.

compiler/hlds_pred.m:
	Since this module defines the clauses_info and proc_id types, move
	the predicates that initialize values of that type here as well from
	make_hlds.m (deleting an unnecessary parameter from one).

compiler/hlds_pred.m:
compiler/prog_data.m:
	Move the type tvar_name_map from from hlds_pred.m to prog_data.m,
	since that is where similar maps are.

compiler/check_typeclass.m:
compiler/mercury_compile.m:
	Conform to the change to make_hlds_qual_info.

compiler/hlds_out.m:
compiler/prog_out.m:
	Replace two identical predicates for printing out lists of strings
	in hlds_out.m and make_hlds.m with just one in prog_out.m, since that
	is where it belongs in the compiler.

compiler/prog_util.m:
	Move some utility predicates for substitutions and term recognition
	here from make_hlds.m, since they are needed by more than one
	submodule.

	Make this module conform to our coding guidelines, and convert it to
	four-space indentation to eliminate bad line breaks.

compiler/clause_to_proc.m:
compiler/hlds_code_util.m:
compiler/make_tags.m:
compiler/prog_mode.m:
compiler/quantification.m:
compiler/type_util.m:
	Trivial formatting changes.

compiler/notes/compiler_design.html:
	Describe the new modules.
2005-07-26 01:56:30 +00:00