Estimated hours taken: 0.5
Branches: main
Do not use the installed mmc to compile the slice directory, because
this means you cannot install the source distribution on a machine that
doesn't already have Mercury installed.
The reason the slice directory was compiled with the installed mmc was so that
the mtc_union tool wouldn't be compiled with debugging enabled even if the
compiler was compiled with debugging. mtc_union is used to summarise
trace counts when coverage testing the compiler. If mtc_union is compiled
in a debug grade then tail recursion is lost and it runs out of stack space.
If we're going to coverage test the compiler then we should use the
MERCURY_OPTIONS option that lets us customise the summary command, to choose
a version of mtc_union not compiled with debugging.
Mmakefile:
Remove PLAIN_SUBDIR_MMAKE and instead use SUBDIR_MMAKE to compile
the slice directory.
configure.in:
Build SLICE_FLAGS.
slice/Mercury.options:
Don't warn about too lax determinism declarations in mtc_diff
(some of the option handling predicates have a multi determinism
declaration when they're actually det, since the option handling
predicates require a multi predicate).
slice/Mmakefile:
Revert 1.5 changes and add rules for mtc_diff and mcov.
slice/SLICE_FLAGS.in:
Put back flags for slice directory.
Estimated hours taken: 24
Branches: main
Add two new command line tools "mslice" and "mdice", which manipulate slices
and dices respectively. The functionality of "mdice" duplicates the
functionality of mdb's current "dice" command, while the functionality of
"mslice" is new.
runtime/mercury_trace_base.[ch]:
When generating trace count files, include information about the
context of each execution count. While mdb has access to this
information in the running program, mslice and mdice do not.
In any case, the code in mdb for looking up this information was
terribly inefficient.
Provide a mechanism for recording all execution counts, even the zero
ones, for use in coverage testing. This mechanism is not used yet.
Put a header on trace counts files, to make them recognizable as such.
Make this header indicate whether we are including zero trace counts.
runtime/mercury_wrapper.c:
Provide a flag in MERCURY_OPTIONS for turning on recording of
zero execution counts.
browser/dice.m:
mdbcomp/slice_and_dice.m:
Move most of the code of browser/dice.m to mdbcomp/slice_and_dice.m,
much modified; browser/dice.m is now empty. The modifications are
as follows.
Factor out the code for reading dices, since dices are useful
independent of mdb's dice command.
Generalize the code for computing dices to allow either or both
of the slices being subtracted to be specified as the union of
one or more trace counts files.
Add two more sort conditions for comparing the execution counts
in two slices: ascending and descending versions of simple execution
count differences.
For each operation we have so far performed on dices, add code
for performing that operation on slices.
browser/mdb.m:
Delete the include of dice.m, since it is now empty.
Delete a duplicate include_module of term_rep, and delete the now
unnecessary include_modules of set_cc and tree234_cc.
mdbcomp/mdbcomp.m:
Add slice_and_dice.m as a submodule.
mdbcomp/trace_counts.m:
Provide a mechanism to allow a slice to be specified as coming not
from a single trace count file but from the union operation on a set
of trace count files.
Convert to four-space indentation to eliminate some excessively
indented lines.
slice/mdice.m:
slice/mslice.m:
The main modules of two new commands. Their functionality is almost
entirely in mdbcomp/slice_and_dice.m and mdbcomp/trace_counts.m.
slice/Mmakefile:
New Mmakefile for building mslice and mdice. It is modelled on
profiler/Mmakefile.
slice/Mercury.options:
Empty file, for use in the future.
slice/.nocopyright:
Don't require copyright notice in Mercury.options.
Mmakefile:
Process the slice directory at appropriate points when processing
other directories.
compiler/tupling.m:
Conform to the updated interface of mdbcomp/trace_counts.
library/list.m:
Add versions of list__map for some more arities, for use in the code
above.
trace/mercury_trace_internal.c:
Generalize the code for specifying dices to allow either or both
of the slices being subtracted to be specified as the union of
one or more trace counts files.
Fix several places where we weren't checking the return value of
malloc. Fix two places where we could conceivably free strings that
were still alive. Fix some places where we could pass NULL strings
to Mercury code, and some places where we could free NULL pointers
(which, once upon a time, was not guaranteed to work on all platforms).
Use existing functions such as MR_copy_string where appropriate.
tests/run_one_test:
Fix two small bugs in this script: make the filenames more user
friendly, and make sure that gzip isn't asked to overwrite an
existing file, since that causes it to ask a question on stdout
and to wait for an answer.
tools/bootcheck:
Copy or link the slice directory into stage 2. Rename the
--copy-profiler option as --copy-profilers, since it now copies three
directories containing performance engineering tools: profiler,
deep_profiler and slice.