library/*.m:
Specifically, delete any predicates and functions whose `pragma obsolete'
dates from 2018 or before. Keep the ones that were obsoleted
only this year or last year.
NEWS:
Announce the changes.
tests/debugger/io_tab_goto.m:
tests/debugger/tabled_read.m:
tests/declarative_debugger/io_stream_test.m:
tests/declarative_debugger/tabled_read_decl.m:
tests/declarative_debugger/tabled_read_decl_goto.m:
tests/general/array_test.m:
tests/hard_coded/mutable_init_impure.m:
tests/hard_coded/remove_file.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug2.m:
tests/valid/mercury_java_parser_follow_code_bug.m:
Replace references to predicates and functions that this diff deletes
with their suggested replacements.
In several test cases, bring the programming style up to date.
tests/hard_coded/shift_test.{m,exp}:
Most of this test case tested the now-deleted legacy shift operations.
Replace these with tests of their non-legacy versions, including
testing for the expected exceptions.
tests/hard_coded/shift_test.{m,exp}:
Don't pass --no-warn-obsolete when compiling shift_test.m anymore.
Replace __ with . as the module qualifier symbol.
Replace references to io.state with just io.
Replace DCGs with state variables.
Replace (C->T;E) syntax for if-then-elses with (if C then T else E) syntax.
Replace if-then-elses with switches when possible and where this does not
affect what is being tested.
Replace separate pred and mode declarations with predmode declarations.
Put predicate and function declarations just before the definition
of the predicate or function.
Delete unneeded module qualifications on predicate and function declarations
and definitions.
Update .exp files (and if needed, .inp files) for the line number changes
that result from the above.
For tests that have more than one .exp file and where one of those files
is affected by the above, add a section to the source file header that says
which .exp file is for what grade, with XXXs for the (as yet) unknown parts.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
pragmas but it now emits an error message saying what pragma in the "new"
foreign language interface to use instead. (That will be deleted after the
next release.)
Remove support for nondet foreign code from the implementation.
Add some bits from the old C interface chapter of the reference manual,
about linking with C object files and the c_pointer type, to the chapter
on the foreign language interface; delete the rest.
Add an illustration of simulating nondet foreign code with Mercury clauses
and (semi)deterministic foreign_procs.
doc/reference_manual.texi:
Delete the old C interface chapter.
Add a section on linking against C object files to the C specific
section of the foreign language interface chapter. (The old version of
this was quite mmake-specific, the new version attempts to minimise
this.)
Mention the c_pointer type in section on C foreign types.
Mention that nondet foreign_procs are not allowed. Give an example
to use foreign code and nondeterminism.
compiler/prog_io_pragma.m:
Emit error messages when any of the pragmas used by the old C interface
are encountered.
compiler/prog_item.m:
Delete the parse tree representation of import pragmas.
compiler/gcc.m:
Replace `:- pragma import' declarations with `:- pragma foreign_proc'
declarations for C.
compiler/add_heap_ops.m:
compiler/add_trail_ops.m:
compiler/add_pragma.m:
compiler/deep_profiling.m:
compiler/det_analysis.m:
compiler/equiv_type.m:
compiler/erl_call_gen.m:
compiler/foreign.m:
compiler/goal_util.m:
compiler/hlds_out_goal.m:
compiler/make_hlds_passes.m:
compiler/make_hlds_warn.m:
compiler/mercury_to_mercury.m
compiler/ml_code_gen.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/polymorphism.m:
compiler/pragma_c_gen.m:
compiler/proc_gen.m:
compiler/prog_data.m:
compiler/recompilation.version.m:
Delete stuff related the old C interface.
tests/hard_coded_Mmakefile:
tests/hard_coded/inline_nondet_pragma_c.*:
tests/hard_coded/nondet_c.*:
tests/hard_coded/nondet_pragma_c_bug.*:
tests/hard_coded/pragma_import.*:
Delete these tests. The features they exercise are no longer
supported.
tests/*/*.m:
Replace uses of the old C interface with the new.
Estimated hours taken: 3
Branches: main and 0.12
Make the I/O tabling transformation respect :- pragma no_inline directives
by creating a copy of the predicate to be transformed and calling the
copy, instead of duplicating the body, if :- pragma no_inline is
given. This is necessary to avoid duplicate label errors from the C compiler
when the I/O tabled foreign proc uses labels.
compiler/hlds_pred.m:
Add a new functor to the pred_creation type to indicate that a pred
was created by the I/O tabling transformation.
Fix some formatting.
compiler/table_gen.m:
If the predicate to be I/O tabled has a no_inline pragma attached to
it, then create a copy of the predicate and call the new predicate in
the transformed version.
compiler/trace_params.m:
Do not trace the copy of the I/O tabled predicate.
doc/reference_manual.texi
Document the tabled_for_io attribute.
tests/debugger/Mercury.options:
tests/debugger/Mmakefile:
tests/debugger/io_tab_goto.data:
tests/debugger/io_tab_goto.exp:
tests/debugger/io_tab_goto.inp:
tests/debugger/io_tab_goto.m:
Test that foreign C code with labels is I/O tabled correctly.
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/tabled_read_decl_goto.data:
tests/debugger/declarative/tabled_read_decl_goto.exp:
tests/debugger/declarative/tabled_read_decl_goto.inp:
tests/debugger/declarative/tabled_read_decl_goto.m:
Test declarative debugging of I/O tabled foreign predicates with
gotos.