Cut over to the new code in file_names.m.

compiler/file_names.m:
    Delete the old code for doing filename translations, and use
    just the new code.

    Delete all the code that was needed only for comparing the old and
    new code.

    Delete the newext_other extension category, since it was also needed
    only for that purpose. Delete all the code that supported it.

    Switch the infrastructure for recording the demand for translations
    to work with the new code.

compiler/analysis.file.m:
    Delete functions that returned old-style extensions, which are
    not useful anymore. The new-style extensions, by identifying
    extensions via enums rather than strings, serve the purpose
    for which these functions were created.

compiler/mercury_compile_main.m:
    Move the code to call to write out the translation record
    from just after a call to real_main_after_expansion to the
    end of real_main_after_expansion. The reason is that the
    predicate being called now needs access to a globals structure,
    real_main_after_expansion has access to a globals structure,
    but its caller does not.

    Don't try to test the equivalence of the old and new algorithms
    for file name translation, since that test code has been deleted.

compiler/analysis.m:
compiler/compile_target_code.m:
compiler/du_type_layout.m:
compiler/export.m:
compiler/fact_table.m:
compiler/file_kind.m:
compiler/generate_dep_d_files.m:
compiler/grab_modules.m:
compiler/llds_out_file.m:
compiler/make.build.m:
compiler/make.module_dep_file.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.track_flags.m:
compiler/make.util.m:
compiler/mercury_compile_front_end.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mercury_compile_make_hlds.m:
compiler/mercury_compile_middle_passes.m:
compiler/mercury_compile_mlds_back_end.m:
compiler/mlds_to_c_file.m:
compiler/mlds_to_cs_file.m:
compiler/mlds_to_java_file.m:
compiler/mmc_analysis.m:
compiler/mode_constraints.m:
compiler/module_cmds.m:
compiler/prog_foreign.m:
compiler/read_modules.m:
compiler/recompilation.used_file.m:
compiler/write_deps_file.m:
compiler/write_module_interface_files.m:
compiler/xml_documentation.m:
    Conform to the changes in file_names.m.
This commit is contained in:
Zoltan Somogyi
2023-07-04 18:22:42 +02:00
parent 3d756f61cd
commit 0b60f07c46
35 changed files with 505 additions and 1842 deletions

View File

@@ -199,7 +199,6 @@ do_get_module_dependencies(Globals, RebuildModuleDeps, ModuleName,
MaybeSourceFileTimestamp, !Info, !IO),
module_name_to_file_name(Globals, $pred, do_not_create_dirs,
ext_other(make_module_dep_file_extension),
newext_misc_ngs(ext_misc_ngs_module_dep),
ModuleName, DepFileName, !IO),
globals.lookup_accumulating_option(Globals, search_directories,
@@ -353,7 +352,6 @@ do_write_module_dep_file(Globals, BurdenedModule, !IO) :-
BurdenedModule = burdened_module(Baggage, ParseTreeModuleSrc),
ModuleName = ParseTreeModuleSrc ^ ptms_module_name,
module_name_to_file_name(Globals, $pred, do_create_dirs,
ext_other(make_module_dep_file_extension),
newext_misc_ngs(ext_misc_ngs_module_dep),
ModuleName, ProgDepFile, !IO),
io.open_output(ProgDepFile, ProgDepResult, !IO),
@@ -513,7 +511,6 @@ read_module_dependencies_no_search(Globals, RebuildModuleDeps, ModuleName,
read_module_dependencies_2(Globals, RebuildModuleDeps, SearchDirs, ModuleName,
!Info, !IO) :-
module_name_to_search_file_name(Globals, $pred,
ext_other(make_module_dep_file_extension),
newext_misc_ngs(ext_misc_ngs_module_dep),
ModuleName, ModuleDepFile, !IO),
search_for_file_returning_dir_and_stream(SearchDirs, ModuleDepFile,
@@ -918,8 +915,7 @@ make_module_dependencies_fatal_error(Globals, OldOutputStream, ErrorStream,
Globals, UnredirectGlobals),
unredirect_output(UnredirectGlobals, ModuleName, ErrorStream, !Info, !IO),
module_name_to_file_name(Globals, $pred, do_not_create_dirs,
ext_other(other_ext(".err")), newext_user(ext_user_err),
ModuleName, ErrFileName, !IO),
newext_user(ext_user_err), ModuleName, ErrFileName, !IO),
io.file.remove_file(ErrFileName, _, !IO),
ModuleDepMap0 = make_info_get_module_dependencies(!.Info),
@@ -1057,7 +1053,6 @@ cleanup_module_dep_files(Globals, ModuleNames, !Info, !IO) :-
cleanup_module_dep_file(Globals, ModuleName, !Info, !IO) :-
remove_make_module_file(Globals, verbose_make, ModuleName,
ext_other(make_module_dep_file_extension),
newext_misc_ngs(ext_misc_ngs_module_dep), !Info, !IO).
:- pred maybe_write_importing_module(module_name::in,