[m-rev.] for review: make compiler use sub-modules
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Mar 6 06:32:16 AEDT 2002
This is just for discussion. I don't plan to commit this version.
Instead, I plan to get rid of the top-level `mc' module introduced
in this diff, and instead create separate top-level modules for each
of the major components (which are sub-modules of `mc' in this diff).
I'll also clean up the long lines introduced in this diff.
----------
Estimated hours taken: 60
Use sub-modules to structure the modules in the Mercury compiler directory.
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/mc.m:
New file. This contains the top-level module for the Mercury
compiler, and nested sub-modules for all the major components.
compiler/*.m:
Module-qualify the module names in `:- module', `:- import_module',
and `:- use_module' declarations.
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'.
cvs diff: Diffing .
Index: mc.m
===================================================================
RCS file: mc.m
diff -N mc.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ mc.m 5 Mar 2002 16:29:51 -0000
@@ -0,0 +1,515 @@
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+
+:- module mc.
+:- interface.
+
+%-----------------------------------------------------------------------------%
+%
+% This package contains general utilities that are used by other packages.
+%
+
+:- module libs.
+:- interface.
+:- import_module mc__ll_backend. % XXX trace_params depends on llds__trace_port.
+
+% option handling
+:- include_module globals, options, handle_options, trace_params.
+
+% generic algorithms and data structures that are not
+% quite useful enough to go in the standard library
+:- include_module tree, graph_colour, atsort.
+
+:- end_module libs.
+
+%-----------------------------------------------------------------------------%
+%
+% Phase 1: create the Parse Tree.
+%
+
+:- module parse_tree.
+:- interface.
+:- import_module mc__libs.
+:- import_module mc__hlds. % XXX for hlds_data__cons_id
+:- import_module mc__backend_libs. % XXX for `foreign'
+
+% The parse tree data type itself.
+:- include_module prog_data, (inst).
+ % XXX inst uses hlds_data__cons_id
+
+% The parser.
+:- include_module prog_io.
+ :- include_module prog_io_goal, prog_io_dcg, prog_io_pragma.
+ :- include_module prog_io_typeclass, prog_io_util.
+
+% Pretty-printers.
+:- include_module prog_out, mercury_to_mercury.
+
+% Utility routines.
+:- include_module prog_util.
+
+% Transformations that act on the parse tree,
+% and stuff relating to the module system.
+:- include_module equiv_type.
+:- include_module modules, module_qual.
+
+% (Note that intermod and trans_opt also contain routines that
+% act on the parse tree, but those modules are considered part
+% of the HLDS transformations package.)
+% :- include_module intermod, trans_opt.
+
+% :- implementation.
+
+% XXX lots of stuff uses hlds_data__type_id and type_util.m.
+% XXX modules.m uses llds_out for the init names.
+
+:- end_module parse_tree.
+
+%-----------------------------------------------------------------------------%
+%
+% Phase 2: build the HLDS.
+% This phase also includes quite a bit of error checking
+% and a tiny bit of semantic analysis (quantification).
+%
+
+:- module hlds.
+:- interface.
+:- import_module mc__parse_tree, mc__libs.
+:- import_module mc__check_hlds. % needed for unify_proc__unify_proc_id,
+ % etc.
+:- import_module mc__transform_hlds. % needed for term_util, etc.
+:- import_module mc__backend_libs. % XXX needed for rtti
+:- import_module mc__ll_backend. % XXX needed for `llds__lval',
+ % which is used in various annotations
+ % in the HLDS (stack_slots, follow_vars, etc.)
+
+% The HLDS data structure itself
+:- include_module hlds_data, hlds_goal, hlds_pred, hlds_module.
+:- include_module instmap.
+:- include_module (assertion), special_pred.
+
+% Modules for creating the HLDS
+:- include_module make_hlds, make_tags.
+:- include_module quantification.
+
+% Modules for pretty-printing it.
+:- include_module hlds_out.
+
+% Miscellaneous utilities.
+:- include_module passes_aux, error_util.
+:- include_module goal_util. % XXX goal_util imports code_aux.m
+:- include_module hlds_code_util. % XXX currently code_util.m
+
+%:- module smart_recompilation.
+ :- include_module recompilation.
+ :- include_module recompilation_check.
+ :- include_module recompilation_usage.
+ :- include_module recompilation_version.
+ :- include_module timestamp.
+%:- module smart_recompilation.
+
+:- end_module hlds.
+
+%-----------------------------------------------------------------------------%
+%
+% Phase 3: Semantic analysis and error checking
+% (the "front end" HLDS pass).
+%
+
+:- module check_hlds.
+:- interface.
+:- import_module mc__hlds, mc__parse_tree, mc__libs.
+:- import_module mc__backend_libs. % for base_typeclass_info, etc.
+%:- import_module mc__check_hlds__type_analysis, mc__check_hlds__mode_analysis.
+
+% Type checking
+%:- module type_analysis.
+ :- include_module check_typeclass, typecheck, purity, post_typecheck.
+ :- include_module type_util.
+%:- end_module type_analysis.
+
+% Polymorphism transformation.
+:- include_module polymorphism.
+:- include_module clause_to_proc.
+
+% Mode analysis
+%:- module mode_analysis.
+ :- include_module modes, modecheck_unify, modecheck_call.
+ :- include_module mode_info, delay_info, inst_match.
+ :- include_module inst_util, mode_errors, mode_util, mode_debug.
+ :- include_module unique_modes.
+ :- include_module unify_proc.
+%:- end_module mode_analysis.
+
+% Indexing and determinism analysis
+:- include_module switch_detection, cse_detection, det_analysis.
+:- include_module det_report, det_util.
+
+% Stratification.
+:- include_module stratify.
+
+% Warnings about simple code
+:- include_module simplify, common.
+
+:- include_module goal_path.
+
+:- end_module check_hlds.
+
+%-----------------------------------------------------------------------------%
+%
+% Phase 4: High-level transformations
+% that are independent of the choice of back-end
+% (the "middle" HLDS pass).
+%
+
+:- module transform_hlds.
+:- interface.
+:- import_module mc__check_hlds. % is this needed?
+:- import_module mc__hlds, mc__parse_tree, mc__libs.
+
+:- include_module intermod, trans_opt.
+
+:- include_module dependency_graph. % XXX imports llds (for profiling labels)
+
+:- include_module table_gen.
+
+:- include_module (lambda).
+
+:- include_module termination.
+ :- include_module term_pass1, term_pass2, term_traversal, term_errors.
+ :- include_module term_util.
+ :- include_module lp. % this could alternatively go in the `libs' module
+
+% Optimizations (HLDS -> HLDS)
+:- include_module higher_order.
+:- include_module inlining.
+:- include_module deforest.
+ :- include_module pd_cost, pd_debug, pd_info, 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.
+
+% XXX The following modules are all currently unused.
+:- include_module constraint, transform.
+:- include_module excess.
+:- include_module lco.
+
+:- end_module transform_hlds.
+
+%-----------------------------------------------------------------------------%
+%
+% Back-end libraries.
+%
+% This package contains utility modules that are each used by
+% several different back-ends.
+%
+:- module backend_libs.
+:- interface.
+:- import_module mc__transform_hlds, mc__check_hlds. % are these needed?
+:- import_module mc__hlds, mc__parse_tree, mc__libs.
+
+% modules that provide functionality used by several different back-ends
+:- include_module builtin_ops.
+:- include_module bytecode_data.
+:- include_module c_util.
+:- include_module code_model.
+:- include_module switch_util.
+:- include_module rtti, type_ctor_info, pseudo_type_info, base_typeclass_info.
+:- include_module foreign.
+
+:- end_module backend_libs.
+
+%-----------------------------------------------------------------------------%
+%
+% Phase 5-bc: The bytecode generator
+%
+:- module bytecode_backend.
+:- interface.
+:- import_module mc__transform_hlds, mc__check_hlds. % are these needed?
+:- import_module mc__hlds, mc__parse_tree, mc__libs, mc__backend_libs.
+
+:- include_module bytecode, bytecode_gen.
+
+:- end_module bytecode_backend.
+
+%-----------------------------------------------------------------------------%
+%
+% The Aditi back-end
+%
+:- module aditi_backend.
+:- interface.
+:- import_module mc__transform_hlds, mc__check_hlds. % are these needed?
+:- import_module mc__hlds, mc__parse_tree, mc__libs.
+
+%:- import_module mc__aditi_hlds, mc__aditi_codegen, mc__aditi_rl_out.
+
+%
+% Phase 4-rl: Aditi-related HLDS transformations
+%
+%:- module aditi_hlds.
+% :- interface.
+ :- include_module dnf.
+ :- include_module magic, magic_util.
+ :- include_module context.
+%:- end_module aditi_hlds.
+
+%
+% The Aditi-RL type itself.
+%
+:- include_module rl.
+:- include_module rl_dump.
+
+%
+% Phase 5-rl: The Aditi RL code generator
+%
+%:- module aditi_codegen.
+% :- interface.
+ :- include_module rl_gen.
+ :- include_module rl_info.
+ :- include_module rl_relops.
+%:- end_module aditi_codegen.
+
+%
+% Phase 6-rl: Low-level (RL -> RL) optimizations
+%
+:- include_module rl_opt.
+ :- include_module rl_block, rl_analyse, rl_liveness, rl_loop, rl_block_opt.
+ :- include_module rl_key, rl_sort, rl_stream.
+
+%
+% Phase 7-rl: Emit RL bytecodes.
+%
+%:- module aditi_rl_out.
+ :- include_module rl_out, rl_exprn, rl_code, rl_file.
+%:- end_module aditi_rl_out.
+
+:- end_module aditi_backend.
+
+%-----------------------------------------------------------------------------%
+%
+% The medium-level code generator
+%
+:- module ml_backend.
+:- interface.
+:- import_module mc__transform_hlds, mc__check_hlds. % are these needed?
+:- import_module mc__hlds, mc__parse_tree, mc__libs, mc__backend_libs.
+:- import_module mc__ll_backend. % XXX needed for llds_out__name_mangle, etc.
+
+:- include_module mlds.
+:- include_module ml_util.
+
+% Phase 4-ml: MLDS-specific HLDS to HLDS transformations and annotations.
+:- include_module add_heap_ops, add_trail_ops. % transformations
+:- include_module mark_static_terms. % annotation
+
+% Phase 5-ml: compile HLDS to MLDS
+:- include_module ml_code_gen.
+ :- include_module ml_type_gen.
+ :- include_module ml_call_gen.
+ :- include_module ml_unify_gen, ml_closure_gen.
+ :- include_module ml_switch_gen.
+ :- include_module ml_string_switch, ml_tag_switch, ml_simplify_switch.
+:- include_module ml_code_util.
+:- include_module rtti_to_mlds.
+
+% Phase 6-ml: MLDS -> MLDS transformations
+:- include_module ml_elim_nested.
+:- include_module ml_tailcall.
+:- include_module ml_optimize.
+
+% Phase 7-ml: compile MLDS to target code
+
+% MLDS->C back-end
+:- include_module mlds_to_c.
+
+% MLDS->Assembler back-end
+:- include_module maybe_mlds_to_gcc.
+% :- include_module mlds_to_gcc, gcc.
+
+% MLDS->Java back-end
+:- include_module mlds_to_java, java_util.
+
+% MLDS->.NET CLR back-end
+:- include_module mlds_to_il.
+:- include_module mlds_to_ilasm.
+:- include_module mlds_to_csharp.
+:- include_module mlds_to_mcpp.
+:- include_module ilds.
+:- include_module ilasm.
+:- include_module il_peephole.
+
+:- end_module ml_backend.
+
+%-----------------------------------------------------------------------------%
+%
+% Phase 5c: The low-level code generator
+%
+:- module ll_backend.
+:- interface.
+:- import_module mc__transform_hlds, mc__check_hlds. % are these needed?
+:- import_module mc__hlds, mc__parse_tree, mc__libs, mc__backend_libs.
+:- import_module mc__aditi_backend. % XXX for rl_file, used in llds_out.
+
+% Pre-passes to transform or annotate the HLDS
+% (XXX these are not listed in right order)
+:- include_module saved_vars. % transform
+:- include_module arg_info. % annotate
+:- include_module liveness. % annotate
+:- include_module live_vars. % annotate
+:- include_module follow_code. % transform
+:- include_module follow_vars. % annotate
+:- include_module store_alloc. % annotate
+:- include_module deep_profiling. % transform
+
+% The llds data structure itself
+:- include_module llds.
+:- include_module code_util. % XXX
+
+% The HLDS->LLDS code generator.
+:- include_module code_gen.
+ :- include_module ite_gen, call_gen, disj_gen, unify_gen, commit_gen.
+ :- include_module switch_gen.
+ :- include_module dense_switch.
+ :- include_module lookup_switch.
+ :- include_module string_switch.
+ :- include_module tag_switch.
+ :- include_module pragma_c_gen, par_conj_gen.
+ :- include_module middle_rec.
+ :- include_module trace.
+
+ :- include_module code_info.
+ :- include_module code_exprn.
+ :- include_module exprn_aux.
+ :- include_module code_aux. % XXX
+ :- include_module continuation_info.
+ :- include_module var_locn.
+
+% An alternative HLDS->LLDS code generator for fact tables.
+:- include_module fact_table.
+
+%:- module llds_rtti.
+ :- include_module ll_pseudo_type_info.
+ :- include_module layout.
+ :- include_module stack_layout, prog_rep.
+ :- include_module static_term.
+%:- end_module llds_rtti.
+
+% LLDS->LLDS optimization passes.
+:- include_module optimize.
+ :- include_module jumpopt, dupelim, frameopt, delay_slot, labelopt, peephole.
+ :- include_module wrap_blocks, use_local_vars.
+% :- include_module value_number.
+% :- include_module vn_block.
+% :- include_module vn_cost.
+% :- include_module vn_debug.
+% :- include_module vn_filter.
+% :- include_module vn_flush.
+% :- include_module vn_order.
+% :- include_module vn_temploc.
+% :- include_module vn_util.
+% :- include_module vn_verify.
+% :- include_module vn_type.
+% :- include_module vn_table.
+ :- include_module llds_common.
+ :- include_module livemap, basic_block, opt_util, 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.
+
+%-----------------------------------------------------------------------------%
+
+:- module top_level.
+:- interface.
+
+% the front-ends
+:- import_module mc__parse_tree, mc__hlds, mc__check_hlds, mc__transform_hlds.
+
+% back-ends that we currently use or plan to use
+:- import_module mc__aditi_backend, mc__ll_backend, mc__ml_backend.
+
+% obsolete or incomplete back-ends
+:- import_module mc__bytecode_backend.
+
+% misc utilities
+:- import_module mc__libs, mc__backend_libs.
+
+:- include_module mercury_compile.
+:- include_module export.
+
+:- end_module top_level.
+
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+
+:- implementation.
+
+% main --> mc__top_level__mercury_compile__main.
+
+%-----------------------------------------------------------------------------%
+
+:- module hlds.
+:- implementation.
+:- import_module mc__aditi_backend. % XXX for rl__get_entry_proc_name,
+ % which is used by hlds_out.m to dump
+ % aditi_call goals.
+:- end_module hlds.
+
+:- module parse_tree.
+:- implementation.
+:- import_module mc__check_hlds. % XXX for type_util.m
+:- import_module mc__transform_hlds. % XXX for write_pragma_termination_info
+ % in termination.m, which is used by
+ % mercury_to_mercury.m
+:- import_module mc__ll_backend. % XXX for llds_out.m, which is used
+ % by modules__append_to_init_list,
+ % which creates the LLDS and RL
+ % initialization code.
+:- end_module parse_tree.
+
+:- module check_hlds.
+:- implementation.
+:- import_module mc__transform_hlds. % for pd_cost, etc.
+:- import_module mc__ll_backend. % XXX for code_util, code_aux
+:- end_module check_hlds.
+
+:- module transform_hlds.
+:- implementation.
+:- import_module mc__ll_backend. % XXX for code_util, code_aux
+:- import_module mc__backend_libs. % XXX for rtti
+:- end_module transform_hlds.
+
+:- module backend_libs.
+:- implementation.
+:- import_module mc__ll_backend. % XXX for llds_out__name_mangle.
+:- end_module backend_libs.
+
+:- module aditi_backend.
+:- implementation.
+ % aditi_backend__rl_exprn uses ll_backend__llds
+ % and backend_libs__builtin_ops.
+:- import_module mc__ll_backend.
+:- import_module mc__backend_libs.
+:- end_module aditi_backend.
+
+:- module bytecode_backend.
+:- implementation.
+ % bytecode_gen uses ll_backend__call_gen.m
+:- import_module mc__ll_backend.
+:- end_module bytecode_backend.
+
+%-----------------------------------------------------------------------------%
+
+:- end_module mc.
+
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.50
diff -u -d -u -r1.50 Mmakefile
--- Mmakefile 14 Jan 2002 04:59:34 -0000 1.50
+++ Mmakefile 5 Mar 2002 18:58:53 -0000
@@ -192,13 +192,16 @@
#-----------------------------------------------------------------------------#
# targets
-#
+
+# specify the name of the top-level module to build
+MC_PROG=mc
+
# mercury_compile
.PHONY: depend
-depend: mercury_compile.depend
+depend: $(MC_PROG).depend
-mercury_compile.depend: regenerate_preprocessed_files
+mc.depend: regenerate_preprocessed_files
.PHONY: all
all: mercury
@@ -209,6 +212,21 @@
.PHONY: libmmc
libmmc: libmercury_compile.a mercury_compile_init.$O
+# The executable was previous known as `mercury_compile',
+# but now we generate it as `mc'. For compatibility with
+# various existing code, we make links to the old names.
+
+LN=ln
+
+mercury_compile: $(MC_PROG)
+ $(LN) $(MC_PROG) mercury_compile$(EXT_FOR_EXE)
+
+libmercury_compile.a: lib$(MC_PROG).a
+ $(LN) lib$(MC_PROG).a libmercury_compile.a
+
+mercury_compile_init.$O: $(MC_PROG)_init.$O
+ $(LN) $(MC_PROG)_init.$O mercury_compile_init.$O
+
#-----------------------------------------------------------------------------#
# The GCC back-end stuff is conditionally compiled out of maybe_mlds_to_gcc.m.
@@ -235,47 +253,47 @@
# Add some additional dependencies, so that Mmake knows to remake the
# compiler if one of the libraries changes.
-mercury_compile: ../main.$O
-mercury_compile: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
-mercury_compile: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
-mercury_compile: $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A
-mercury_compile: $(TRACE_DIR)/lib$(TRACE_LIB_NAME).$A
+$(MC_PROG): ../main.$O
+$(MC_PROG): $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
+$(MC_PROG): $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
+$(MC_PROG): $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A
+$(MC_PROG): $(TRACE_DIR)/lib$(TRACE_LIB_NAME).$A
# Should also depend on $(BOEHM_GC_DIR)/libgc(_prof).$A, but only
# if in .gc(.prof) grade; GNU make does not support dynamic dependencies,
# so just leave it out.
-mercury_compile: $(GCC_MAIN_LIBS)
+$(MC_PROG): $(GCC_MAIN_LIBS)
-mercury_compile_init.c: $(UTIL_DIR)/mkinit
+$(MC_PROG)_init.c: $(UTIL_DIR)/mkinit
#-----------------------------------------------------------------------------#
.PHONY: check
-check : mercury_compile.check
+check : $(MC_PROG).check
.PHONY: ints
-ints : mercury_compile.ints
+ints : $(MC_PROG).ints
#-----------------------------------------------------------------------------#
-tags : $(mercury_compile.ms) $(LIBRARY_DIR)/*.m
- $(MTAGS) $(MTAGSFLAGS) $(mercury_compile.ms) $(LIBRARY_DIR)/*.m
+tags : $(PREPROCESSED_M_FILES) *.m $(LIBRARY_DIR)/*.m
+ $(MTAGS) $(MTAGSFLAGS) *.m $(LIBRARY_DIR)/*.m
-mercury_compile.stats : source_stats.awk $(mercury_compile.ms)
+$(MC_PROG).stats : source_stats.awk $($(MC_PROG).ms)
awk -f `vpath_find source_stats.awk` \
- `vpath_find $(mercury_compile.ms)` > $@
+ `vpath_find $($(MC_PROG).ms)` > $@
#-----------------------------------------------------------------------------#
.PHONY: dates
dates :
- touch $(mercury_compile.dates)
+ touch $($(MC_PROG).dates)
#-----------------------------------------------------------------------------#
.PHONY: os cs ss
-os: $(mercury_compile.os) $(os_subdir)mercury_compile_init.$O
-cs: $(mercury_compile.cs) $(cs_subdir)mercury_compile_init.c
-ss: $(mercury_compile.ss)
+os: $($(MC_PROG).os) $(os_subdir)$(MC_PROG)_init.$O
+cs: $($(MC_PROG).cs) $(cs_subdir)$(MC_PROG)_init.c
+ss: $($(MC_PROG).ss)
#-----------------------------------------------------------------------------#
@@ -283,7 +301,7 @@
rm -f ../main.$O $(PREPROCESSED_M_FILES) $(PP_DATE_FILES)
realclean_local:
- rm -f tags mercury_compile.stats
+ rm -f tags $(MC_PROG).stats
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
Index: globals.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/globals.m,v
retrieving revision 1.48
diff -u -d -u -r1.48 globals.m
--- globals.m 19 Feb 2002 06:21:43 -0000 1.48
+++ globals.m 5 Mar 2002 14:24:46 -0000
@@ -4,7 +4,7 @@
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
-:- module globals.
+:- module mc__libs__globals.
% Main author: fjh.
@@ -16,7 +16,7 @@
%-----------------------------------------------------------------------------%
:- interface.
-:- import_module options, trace_params, prog_data.
+:- import_module mc__libs__options, mc__libs__trace_params.
:- import_module bool, getopt, list, io, std_util.
:- type globals.
@@ -32,6 +32,15 @@
% `tree' data structure.
% (Work in progress.)
+:- type foreign_language
+ ---> c
+% ; cplusplus
+ ; csharp
+ ; managed_cplusplus
+% ; java
+ ; il
+ .
+
% The GC method specifies how we do garbage collection.
% This is only relevant for the C and asm back-ends;
% when compiling to IL or Java, where the target language
@@ -194,7 +203,7 @@
:- implementation.
-:- import_module exprn_aux.
+:- import_module mc__ll_backend__exprn_aux.
:- import_module map, std_util, require, string.
convert_target(String, Target) :-
Index: prog_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_data.m,v
retrieving revision 1.79
diff -u -d -u -r1.79 prog_data.m
--- prog_data.m 26 Feb 2002 02:45:49 -0000 1.79
+++ prog_data.m 5 Mar 2002 14:26:38 -0000
@@ -14,7 +14,7 @@
% Simplifications are done only by make_hlds.m, which transforms
% the parse tree which we built here into the HLDS.
-:- module prog_data.
+:- module mc__parse_tree__prog_data.
:- interface.
@@ -22,8 +22,8 @@
% Any types which are needed in both the parse tree and in the HLDS
% should be defined here, rather than in hlds*.m.
-:- import_module (inst), options.
-:- import_module recompilation.
+:- import_module (mc__parse_tree__inst), mc__libs__options, mc__libs__globals.
+:- import_module mc__hlds__recompilation.
:- import_module bool, list, assoc_list, map, set, varset, term, std_util.
%-----------------------------------------------------------------------------%
@@ -107,15 +107,6 @@
---> type_only(type)
; type_and_mode(type, mode).
-:- type foreign_language
- ---> c
-% ; cplusplus
- ; csharp
- ; managed_cplusplus
-% ; java
- ; il
- .
-
:- type pred_or_func
---> predicate
; function.
@@ -1047,7 +1038,7 @@
:- implementation.
:- import_module string.
-:- import_module purity.
+:- import_module mc__check_hlds__purity.
:- type pragma_foreign_proc_attributes
---> attributes(
Index: accumulator.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/accumulator.m,v
retrieving revision 1.18
diff -u -d -u -r1.18 accumulator.m
--- accumulator.m 13 Oct 2000 13:55:13 -0000 1.18
+++ accumulator.m 5 Mar 2002 14:05:37 -0000
@@ -125,11 +125,11 @@
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
-:- module accumulator.
+:- module mc__transform_hlds__accumulator.
:- interface.
-:- import_module hlds_module, hlds_pred, io.
+:- import_module mc__hlds__hlds_module, mc__hlds__hlds_pred, io.
:- pred accumulator__process_proc(pred_id::in, proc_id::in, proc_info::in,
proc_info::out, module_info::in, module_info::out,
@@ -140,10 +140,10 @@
:- implementation.
-:- import_module (assertion), error_util, goal_store, goal_util, globals.
-:- import_module hlds_data, hlds_goal, hlds_out, (inst).
-:- import_module inst_match, instmap, mode_util, options.
-:- import_module prog_data, prog_util, quantification.
+:- import_module (mc__hlds__assertion), mc__hlds__error_util, mc__transform_hlds__goal_store, mc__hlds__goal_util, mc__libs__globals.
+:- import_module mc__hlds__hlds_data, mc__hlds__hlds_goal, mc__hlds__hlds_out, (mc__parse_tree__inst).
+:- import_module mc__check_hlds__inst_match, mc__hlds__instmap, mc__check_hlds__mode_util, mc__libs__options.
+:- import_module mc__parse_tree__prog_data, mc__parse_tree__prog_util, mc__hlds__quantification.
:- import_module assoc_list, bool, int, list, map, multi_map.
:- import_module require, set, std_util, string, term, varset.
Index: add_heap_ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/add_heap_ops.m,v
retrieving revision 1.3
diff -u -d -u -r1.3 add_heap_ops.m
--- add_heap_ops.m 5 Feb 2002 09:14:45 -0000 1.3
+++ add_heap_ops.m 5 Mar 2002 14:05:37 -0000
@@ -27,9 +27,9 @@
%-----------------------------------------------------------------------------%
-:- module add_heap_ops.
+:- module mc__ml_backend__add_heap_ops.
:- interface.
-:- import_module hlds_pred, hlds_module.
+:- import_module mc__hlds__hlds_pred, mc__hlds__hlds_module.
:- pred add_heap_ops(proc_info::in, module_info::in, proc_info::out) is det.
@@ -37,10 +37,10 @@
:- implementation.
-:- import_module prog_data, prog_util, (inst).
-:- import_module hlds_goal, hlds_data.
-:- import_module goal_util, quantification, modules, type_util.
-:- import_module instmap, code_model, code_util.
+:- import_module mc__parse_tree__prog_data, mc__parse_tree__prog_util, (mc__parse_tree__inst).
+:- import_module mc__hlds__hlds_goal, mc__hlds__hlds_data.
+:- import_module mc__hlds__goal_util, mc__hlds__quantification, mc__parse_tree__modules, mc__check_hlds__type_util.
+:- import_module mc__hlds__instmap, mc__backend_libs__code_model, mc__ll_backend__code_util.
:- import_module bool, string.
:- import_module assoc_list, list, map, set, varset, std_util, require, term.
Index: add_trail_ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/add_trail_ops.m,v
retrieving revision 1.6
diff -u -d -u -r1.6 add_trail_ops.m
--- add_trail_ops.m 26 Nov 2001 09:30:55 -0000 1.6
+++ add_trail_ops.m 5 Mar 2002 14:05:37 -0000
@@ -27,9 +27,9 @@
%-----------------------------------------------------------------------------%
-:- module add_trail_ops.
+:- module mc__ml_backend__add_trail_ops.
:- interface.
-:- import_module hlds_pred, hlds_module.
+:- import_module mc__hlds__hlds_pred, mc__hlds__hlds_module.
:- pred add_trail_ops(proc_info::in, module_info::in, proc_info::out) is det.
@@ -37,10 +37,10 @@
:- implementation.
-:- import_module prog_data, prog_util, (inst).
-:- import_module hlds_goal, hlds_data.
-:- import_module goal_util, quantification, modules, type_util.
-:- import_module code_model, instmap.
+:- import_module mc__parse_tree__prog_data, mc__parse_tree__prog_util, (mc__parse_tree__inst).
+:- import_module mc__hlds__hlds_goal, mc__hlds__hlds_data.
+:- import_module mc__hlds__goal_util, mc__hlds__quantification, mc__parse_tree__modules, mc__check_hlds__type_util.
+:- import_module mc__backend_libs__code_model, mc__hlds__instmap.
:- import_module bool, string.
:- import_module assoc_list, list, map, set, varset, std_util, require, term.
... etc.
(The rest of the diff omitted, since it is a very boring, mostly
automatically-generated 8000-line diff, whose nature is the same
as the examples above.)
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list