mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
Estimated hours taken: 16
Branches: main
Add two new annotations for foreign_procs, tabled_for_descendant_io and
tabled_for_io_unitize.
By adding the tabled_for_descendant_io annotation to a foreign_proc with I/O
states, the programmer is asserting that the foreign_proc itself doesn't do
I/O, and nor does any foreign language code it calls, though the Mercury
predicates it calls may.
By adding the tabled_for_io_unitize annotation to a foreign_proc with I/O
states, the programmer is saying that both the foreign_proc itself and the
Mercury predicates it calls may do I/O. To avoid the I/O tabling problems
that would arise on retries from Mercury code called by the foreign_proc,
the programmer is requesting that the debugger treat calls to the foreign_proc
as a unit. This means that if I/O tabling is turned on, then the implementation
will disable both debugging and I/O tabling inside Mercury code called from
the foreign_proc.
compiler/prog_data.m:
Add the tabled_for_descendant_io and tabled_for_io_unitize annotations.
Parameterize the eval_table_io eval_method to accommodate the
unitization of foreign_procs.
compiler/prog_io_pragma.m:
Add code to read in the tabled_for_descendant_io and
tabled_for_io_unitize annotations.
compiler/table_gen.m:
Handle the new annotations. Procedures with tabled_for_descendant_io
annotations don't need to be transformed at all; procedures with
tabled_for_io_unitize annotations need a small variation of the
existing transformation.
Fix an existing bug that made the HLDS not type-correct. Create new
variables with the appropriate type; do not assume all new variables
are c_pointers, since some are integers.
library/table_builtin.m:
Add two new predicates that table_gen.m emits calls to on either side
of the code of foreign_procs with tabled_for_io_unitize annotations.
compiler/hlds_out.m:
compiler/layout_out.m:
compiler/mercury_to_mercury.m:
Update the mechanisms for printing out eval methods.
compiler/hlds_pred.m:
Update the mechanisms for performing tests on eval methods.
Change some of the predicates involved to functions, partly in order
to make future maintenance easier.
compiler/det_analysis.m:
compiler/det_report.m:
compiler/make_hlds.m:
compiler/modes.m:
Conform to the change from predicates to functions.
runtime/mercury_trace_base.c:
Update the documentation of MR_trace_enabled.
runtime/mercury_stack_layout.h:
Add names for the new eval methods.
trace/mercury_trace.c:
Handle the new eval methods.
tests/debugger/tabled_read_unitize.{m,inp,exp,data}:
A new test case to check the handling of unitized foreign_procs.
tests/debugger/Mmakefile:
Turn on the new test case.
5 lines
13 B
Plaintext
5 lines
13 B
Plaintext
123
|
|
45
|
|
6
|
|
789
|