[m-dev.] breaking up modules.m

Julien Fischer juliensf at cs.mu.OZ.AU
Sun Mar 20 15:04:14 AEDT 2005

Currently modules.m is about about 7000 lines long (the second largest
file in the compiler after make_hlds.m, which is ~10000 lines long).

In the interests of maintainability and given the fact that it performs
several distinct tasks anyway, I propose that we break modules.m
up into separate files.  Below is a brief sketch of the interfaces
of the replacement modules.  I would appreciate any comments on
(a) whether this is a good idea, and (b) whether the sketch of the
interfaces of the replacement modules proposed below is acceptable.


Note: the following does not include everything exported from modules.m.

	:- pred mercury_std_library_module_name/1.
	:- pred module_name_to_file_name/6.
	:- pred module_name_to_serach_file_name/5.
	:- pred module_name_to_lib_file_name/7.
	:- pred module_name_to_split_c_file_name/6.
	:- pred module_name_to_split_c_file_pattern/7.
	:- pred fact_table_file_name/7.
	:- pred module_name_to_file_name/2.
	:- pred module_name_to_make_var_name/2
	:- func referenced_dlls/2.
	:- pred create_java_shell_script		% for the java backend
	:- pred list_class_files_for_jar		% for the java backend
	:- pred get_env_classpath
	:- pred get_install_name_option			% needed for shared libraries on Darwin
	:- pred maybe_make_symlink
	:- pred copy_file
	:- pred make_symlink_or_copy_file

	:- pred read_mod
	:- pred read_mod_if_changed
	:- pred read_mod_ignore_errors
	:- pred read_mod_from_file

	:- pred make_private_interface
	:- pred make_interface
	:- pred make_short_interface
	:- pred touch_interface_datestamp
	:- pred touch_datestamp
	:- pred update_interface/3
	:- pred update_interface/4
	:- pred pragma_allowed_in_interface
	:- pred check_for_no_exports

	:- type module_imports
	:- type contains_foreign_code
	:- type has_main
	:- type module_timestamps
	:- type module_timestamp
	:- type read_modules
	:- type read_module
	( + access preds defined for these types )

	:- pred grab_imported_modules/11.
	:- pred grab_unqual_imported_modules/8.
	:- pred process_module_private_interface
	:- pred process_module_long_interfaces
	:- pred process_module_short_interfaces
	:- pred process_module_short_interfaces_transitively
	:- pred	process_module_short_interface_and_impls_transitively

	:- pred write_dependency_file
	:- pred maybe_read_dependency_file
	:- pred generate_module_dependencies
	:- pred generate_file_dependencies
	:- pred get_dependencies
	:- pred get_implicit_dependencies
	:- pred get_ancestors

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