mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 18:33:58 +00:00
compiler/make_hlds_passes.m:
We used to add all modules imported by an ancestor of the current module
to the set of used modules. Once upon a time, this was meant to stop
the compiler generating misleading warnings about imports being unused
when the import wasn't even done by the current module. However, since
we introduced structured representations of import- and use_module
declarations and taught unused_imports.m to use them, that has not been
an issue. However, a bad side-effect remained, which was that if
a module A imported a module B but did not use it, or it imported
module B in its interface but did not use in its interface, then
any warning we could generate about that import being unused was
suppressed by any import of module B in any of module A's ancestors.
(The "shadowing" mentioned above.)
Fix the problem by adding modules imported by ancestors of the
current module NOT to the set of used modules, but to a new field
in the module_info.
compiler/hlds_module.m:
Add this new field. As it happens, it is not needed right now,
but it may be needed later.
Update some documentation.
Note an only-tangentially-related problem.
compiler/unused_imports.m:
Fix a bug that was hiding behind the shadowing, which was that whether
the text of the warning message we generated for an unused local import-
or use_module declaration could be affected by the presence of an
import- or use_module declaration in an ancestor module.
Improve debugging infrastructure.
Make a predicate name more descriptive.
NEWS:
Announce the bugfix.
compiler/add_pragma_tabling.m:
compiler/add_solver.m:
compiler/add_type.m:
compiler/parse_string_format.m:
compiler/recompilation.usage.m:
compiler/recompilation.used_file.m:
library/io.call_system.m:
library/io.text_read.m:
library/random.sfc32.m:
library/random.sfc64.m:
library/random.system_rng.m:
library/string.parse_runtime.m:
library/string.parse_util.m:
library/string.to_string.m:
library/thread.closeable_channel.m:
mdbcomp/feedback.automatic_parallelism.m:
Delete imports that the fixed compiler now generates unused import
warnings for.
104 lines
3.6 KiB
Mathematica
104 lines
3.6 KiB
Mathematica
%-----------------------------------------------------------------------------%
|
|
% vim: ft=mercury ts=4 sw=4 et
|
|
%-----------------------------------------------------------------------------%
|
|
% Copyright (C) 2002,2003-2008 The University of Melbourne.
|
|
% This file may only be copied under the terms of the GNU General
|
|
% Public License - see the file COPYING in the Mercury distribution.
|
|
%-----------------------------------------------------------------------------%
|
|
%
|
|
% This package contains the low-level back-end
|
|
% (a.k.a. the LLDS back-end).
|
|
%
|
|
|
|
:- module ll_backend.
|
|
:- interface.
|
|
|
|
%-----------------------------------------------------------------------------%
|
|
|
|
% LLDS-specific pre-passes to transform or annotate the HLDS.
|
|
:- include_module deep_profiling. % transform
|
|
:- include_module coverage_profiling. % transform
|
|
:- include_module saved_vars. % transform
|
|
:- include_module stack_opt. % transform
|
|
:- include_module follow_code. % transform
|
|
:- include_module liveness. % annotate
|
|
:- include_module stack_alloc. % annotate
|
|
:- include_module live_vars. % annotate
|
|
:- include_module follow_vars. % annotate
|
|
:- include_module store_alloc. % annotate
|
|
|
|
% The HLDS->LLDS code generator.
|
|
:- include_module proc_gen.
|
|
:- include_module code_gen.
|
|
:- include_module unify_gen.
|
|
:- include_module unify_gen_construct.
|
|
:- include_module unify_gen_deconstruct.
|
|
:- include_module unify_gen_test.
|
|
:- include_module unify_gen_util.
|
|
:- include_module closure_gen.
|
|
:- include_module call_gen.
|
|
:- include_module pragma_c_gen.
|
|
:- include_module ite_gen.
|
|
:- include_module disj_gen.
|
|
:- include_module switch_gen.
|
|
:- include_module dense_switch.
|
|
:- include_module lookup_switch.
|
|
:- include_module string_switch.
|
|
:- include_module tag_switch.
|
|
:- include_module switch_case.
|
|
:- include_module commit_gen.
|
|
:- include_module par_conj_gen.
|
|
:- include_module middle_rec.
|
|
|
|
:- include_module code_info.
|
|
:- include_module code_loc_dep.
|
|
:- include_module var_locn.
|
|
|
|
:- include_module lookup_util.
|
|
:- include_module exprn_aux.
|
|
:- include_module continuation_info.
|
|
:- include_module trace_gen.
|
|
|
|
% An alternative HLDS->LLDS code generator for fact tables.
|
|
:- include_module fact_table.
|
|
|
|
% The LLDS data structure itself.
|
|
% :- module llds_data.
|
|
:- include_module llds.
|
|
:- include_module code_util.
|
|
:- include_module ll_pseudo_type_info.
|
|
:- include_module layout.
|
|
:- include_module stack_layout.
|
|
:- include_module prog_rep.
|
|
:- include_module prog_rep_tables.
|
|
:- include_module global_data.
|
|
% :- end_module llds_data.
|
|
|
|
% LLDS->LLDS optimization passes.
|
|
:- include_module optimize.
|
|
:- include_module jumpopt.
|
|
:- include_module dupelim.
|
|
:- include_module dupproc.
|
|
:- include_module frameopt.
|
|
:- include_module delay_slot.
|
|
:- include_module labelopt.
|
|
:- include_module stdlabel.
|
|
:- include_module peephole.
|
|
:- include_module use_local_vars.
|
|
:- include_module wrap_blocks.
|
|
:- include_module livemap.
|
|
:- include_module reassign.
|
|
:- include_module basic_block.
|
|
:- include_module opt_util.
|
|
:- include_module opt_debug.
|
|
|
|
% The LLDS->C output phase.
|
|
:- include_module transform_llds.
|
|
:- include_module llds_out.
|
|
:- include_module layout_out.
|
|
:- include_module rtti_out.
|
|
|
|
%-----------------------------------------------------------------------------%
|
|
:- end_module ll_backend.
|
|
%-----------------------------------------------------------------------------%
|