mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 20:03:44 +00:00
Add an attribute may_not_export_body to prevent a foreign_proc from
being opt-exported. Also add may_export_body for completeness.
compiler/prog_data_foreign.m:
Add type to represent those attributes.
Add a field for that attribute to pragma_foreign_proc_attributes,
plus getters and setters.
compiler/parse_pragma_foreign.m:
Parse may_export_body and may_not_export_body attributes on
foreign_proc declarations.
Detect conflicting attributes.
compiler/parse_tree_out_pragma.m:
Write out may_export_body and may_not_export_body attributes.
compiler/intermod.m:
Do not write a foreign_proc with may_not_export_body to .opt files.
compiler/simplify_proc.m:
Report an error if a foreign_proc with may_export_body is
also marked with pragma no_inline.
compiler/add_mutable_aux_preds.m:
Mark auxiliary predicates for mutables with may_not_export_body
instead of may_not_duplicate. This allows calls to those predicates
to be inlined.
doc/reference_manual.texi:
Document the new attributes.
tests/hard_coded/Mercury.options:
tests/hard_coded/Mmakefile:
tests/hard_coded/intermod_may_export_body.exp:
tests/hard_coded/intermod_may_export_body.m:
tests/hard_coded/intermod_may_export_body2.m:
tests/invalid/Mmakefile:
tests/invalid/test_may_export_body.err_exp:
tests/invalid/test_may_export_body.m:
Add test cases.
vim/syntax/mercury.vim:
Update vim syntax file.
NEWS:
Announce addition.
22 lines
484 B
Mathematica
22 lines
484 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module intermod_may_export_body.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module intermod_may_export_body2.
|
|
|
|
main(!IO) :-
|
|
plus(1, 2, A),
|
|
cannot_export_plus(4, 5, B),
|
|
io.print_line(A, !IO),
|
|
io.print_line(B, !IO).
|