mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-17 23:05:21 +00:00
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.
76 lines
2.6 KiB
Mathematica
76 lines
2.6 KiB
Mathematica
%-----------------------------------------------------------------------------%
|
|
% Copyright (C) 2002 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.
|
|
%-----------------------------------------------------------------------------%
|
|
%
|
|
% The MLDS back-end.
|
|
%
|
|
% This package includes
|
|
% - the MLDS data structure, which is an abstract
|
|
% representation of a generic imperative language;
|
|
% - the MLDS code generator, which converts HLDS to MLDS;
|
|
% - the high-level C back-end, the Java back-end, the .NET back-end,
|
|
% and a wrapper for the assembler back-end,
|
|
% each of which convert MLDS to their respective target language.
|
|
%
|
|
% The main part of the assembler back-end, which converts MLDS
|
|
% to GCC's internal abstract syntax trees and then invokes the
|
|
% GCC back-end to convert this to assembler, is in a package of
|
|
% its own, so that this package doesn't depend on the GCC back-end.
|
|
%
|
|
:- module ml_backend.
|
|
:- interface.
|
|
:- import_module transform_hlds, check_hlds. % are these needed?
|
|
:- import_module hlds, parse_tree, libs, backend_libs.
|
|
:- import_module 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.
|
|
|
|
%-----------------------------------------------------------------------------%
|