Files
mercury/tests/hard_coded/foreign_import_module.m
Julien Fischer 3dd02876a5 Delete the MLDS->IL backend.
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_managed.m:
compiler/il_peephole.m:
compiler/ilasm.m:
compiler/ilds.m:
    Delete the modules making up the MLDS->IL code generator.

compiler/globals.m:
compiler/prog_data.m:
    Delete IL as a target and foreign language.

compiler/prog_io_pragma.m:
    Delete the max_stack_size/1 foreign proc attribute.  This was only
    ever required by the IL backend.

compiler/options.m
    Delete options used for the IL backend.

compiler/write_deps_file.m:
    Don't generate mmake targets for .il files etc.

compiler/*.m:
    Conform to the above changes.

compiler/notes/compiler_design.html
compiler/notes/work_in_progress.html
    Conform to the above changes.

library/*.m:
    Delete IL foreign_proc and foreign_export pragmas.

README.DotNet:
    Delete this file.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
    Conform the above changes.

configure.ac:
    Don't check that IL is a supported foreign language when performing the
    up-to-date check.

    Delete the '--enable-dotnet-grades' option.

scripts/Mmake.vars.in:
    Delete variables used for the IL backend (and in on case by the Aditi
    backend).

scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
scripts/Mmake.rules:
scripts/canonical_grade.sh-subr:
tools/bootcheck:
    Delete stuff related to the 'il' and 'ilc' grades.

doc/reference_manual.texi:
     Delete the documentation of the 'max_stack_size' option.

doc/user_guide.texi:
     Delete stuff related to the IL backend.

tests/hard_coded/csharp_test.{m,exp}:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/valid/csharp_hello.m:
	Delete these tests: they are no longer relevant.

tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_type.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/foreign_type3.m:
tests/hard_coded/intermod_foreign_type2.m:
tests/hard_coded/lp.m:
tests/hard_coded/user_compare.m:
tests/invalid/foreign_type_2.m:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/invalid/foreign_type_visibility.m:
tests/invalid/illtyped_compare.{m,err_exp}:
tests/submodules/external_unification_pred.m
tests/valid/big_foreign_type.m
tests/valid/solver_type_bug.m
tests/valid_seq/foreign_type_spec.m
tests/valid_seq/intermod_impure2.m
    Delete IL foreign_procs where necessary.

tests/hard_coded/Mmakefile
tests/invalid/Mercury.options
tests/invalid/Mmakefile
tests/submodules/Mmakefile
tests/valid/Mercury.options
tests/valid/Mmake.valid.common
tests/valid/Mmakefile
tests/valid_seq/Mmakefile
tests/valid_seq/Mercury.options
    Conform to the above changes.
2015-09-21 11:34:46 +10:00

100 lines
2.2 KiB
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module foreign_import_module.
:- interface.
:- import_module int.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- pred bar(int::in, int::out) is det.
:- implementation.
main -->
{ bar(41, X) },
io__write(X),
io__nl,
{ bar2(41, Y) },
io__write(Y),
io__nl.
:- pragma foreign_import_module(c, foreign_import_module_2).
:- pragma foreign_import_module(java, foreign_import_module_2).
% not actually necessary in Erlang
% :- pragma foreign_import_module(erlang, foreign_import_module_2).
:- pragma foreign_proc("C",
bar(X::in, Y::out),
[may_call_mercury, promise_pure],
"
foo(X, &Y);
").
:- pragma foreign_proc("C#",
bar(X::in, Y::out),
[may_call_mercury, promise_pure],
"
int Y1, Y2;
foreign_import_module_2.mercury_code.foo(X, ref Y1);
foreign_import_module_2__csharp_code.mercury_code.foo2(X, ref Y2);
if (Y1 == Y2) {
Y = Y1;
} else {
throw new System.Exception(""Y1 != Y2"");
}
").
:- pragma foreign_proc("Java",
bar(X::in, Y::out),
[may_call_mercury, promise_pure],
"
Y = foreign_import_module_2.foo(X);
").
:- pragma foreign_proc("Erlang",
bar(X::in, Y::out),
[may_call_mercury, promise_pure],
"
Y = foreign_import_module_2:foo(X)
").
:- pred bar2(int::in, int::out) is det.
:- pragma foreign_proc("C",
bar2(X::in, Y::out),
[may_call_mercury, promise_pure],
"
foo(X, &Y);
").
:- pragma foreign_proc("C#",
bar2(X::in, Y::out),
[may_call_mercury, promise_pure],
"
int Y1 = 0, Y2 = 0;
foreign_import_module_2.mercury_code.foo(X, ref Y1);
foreign_import_module_2__cpp_code.mercury_code.foo2(X, ref Y2);
if (Y1 == Y2) {
Y = Y1;
} else {
throw new System.Exception(""Y1 != Y2"");
}
").
:- pragma foreign_proc("Java",
bar2(X::in, Y::out),
[may_call_mercury, promise_pure],
"
Y = foreign_import_module_2.foo(X);
").
:- pragma foreign_proc("Erlang",
bar2(X::in, Y::out),
[may_call_mercury, promise_pure],
"
Y = foreign_import_module_2:foo(X)
").