Files
mercury/compiler/transform_hlds.m
Zoltan Somogyi cc9912faa8 Don't import anything in packages.
Packages are modules whose only job is to serve as a container for submodules.
Modules like top_level.m, hlds.m, parse_tree.m and ll_backend.m are packages
in this (informal) sense.

Besides the include_module declarations for their submodules, most of the
packages in the compiler used to import some modules, mostly other packages
whose component modules their submodules may need. For example, ll_backend.m
used to import parse_tree.m. This meant that modules in the ll_backend package
did not have to import parse_tree.m before importing modules in the parse_tree
package.

However, this had a price. When we add a new module to the parse_tree package,
parse_tree.int would change, and this would require the recompilation of ALL
the modules in the ll_backend package, even the ones that did NOT import ANY
of the modules in the parse_tree package.

This happened even at one remove. Pretty much all modules in every one
of the backend have to import one or more modules in the hlds package,
and they therefore have import hlds.m. Since hlds.m imported transform_hlds.m,
any addition of a new middle pass to the transform_hlds package required
the recompilation of all backend modules, even in the usual case of the two
having nothing to do with each other.

This diff removes all import_module declarations from the packages,
and replaces them with import_module declarations in the modules that need
them. This includes only a SUBSET of their child modules and of the non-child
modules that import them.
2015-11-13 15:03:20 +11:00

105 lines
3.1 KiB
Mathematica

%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
% Copyright (C) 2002-2008, 2012 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.
%-----------------------------------------------------------------------------%
%
% transform_hlds: High-level transformations that are independent
% of the choice of back-end (the "middle" HLDS pass).
%
:- module transform_hlds.
:- interface.
%-----------------------------------------------------------------------------%
:- include_module intermod.
:- include_module dependency_graph.
:- include_module equiv_type_hlds.
:- include_module table_gen.
:- include_module complexity.
:- include_module (lambda).
:- include_module stm_expand.
:- include_module closure_analysis.
:- include_module termination.
:- include_module term_pass1.
:- include_module term_pass2.
:- include_module term_traversal.
:- include_module term_errors.
:- include_module term_norm.
:- include_module term_util.
:- include_module ssdebug.
:- include_module transform_hlds.ctgc.
:- include_module transform_hlds.rbmm.
:- include_module transform_hlds.smm_common.
:- include_module term_constr_main.
:- include_module term_constr_initial.
% Pass 1.
:- include_module term_constr_build.
:- include_module term_constr_fixpoint.
% Pass 2.
:- include_module term_constr_pass2.
% Other bits.
:- include_module term_constr_main_types.
:- include_module term_constr_util.
:- include_module term_constr_data.
:- include_module term_constr_errors.
:- include_module post_term_analysis.
:- include_module exception_analysis.
:- include_module trailing_analysis.
:- include_module tabling_analysis.
% Mostly optimizations (HLDS -> HLDS)
:- include_module higher_order.
:- include_module inlining.
:- include_module deforest.
:- include_module constraint.
:- include_module pd_cost.
:- include_module pd_debug.
:- include_module pd_info.
:- include_module pd_term.
:- include_module pd_util.
:- include_module delay_construct.
:- include_module unused_args.
:- include_module unneeded_code.
:- include_module accumulator.
:- include_module goal_store.
:- include_module dead_proc_elim.
:- include_module const_prop.
:- include_module loop_inv.
:- include_module size_prof.
:- include_module tupling.
:- include_module untupling.
:- include_module distance_granularity.
:- include_module granularity.
:- include_module dep_par_conj.
:- include_module parallel_to_plain_conj.
:- include_module implicit_parallelism.
:- include_module par_loop_control.
:- include_module lco.
:- include_module float_regs.
:- include_module mmc_analysis.
% XXX The following modules are all currently unused.
:- include_module transform.
%-----------------------------------------------------------------------------%
:- end_module transform_hlds.
%-----------------------------------------------------------------------------%