Files
mercury/compiler/ml_backend.m
Simon Taylor 82c6cdb55e Make definitions of abstract types available when generating
Estimated hours taken: 100
Branches: main

Make definitions of abstract types available when generating
code for importing modules.  This is necessary for the .NET
back-end, and for `:- pragma export' on the C back-end.

compiler/prog_data.m:
compiler/modules.m:
compiler/make.dependencies.m:
compiler/recompilation.version.m:
	Handle implementation sections in interface files.

	There is a new pseudo-declaration `abstract_imported'
	which is applied to items from the implementation
	section of an interface file.  `abstract_imported'
	items may not be used in the error checking passes
	for the curent module.

compiler/equiv_type_hlds.m:
compiler/notes/compiler_design.html:
	New file.

	Go over the HLDS expanding all types fully after
	semantic checking has been run.

compiler/mercury_compile.m:
	Add the new pass.

	Don't write the `.opt' file if there are any errors.

compiler/instmap.m:
	Add a predicate instmap_delta_map_foldl to apply
	a procedure to all insts in an instmap.

compiler/equiv_type.m:
	Export predicates for use by equiv_type_hlds.m

	Reorder arguments so state variables and higher-order
	programming can be used.

compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
	Handle `:- pragma foreign_type' as a form of type
	declaration rather than a pragma.

compiler/hlds_data.m:
compiler/*.m:
	Add a field to the type_info_cell_constructor cons_id
	to identify the type_ctor, which is needed by
	equiv_type_hlds.m.

compiler/module_qual.m:
	Donn't allow items from the implementation section of
	interface files to match items in the current module.

compiler/*.m:
tests/*/*.m:
	Add missing imports which only became apparent with
	the bug fixes above.

	Remove unnecessary imports which only became apparent with
	the bug fixes above.

tests/hard_coded/Mmakefile:
tests/hard_coded/export_test2.{m,exp}:
	Test case.

tests/invalid/Mmakefile:
tests/invalid/missing_interface_import2.{m,err_exp}:
	Test case.
2003-12-01 15:56:15 +00:00

89 lines
2.8 KiB
Mathematica

%-----------------------------------------------------------------------------%
% Copyright (C) 2002-2003 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 backend_libs.
:- import_module check_hlds. % is this needed?
:- import_module hlds.
:- import_module libs.
:- import_module parse_tree.
:- import_module transform_hlds. % is this needed?
:- import_module aditi_backend. % need aditi_backend.rl_file
%-----------------------------------------------------------------------------%
:- include_module mlds.
:- include_module ml_util.
% Phase 4-ml: MLDS-specific HLDS to HLDS transformations and annotations.
:- include_module add_heap_ops.
:- include_module 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_call_gen.
:- include_module ml_closure_gen.
:- include_module ml_switch_gen.
:- include_module ml_simplify_switch.
:- include_module ml_string_switch.
:- include_module ml_tag_switch.
:- include_module ml_type_gen.
:- include_module ml_unify_gen.
:- include_module ml_code_util.
:- include_module rtti_to_mlds.
% Phase 6-ml: MLDS -> MLDS transformations
:- include_module ml_elim_nested.
:- include_module ml_optimize.
:- include_module ml_tailcall.
% 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.
:- include_module java_util.
% MLDS->.NET CLR back-end
:- include_module il_peephole.
:- include_module ilasm.
:- include_module ilds.
:- include_module mlds_to_il.
:- include_module mlds_to_ilasm.
:- include_module mlds_to_managed.
:- implementation.
% :- import_module ll_backend. % Needed and imported in ml_closure_gen.m.
:- end_module ml_backend.
%-----------------------------------------------------------------------------%