Simon Taylor 5de7305cfe Implement `:- pragma foreign_import_module(Lang, Module)', which tells
Estimated hours taken: 10

Implement `:- pragma foreign_import_module(Lang, Module)', which tells
the compiler that the foreign code in the module containing the
declaration uses `:- pragma export'ed procedures from module `Module'.
This information is needed for mmake to build things in the right order.
Currently programmers can hand code the required mmake rules, but
`mmc --make' will have no mechanism for doing this.

`:- pragma c_import_module(Module)' is a synonym for
`:- pragma foreign_import_module("C", Module)'.

compiler/prog_io_pragma.m:
	Parse the new pragmas.

compiler/prog_data.m:
compiler/foreign.m:
compiler/hlds_module.m:
compiler/mlds.m:
compiler/modules.m:
	Add the `:- pragma foreign_import_module' to the
	compiler's datastructures.

compiler/make_hlds.m:
	Insert `:- pragma foreign_import_module' declarations
	into the HLDS.

compiler/modules.m:
	Add the extra dependency information from
	`:- pragma foreign_import_module' declarations
	to the `.d' files.

compiler/llds.m:
compiler/foreign.m:
	Move some non-backend-specific types describing the foreign
	language interface from llds.m to foreign.m.

compiler/intermod.m:
	Write `:- pragma foreign_import_module' declarations
	to `.opt' files. XXX mmake doesn't support this properly yet.

compiler/mercury_compile.m:
compiler/foreign.m:
compiler/ml_code_gen.m:
compiler/ml_code_gen.m:
compiler/mlds_to_c.m:
compiler/mlds_to_csharp.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_mcpp.m:
	Convert `:- pragma foreign_import_module' to `#include'
	statements where appropriate depending on the target
	language.

compiler/*.m:
	Handle `:- pragma foreign_import_module'.
	Import foreign.m rather than llds.m for the foreign
	interface types.

doc/reference_manual.texi:
NEWS:
	Document the new pragmas.
	Minor fixes for the foreign code documentation.

tests/hard_coded/Mmakefile:
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_import_module.exp:
	Test case.
2001-11-06 15:21:27 +00:00
2001-07-18 08:22:56 +00:00
2001-11-02 06:25:56 +00:00
2001-05-03 12:50:20 +00:00

Reportedly Mercury does not work on Solaris 2.5.1 if it is compiled with
gcc 2.7.x.  It should however work fine on Solaris 2.5.1 if you compile
it with gcc 2.8, or if you use gcc 2.7.x with an earlier version of Solaris.

The binary distribution for Solaris that we distribute was compiled
with gcc 2.7.2, so if you have Solaris 2.5.1, you may need to compile
Mercury yourself from our source distribution.

("Solaris 2.x" is also known as "SunOS 5.x".)
Description
No description provided
Readme MIT 248 MiB
Languages
Mercury 85.3%
C 8.7%
Shell 1.4%
Makefile 1%
JavaScript 1%
Other 2.1%