mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 10:23:46 +00:00
Estimated hours taken: 8
Branches: main
Add language and compiler support for finalise declarations.
NEWS:
Mention finalise declarations.
compiler/prog_data.m:
Add a new item type for finalise declarations.
Add a new kind of item origin - items can now be introduced as part of
the source-to-source transformation that implements finalise
declarations.
compiler/prog_io.m:
Parse finalise declarations.
compiler/modules.m:
Don't write out finalise declarations in private interfaces.
compiler/hlds_module.m:
Add a slot to the HLDS that stores the names of the predicates in
finalise declarations.
Add access predicates for the above.
compiler/add_pragma.m:
compiler/make_hlds_passes.m:
Fix in incorrect comment: we add initialise declarations on third, not
second, pass.
Restore the code that use the enhanced switch detection capability.
Implement the source-to-source transformation that implements finalise
declarations. This is almost identical to that for intitialise
declarations.
compiler/llds.m:
compiler/llds_out.m:
compiler/transform_llds.m:
Add a slot to the LLDS to hold the name of the predicates specified in
the finalise declarations.
Emit the necessary code to call these predicates after main has finished.
compiler/mlds.m:
compiler/ml_code_gen.m:
compiler/ml_elim_nested.m:
compiler/ml_optimize.m:
compiler/ml_tailcall.m:
compiler/mlds_to_c.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_java.m:
compiler/mlds_to_managed.m:
As above, but for the MLDS.
compiler/mercury_compile.m:
Conform to changes in the MLDS.
XXX This module probably shouldn't manipulating the MLDS directly.
compiler/module_qual.m:
compiler/mercury_to_mercury.m:
compiler/recompilation.check.m:
compiler/recompilation.version.m:
Conform to the above changes.
library/ops.m:
Add `finalise' as an operator.
runtime/mercury_wrapper.c:
Call any user specified finalise predicates from
mercury_runtime_terminate.
doc/reference_manual.texi:
Document finalise declarations.
tests/hard_coded/Mmakefile:
tests/hard_coded/finalise_decl.m:
tests/hard_coded/finalise_decl.exp:
Tests finalise declarations.
tests/hard_coded/sub-modules/Mmakefile:
tests/hard_coded/sub-modules/finalise_child.m:
tests/hard_coded/sub-modules/finalise_parent.m:
tests/hard_coded/sub-modules/finalise_parent.{exp,exp2}:
Test finalise declarations and sub-modules. There are two expected
outputs because the order of execution between a parent module and its
children of any finalisers is arbitrary.
tests/invalid/Mmakefile:
tests/invalid/bad_finalise_decl.m:
tests/invalid/bad_finalise_decl.err_exp:
Test error messages associated with finalise declarations.
4 lines
95 B
Plaintext
4 lines
95 B
Plaintext
This is main/2.
|
|
This is the first finalise pred, i1/2.
|
|
This is the second finalise pred, i2/2.
|