mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 20:34:19 +00:00
5de7305cfef97659ca056ebfdced7c0773993a6d
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.
…
…
…
…
…
…
…
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".)
Languages
Mercury
85.3%
C
8.7%
Shell
1.4%
Makefile
1%
JavaScript
1%
Other
2.1%