Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.
*/Makefile:
*/Mmakefile:
As above.
tests/hard_coded/.gitignore:
Don't ignore the purity subdir. This ignore must have been left over
from when purity.m was a test in hard_coded, not hard_coded/purity,
and it ignored an executable, not a directory.
Branches: main
Fix bitrot in extras/trailed_update.
extras/trailed_updated/var.m:
Don't specify an initialisation predicated for the solver type var/1.
extras/trailed_updated/samples/interpreter.m:
Conform with the change that added an extra argument to the variable/2
constructor of the standard library type term/1.
extras/trailed_update/tests/var_test.m:
Use up-to-date syntax for modes.
extras/trailed_update/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/var_test.m:
Use trail segments since that's what you get in an installation by
default.
extras/trailed_update/*.m:
Update syntax and formatting to conform more closely to our
current coding standards.
Add require_feature_set pragmas for trailing.
Estimated hours taken: 1
Branches: main
Remove support for the reserve tag (.rt) grades.
These were only ever needed to support the implementation of Herbrand
variables in (older versions of) HAL.
NOTE: this change removes the .rt grade, the undocumented
reserve_tag pragma is unchanged.
runtime/mercury_grade.h:
Do not handle the .rt component. Rather than renumbering the
grade parts here I have documented that grade part 8 (formerly .rt)
is unused.
runtime/mercury_tags.h:
runtime/mercury_type_info.h:
runtime/mercury_conf_param.h:
Conform to the above change.
compiler/compile_target_code.m:
compiler/handle_options.m:
compiler/options.m:
compiler/make_tags.m:
compiler/prog_type.m:
Remove the `--reserve-tag' option and modify any code
that relied upon it. Such code is largely unchanged
since it is still required for the implementation of the
reserve_tag pragma.
doc/user_guide.texi:
Delete documentation for `--reserve-tag'.
scripts/canonical_grade.sh-subr:
scripts/init_grade_otpions.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
Remove support for the `.rt' grade component.
NEWS:
Announce that .rt grades are no longer supported.
extras/trailed_update/var.m:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
Update some documentation.
tests/debugger/Mmakefile:
tests/tabling/Mmakefile:
Delete special handling for .rt grades.
Estimated hours taken: 1
Branches: main
Move some of the regression tests for trailing from
extras/trailed_update/tests to a new trailing subdirectory in the test suite.
The motivation for doing this is that parts of the trailed_update package are
broken (and likely to remain so until the solver type/purity situation is
sorted out) and the tests are not being run.
extras/trailed_update/tests/Mmakefile:
extras/trailed_update/tests/func_trail_test.{m,exp}:
extras/trailed_update/tests/func_trail_test_2.{m,exp}:
Delete these tests from here.
tests/trailing:
New subdirectory that contains regression tests for trailing.
tests/trailing/Mmakefile:
tests/trailing/Mercury.options:
tests/trailing/func_trail_test.{m,exp}:
tests/trailing/func_trail_test_2.{m,exp}:
Move the test cases from extras/trailed_update/tests to here.
Update the syntax in the test cases and escape some special characters
in the C code correctly.
tests/README:
Update this file to mention the trailing directory.
Estimated hours taken: 0.5
Branches: main, release
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
Fix problems linking in debug grades on Solaris
(-ldl is not available with static linking).
Estimated hours taken: 0.25
Branches: main, release
tr/tests/func_trail_test_2.m:
Fix a bug that caused warnings with gcc 3:
change \n to \\n inside pragma C code.
Estimated hours taken: 0.1
Branches: main, release
extras/trailed_update/tests/Mmakefile:
Fix a bug where Mmake.params (which can set $(GRADE))
was being included after a place that tests $(GRADE).
This is essentially the same as the bug recently fixed in
extras/trailed_update/samples/Mmakefile.
Branches: main
Estimated hours taken: 0.25
Fix some problems with the trailed_update tests.
extras/trailed_update/tests/Mmakefile:
Disable the `var_test' test in `.rt' grades,
since it uses the `var' module, which doesn't work in `.rt' grades.
Estimated hours taken: 0.1
extras/trailed_update/tests/Mmakefile:
Fix a bug that broke the nightly tests with EXTRA_MGNUCFLAGS=--c-debug:
pass -I etc. in CFLAGS rather than MGNUCFLAGS.
Estimated hours taken: 0.5
Branches: main
Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).
The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.
Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.
compiler/modules.m:
The `.o' and `.pic_o' file now depends only on the `.c' file,
not on everthing the `.c' file depends on. The extra dependencies
were only needed because the intermediate `.c' file could
be removed by RM_C. This change is needed to avoid recompiling
unchanged `.c' files with smart recompilation.
Estimated hours taken: 0.25
Fix a problem introduced by my recent changes to tools/test_mercury
that was causing the tests of the extras stuff to fail.
extras/clpr/samples/Mmakefile:
extras/clpr/clpr/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
Include Mmake.params, so that it works properly when invoked
by tools/test_mercury.
Estimated hours taken: 18
Make the retry command work in trailing grades (e.g. for HAL).
compiler/trace.m:
In trailing grades, reserve two stack slots to hold (a) the trail
pointer on entry, and (b) a new ticket obtained on entry. Arrange to
put the numbers of these stack slots in the proc layout.
compiler/stack_layout.m:
Put the number of the first of these stack slots in the proc layout.
compiler/code_info.m:
Arrange the default: there are no such slots if debugging is not
enabled.
compiler/code_gen.m:
Insert code to discard the allocated ticket, in the success epilog
of model_det procedures, the success and failure epilogs of model_semi
procedures, and the failure epilogs of model_non procedures.
(Model_det procedures don't have failure epilogs, and discarding
the ticket in the success epilog of a model_non procedure would be
premature.)
compiler/llds.m:
Add two new alternatives to the type describing stack slots:
a stack slot may contain a trail pointer or a ticket.
Add a new reason for resetting the trail: a retry in the debugger.
compiler/llds_out.m:
Minor changes to conform to llds.m, and to make diagnostic output
less misleading.
library/builtin.m:
Add the type_ctor_info for the new "types" describing stored trail
pointers and tickets.
Bring up to date the type_ctor_infos of other "types" used only
for describing stack slots.
library/std_util.m:
Add the missing code to handle the type_ctor_infos of trail pointers,
tickets and other "types" used only for describing stack slots.
runtime/mercury_type_info.h:
Add a new type_ctor representation value for stored trail pointers,
tickets, and for other "types" used only for describing stack slots.
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
Add the missing code to handle the type_ctor_infos of trail pointers,
tickets and other "types" used only for describing stack slots.
runtime/mercury_stack_layout.h:
Add a field to proc layouts to hold either the number of the first
of the two stack slots holding trail info, or -1.
runtime/mercury_trail.h:
Add the new reason why the trail may be reset.
trace/mercury_trace.c:
In trailing grades, reset the trail, with the reason being given
as retry, when the debugger's retry command is executed.
extras/references/scoped_update.m:
extras/trailed_update/var.m:
clpr/cfloat.m:
extras/trailed_update/tests/func_trail_test.m:
extras/trailed_update/tests/func_trail_test_2.m:
Handle MR_retry as a reason for unwinding the trail.
Estimated hours taken: 0.75
Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
Use `clean_local' instead of `clean' and `realclean_local' instead
of `realclean' where appropriate. This is necessary now that
`realclean' does not depend on `clean'.
Estimated hours taken: 15
Split the automatically generated `.dep' file into two files. The new `.dv'
file contains all the variable definitions which used to be in the `.dep'
file, which now contains just the rules. With mmake including the `.dv'
files before the user's Mmakefile and the `.dep' files after, this allows
user-defined Mmakefiles to refer to the automatically-generated variables
and automatically-generated rules to refer to variables defined in the
user's Mmakefile. This was possible before to a limited extent, but in
particular dependency lists for automatically-generated rules could not
refer to user-defined variables.
Also introduced `C2INITARGS' as part of an illustration of how this change
is useful (though probably this should be a separate change). `C2INITARGS'
should be used to specify extra files to be passed to `c2init', rather than
the currently-used `C2INITFLAGS' (which should only be used for option
flags). The `_init.c' target should depend on these extra arguments, but it
was not possible to do this automatically prior to this change (at least,
not if one wanted to support per-program specification of `C2INITARGS').
compiler/modules.m:
Generate the new `.dv' files and revised `.dep' files.
Update the `change_clean' and `real_clean' targets to delete the
`.dv' files.
Update the `_init.c' rule to refer to `$(ALL_C2INITARGS)' as well as
`$(ALL_C2INITFLAGS)', and add a dependency on `$(ALL_C2INITARGS)'.
scripts/Mmake.rules:
Add appropriate rules and dependencies for `.dv' files.
scripts/Mmake.vars.in:
Add definitions for implementing `C2INITARGS'.
scripts/mmake.in:
Add code for using `.dv' files (while maintaining backward
compatibility for when they don't exist).
doc/user_guide.texi:
Document the new `.dv' files.
Document the new `C2INITARGS' variables and the dependencies they
imply.
../clpr/Mmakefile:
../clpr/samples/Mmakefile:
extras/complex_numbers/samples/Mmakefile:
extras/complex_numbers/tests/Mmakefile:
extras/graphics/mercury_opengl/Mmakefile:
extras/references/samples/Mmakefile:
extras/references/tests/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
Update to use `C2INITARGS' instead of `C2INITFLAGS', where
appropriate, and remove any now-obsolete `%_init.c' dependencies
(which wouldn't have worked anyway since GNU Make ignores pattern
dependencies with no commands).
Estimated hours taken: 1
Fix various gcc warnings.
library/std_util.m:
library/benchmarking.m:
extras/trailed_update/tests/func_trail_test.m:
extras/trailed_update/tests/func_trail_test_2.m:
Add some casts -- without these, the code might not compile
with compilers other than gcc.
library/private_builtin.m:
Avoid the use of nested extern declarations, by moving
the declarations out of the enclosing function.
runtime/mercury_array_macros.h:
Initialize `element' in MR_bsearch().
Without this, gcc reports lots of spurious warnings when
compiling trace/*.c.
Estimated hours taken: 12
Bug fixes.
tests/term/arit_exp.m still fails with --intermodule-optimization
due to a slightly different (but correct) trans_opt file being produced.
compiler/simplify.m
Don't produce singleton disjunctions, since the code generator
barfs on them. Use a `some' instead.
Test case: tests/general/partition.m compiled with --deforestation.
compiler/unused_args.m
Deconstructions where the arguments included `any' insts were
not being handled correctly, due to inst_matches_binding
failing for any->any.
Test case: extras/trailed_update/samples/vqueens.m at -O3.
Don't warn about predicates from `.opt' files having unused
arguments, because in most cases the warning will be generated
when compiling the imported module.
compiler/higher_order.m
Fix a bug that caused compiler/modules.m to be miscompiled at
-O3 --intermodule-optimization, due to curried arguments for
multiple known higher-order arguments being passed to a
specialised version in the wrong order.
Test case: tests/hard_coded/ho_order2.m
compiler/mercury_compile.m
Call intermod__update_pred_import_status when compiling to
C at the same stage of the compilation as the `.opt' file
was written to ensure that the same information is being used.
Test case: tests/hard_coded/rational_test.m compiled with
--intermodule-optimization failed because of a link error.
Make sure polymorphism has been run before doing unused argument
checking with --errorcheck-only. Otherwise the argument indices
read in from `.opt' files are incorrect.
compiler/intermod.m
Use code_util__compiler_generated to test if a called predicate
is compiler generated, rather than looking for a call_unify_context
(function calls have a call_unify_context).
Add a progress message for updating the import status of predicates
exported to `.opt' files.
Fix a bug where the unused_args pragmas read in from the current
module's `.opt' file were given an import_status of `imported' rather
than `opt_imported' resulting in an error message from make_hlds.m.
compiler/dead_proc_elim.m
Ensure that predicates used by instance declarations and
`:- pragma export's are not eliminated by the dead_pred_elim
pass before typechecking.
Test case: most of the typeclass tests compiled with
--intermodule-optimization.
compiler/hlds_goal.m
Remove obsolete comments about the modes of a higher-order
unification being incorrect after polymorphism, since that
was fixed months ago.
compiler/options.m
Reenable deforestation.
Enable --intermodule-optimization and --intermod-unused-args
at -O5 so they get tested occasionally.
compiler/handle_options.m
Disable deforestation if --typeinfo-liveness is set, since
there are bugs in the folding code if extra typeinfos are
added to a new predicate's arguments by hlds_pred__define_new_pred.
Disable higher_order.m if --typeinfo-liveness is set, since
higher_order.m currently does not pass all necessary typeinfos
to specialised versions or update the typeinfo_varmap of
specialised versions.
Test case: tests/valid/agc_ho_pred.m
tests/hard_coded/ho_order2.m
tests/hard_coded/ho_order2.exp
Test case for higher_order.m.
tools/test_mercury
Added --intermod-unused-args to the options for murlibobo.
extras/trailed_update/{samples,tests}/Mmakefile
Add "-I.." to MGNUCFLAGS so gcc can find unsafe.h which
is #included in c_header_code read from unsafe.opt.
Estimated hours taken: 4.5
Fix some bugs in code generation for nondet disjunctions and
if-then-elses. The compiler was incorrectly releasing the temp stack
slots used to save the heap pointer and trail pointer at the start
of the else or the last clauses, thus allowing them to be reused not
only in the else case or the last clause, but also by goals following the
disjunction or if-then-else, even though the values in these slots might
be needed again on backtracking into the condition or the earlier
disjunctions.
Thanks to Warwick Harvey for reporting this bug.
compiler/code_info.m:
Add new predicate `code_info__maybe_reset_and_pop_ticket',
which is like `code_info__maybe_reset_and_discard_ticket',
except that it does not release the temp stack slot.
compiler/disj_gen.m:
compiler/ite_gen.m:
When generating code for nondet goals that save
and restore the hp and trail, if the saved
values might be needed again on backtracking
into the current goal from one that follows
(i.e. in nondet disjunctions and in if-then-elses
with nondet conditions), make sure we use
`code_info__maybe_reset_and_pop_ticket' and
`code_info__reset_hp' instead of
`code_info__maybe_reset_and_discard_ticket' and
`code_info__reset_and_discard_hp'.
compiler/code_info.m:
Include the temp_avail_slots in the set of things
that slap_code_info does not update. Temp slots
that were acquired (and not released) in one branch
of a branched goal need to be still reserved at the
end of the branched goal.
extras/trailed_update/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/samples/tests.m:
extras/trailed_update/samples/tests.exp:
extras/trailed_update/tests/Mmakefile:
extras/trailed_update/tests/var_test.m:
extras/trailed_update/tests/var_test.exp:
Add a new subdirectory `tests' in extras/trailed_update,
and move the test case `tests.{m,exp}' from the samples
subdirectory into the tests subdirectory, at the same
time renaming it as `var_test.{m,exp}'.
extras/trailed_update/tests/Mmakefile:
extras/trailed_update/tests/func_trail_test.m:
extras/trailed_update/tests/func_trail_test.exp:
extras/trailed_update/tests/func_trail_test_2.m:
extras/trailed_update/tests/func_trail_test_2.exp:
Add a couple of regression tests for the bug mentioned above.
These tests need to go here rather than somewhere in the
main `tests' directory (e.g. `tests/hard_coded'), because
they only work in trailing grades, and the normal tests are
compiled in lots of grades, many of which don't have
corresponding trailing grades installed.
(I suppose we could put them in the main `tests' directory,
and only enable them for trailing grades, but it just seemed
easier to put them here.)