Estimated hours taken: 8
Branches: main
Allow arbitrary mappings from source file name to module name.
The mapping is created using the command `mmc -f *.m', which must
be run before `mmake depend'.
compiler/parse_tree.m:
compiler/source_file_map.m:
compiler/notes/compiler_design.html:
Add a new module to read, write and search the mapping.
compiler/modules.m:
Use the source file map when searching for source files.
Export `make_directory' for use by source_file_map.m.
Use the module name rather than the source file name to
generate the executable name. This matches the documentation
in the User's Guide, and it's needed to make the tests work.
compiler/prog_io.m:
Separate out the code to read the first item in a module to
find the module name into a new predicate, `find_module_name'.
compiler/handle_options.m:
Don't complain about the module name not matching the file
name when generating the Mercury.modules file -- the file
only needs to be generated when the module name doesn't
match the file name.
compiler/llds_out.m:
Remove a duplicate copy of `make_directory'.
compiler/options.m:
compiler/mercury_compile.m:
doc/user_guide.texi:
Add the `--generate-source-file-mapping' (-f) option
to generate the mapping.
NEWS:
Document the change.
tests/hard_coded/Mmakefile:
tests/hard_coded/source_file_map.m:
tests/hard_coded/mapped_module.exp:
Test case.
The main aim of this change is to make the overall, high-level structure
of the compiler clearer, and to encourage better encapsulation of the
major components.
compiler/libs.m:
compiler/backend_libs.m:
compiler/parse_tree.m:
compiler/hlds.m:
compiler/check_hlds.m:
compiler/transform_hlds.m:
compiler/bytecode_backend.m:
compiler/aditi_backend.m:
compiler/ml_backend.m:
compiler/ll_backend.m:
compiler/top_level.m:
New files. One module for each of the major components of the
Mercury compiler. These modules contain (as separate sub-modules)
all the other modules in the Mercury compiler, except gcc.m and
mlds_to_gcc.m.
Mmakefile:
compiler/Mmakefile:
Handle the fact that the top-level module is now `top_level',
not `mercury_compile' (since `mercury_compile' is a sub-module
of `top_level').
compiler/Mmakefile:
Update settings of *FLAGS-<modulename> to use the appropriate
nested module names.
compiler/recompilation_check.m:
compiler/recompilation_version.m:
compiler/recompilation_usage.m:
compiler/recompilation.check.m:
compiler/recompilation.version.m:
compiler/recompilation.version.m:
Convert the `recompilation_*' modules into sub-modules of the
`recompilation' module.
compiler/*.m:
compiler/*.pp:
Module-qualify the module names in `:- module', `:- import_module',
and `:- use_module' declarations.
compiler/base_type_info.m:
compiler/base_type_layout.m:
Deleted these unused empty modules.
compiler/prog_data.m:
compiler/globals.m:
Move the `foreign_language' type from prog_data to globals.
compiler/mlds.m:
compiler/ml_util.m:
compiler/mlds_to_il.m:
Import `globals', for `foreign_language'.
Mmake.common.in:
trace/Mmakefile:
runtime/Mmakefile:
Rename the %.check.c targets as %.check_hdr.c,
to avoid conflicts with compiler/recompilation.check.c.