Estimated hours taken: 0.25
tools/run_all_tests_from_cron:
tools/test_mercury:
Set up to run the tests on mundroo (Solaris/x86 2.8).
The tests on mundroo and taifun are run 3 times a week.
Always test the main branch twice per week, rather than
just on even-numbered days.
Estimated hours taken: 8
Branches: main
Factor out the common Mmake code to set up the mmc, mgnuc
and ml flags when building the Mercury compiler and libraries.
Use options, not environment variables. This will make it simpler
to use `mmc --make' to compile the compiler.
Mmake.workspace:
Similar to tools/lmc. Sets up Mmake variables to
use the library files in a workspace rather than
an installed library.
configure.in:
Check for the `--no-mercury-stdlib-dir' mmc option.
Bootstrap CVS tag: bootstrap_20020429_stdlib_dir
Mmake.common.in:
*/Mmakefile:
Move common code into Mmake.workspace.
browser/Mmakefile:
library/Mmakefile:
Avoid invoking the linker explicitly when creating
libraries of Mercury code. That won't work well
with `mmc --make'.
tools/bootcheck:
tests/Mmake.common:
Use Mmake.workspace instead of setting up environment
variables in bootcheck.
scripts/Mmake.vars.in:
mmc compiles split C files to object code itself,
so pass `--cflags "$(ALL_CFLAGS)"' to mmc when
compiling with `--split-c-files'.
browser/interactive_query.m:
Use `mmc --make' when compiling the query. This is needed
to make tests/debugger/interactive_query.m work when linking
against a workspace using options rather than environment
variables. This also fixes a bug -- mmc options were being
passed to ml.
Clean up after the query.
tests/debugger/Mmakefile:
tests/debugger/interactive.inp:
tests/debugger/interactive.inp.subdirs:
tests/debugger/interactive.inp.nosubdirs:
tests/debugger/interactive.exp:
tests/debugger/interactive.exp2:
Generate the input file to this test so that MCFLAGS
and MC_MAKE_FLAGS (from Mmake.workspace) are used when
compiling queries.
tests/debugger/Mmakefile now sets SHELL to /usr/local/bash
to allow the use of $(...) style command substitution
(`...` style command substitution can't be nested).
tests/warnings/Mmakefile:
tests/dppd/Mmakefile:
Include tests/Mmake.common.
tools/*:
scripts/c2init.in:
scripts/ml.in:
Update the lists of files containing the library names.
Estimated hours taken: 1
Fix a compiler abort when compiling browser/declarative_user.m
with inter-module optimization and deforestation.
compiler/det_analysis.m:
Check the inferred determinism when deciding whether a
predicate should be in a single-solution context. The
declared determinism is not set for procedures introduced
by deforestation.
compiler/deforest.m:
Don't attempt to improve the determinism of procedures
with determinism cc_multi or cc_nondet -- those determinisms
can't be inferred, and attempting to do so would cause
errors in determinism analysis.
tests/hard_coded/Mmakefile:
tests/hard_coded/deforest_cc_bug.{m,exp}:
Test case.
Estimated hours taken: 5.5
Branches: main
Implement compare_representation/3, which is like compare except that it
is cc_multi, and it doesn't abort on non-canonical types. The implementation
only works for the LLDS backend; in other cases, the runtime aborts with
a "sorry" message. For this reason, it is not officially part of the
standard library yet.
library/std_util.m:
Add the new predicate, which is implemented via "external".
runtime/mercury_ho_call.c:
Implement compare_representation/3, and also a C version.
runtime/mercury_unify_compare_body.h:
Implement the body of compare_representation/3. When the macro
include_compare_rep_code is defined comparison of preds and
funcs doesn't abort, the code that is used for MR_COMPARE_BY_RTTI
is enabled, and usereq types are treated as normal types.
runtime/mercury_conf_param.h:
Document the fact that calls to compare_representation are
counted as calls to compare for the purposes of MR_TYPE_CTOR_STATS.
runtime/Mmakefile:
Bug fix: add missing pic_o versions of the explicit dependencies.
Use variables for the suffixes in these dependencies.
runtime/mercury.c:
runtime/mercury.h:
Supply a HIGHLEVEL_CODE version of the new predicate. This just
gives a "Sorry, not implemented" message and aborts.
tests/hard_coded/Mmakefile:
tests/hard_coded/compare_rep_usereq.exp:
tests/hard_coded/compare_rep_usereq.m:
tests/hard_coded/compare_representation.exp:
tests/hard_coded/compare_representation.m:
Test cases.
tests/hard_coded/compare_rep_array.m:
A test case which doesn't work yet.
Estimated hours taken: 0.1
Branches: main
tests/valid/Mmakefile:
foreign_type_spec.m contains a `pragma foreign_type(il, ...)'
declaration, so always compile it in grade `il'.
Estimated hours taken: 0.1
Branches: main
browser/declarative_analyser.m:
Document the type variable naming conventions for mercury_edt.
browser/declarative_execution.m:
Document the type variable naming conventions for annotated_trace.
browser/declarative_debugger.m:
Document the type edt_node/1.
Estimated hours taken: 0.25
Branches: main
compiler/compile_target_code.m:
compiler/make.program_target.m:
compiler/make.util.m:
Put the `lib' prefix on the filenames for `.a' and `.so' files.
Estimated hours taken: 6
Branches: main
Fix test case failures involving type_ctor_descs in .rt grades.
The cause of the failures was that the type_ctor_rep for type_ctor_descs (which
happens to be 35) does not fit into a signed 8-bit integer in .rt grades,
since those grade require 2 bits for a primary tag (3 bits on 64-bit machines).
The fix is to make the type_ctor_rep field in type_ctor_infos 16 bits in size.
To maintain alignment, this requires swapping that field with the num_ptags
field.
The second part of this change will remove the bootstrapping code and raise
the binary compatibility version number. That part cannot be committed until
this part has been installed on all our machines.
runtime/mercury_type_info.h:
Define a new version of the type_ctor_info structure with this swap
and size increase. Provide backward compatibility for bootstrapping.
runtime/mercury_mcpp.h:
library/rtti_implementation.m:
java/runtime/TypeCtorInfo_Struct.m:
Make the same change.
compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
compiler/mlds_to_gcc.m:
Generate the new type_ctor_info structure.
compiler/llds_out.m:
compiler/mlds_to_c.m:
Generate a macro that selects the new version of the type_ctor_info
structure.
compiler/type_ctor_info.m:
Update the type_ctor_info version number.
Estimated hours taken: 1
Branches: main
compiler/make.module_target.m:
The `.int0' file for a module depends on the `.int0' file for the
parent module, which caused circular dependencies with nested
sub-modules, resulting in a compiler abort. The circular dependencies
are now removed from the list of dependencies to make.
Test case: tests/valid/foreign_type_spec.m.
Estimated hours taken: 0.5
Branches: main
Fix a bug reported by Peter Ross.
compiler/special_pred.m:
Don't generate unification predicates for foreign types lazily.
The clauses contain calls to a polymorphic predicate
(private_builtin__nyi_foreign_type_unify) which
polymorphism__process_generated_pred can't handle
after polymorphism has been run.
tests/valid/Mmakefile:
tests/valid/foreign_type_spec.m:
Test case.
Estimated hours taken: 60
Branches: main
Redesign the way the declarative debugger tracks dependencies, to avoid bugs
and make the code comprehensible. This required tackling an issue we could
ignore before: the typeinfos added to procedure arguments by the compiler.
browsers/declarative_debugger.m:
Rewrite the dependency algorithm from scratch. It now has three phases:
materializing the contour leading up to the relevent point in the
procedure body, using that contour to construct a list of the conjoined
primitive operations executed up to that point by the procedure body,
and tracking the source of the marked subterm in this list of
primitives.
Add a mechanism to print out the result of the dependency tracking
algorithm if a flag is set, for testing and debugging.
browsers/declarative_analyser.m:
Transmit the result of the dependency tracking algorithm to where
it may be printed out.
browsers/declarative_user.m:
Update the user interface to make it switchable between viewing atoms
from the user's perspective (with compiler-generated arguments hidden)
and the implementor's perspective (with compiler-generated arguments
visible). The default view is the user view.
browsers/declarative_execution.m:
Add the immediate parent's goal path to the representation of call
events; this allows us to place the call in the body of its parent.
Expand the representation of atom arguments to include their HLDS
variable numbers, and a boolean that says whether the argument
is a programmer-visible headvar.
Use this extra information to add support for indexing lists of
arguments from either the user view or the implementor view.
Add field names to several types.
browsers/program_representation.m:
Add a field to plain calls, giving the name of the module defining
the called procedure. This is necessary to reliably distinguish
the builtin unify and compare procedures, calls to which must be
handled specially because they generate no events. (They don't need to,
since they are correct by construction.)
Add mechanisms for converting goal paths from strings to structured
terms, for use by the dependency tracking code.
Add tests on atomic goals, for use by the dependency tracking code.
Add a mechanism to let C code retrieve the types of proc_reps as well
as goal_reps.
compiler/prog_rep.m:
Fill in the module name field in plain calls.
trace/mercury_trace_vars.[ch]:
Add functions to get information about a variable specified by HLDS
number.
trace/mercury_trace_declarative.c:
Include typeinfos in the atoms constructed at interface events.
(The same code will work for typeclassinfos as well, once they
become deconstructable and hence printable.)
Fill in the extra slot in call events, and the extra slots in
representations of atom arguments.
trace/mercury_trace_internal.c:
Fix a bug in the implementation of the proc_body command: the
type of the proc_rep slot is proc_rep, not goal_rep.
tests/debugger/declarative/dependency.{m,inp,exp}:
A new test case to exercise dependency tracking. It cooperates with
instrumentation code in the browser directory to print out the result
of each trace_dependency operation.
The test case also tests the proc_body command.
tests/debugger/declarative/Mmakefile:
Enable the new test case.
Estimated hours taken: 0.1
Branches: main
Fix bugs in my change to improve the handling of linking
with a non-installed standard library.
scripts/mmake.in:
Export MERCURY_STDLIB_DIR.
scripts/Mmake.rules:
Always set MERC_INT_DIR to avoid undefined variable warnings.
Estimated hours taken: 6
Branches: main
Allow alternative locations for the standard library files
to be specified using options to the various Mercury scripts
rather than environment variables. This change is necessary
to allow the compiler to be compiled using `mmc --make', because
`mmc --make' does not support the environment variables.
All of the Mercury scripts now accept an option
`--mercury-standard-library-directory' to specify the installed
library to use, or `--no-mercury-standard-library-directory' to
disable the use of the installed library. The location
of the alternate files to use can then be specified
using ordinary options to the scripts.
There is a new environment variable MERCURY_STDLIB_DIR, which has
the same effect as the `--mercury-standard-library-directory' option.
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
scripts/mmc.in:
scripts/mmake.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
Handle MERCURY_STDLIB_DIR and `--mercury-standard-library-directory'.
Remove support for the MERCURY_C_INCL_DIR, MERCURY_MOD_LIB_DIRS
and MERCURY_TRACE_LIB_DIRS environment variables -- they aren't
used anywhere. MERCURY_C_INCL_DIR is being removed because the
assumption it makes (that all header files are installed into
a single directory) will not hold for much longer because the
generated header files for hl* grades are grade dependent.
compiler/options.m:
compiler/compile_target_code.m:
Add an option `--trace-init-file', used to specify `.init'
files which should only be used when tracing is enabled,
such as browser/mer_browse.init.
Allow `--mercury-stdlib-dir' as an abbreviation for
`--mercury-standard-library-directory'.
tools/lmc:
Use options rather than environment variables.
doc/user_guide.texi:
Document MERCURY_STDLIB_DIR, MERCURY_TRACE_LIB_MODS
and the `--trace-init-file' mmc option.
Remove documentation for the no longer used MERCURY_C_INCL_DIR,
MERCURY_MOD_LIB_DIRS, MERCURY_TRACE_LIB_DIRS and
MERCURY_NC_BUILTIN environment variables.
Estimated hours taken: 0.1
Branches: main
compiler/mercury_compile.m:
Don't search for source files. This avoids creating interface
files for the library in the compiler directory if you modify
a module in the library but forget to recompile it.
Estimated hours taken: 0.1
Branches: main
tests/debugger/nondet_stack.exp3:
Update this version of expected output for the recent change to
polymporphism.m.
Estimated hours taken: 0.1
Branches: main
extras/odbc/odbc.m:
Patch submitted by Michael Cameron <mcam@csse.monash.edu.au> to get the
ODBC interface working with recent versions of the runtime system.
Estimated hours taken: 2
Branches: main
A performance improvement for accurate GC.
compiler/mercury_compile.m:
Fix an XXX comment: invoke tail call optimization before
ml_elim_nested.m. This ensures that the stack setup code for
accurate garbage collection gets put outside the tail-recursive
loop rather than inside the loop.
compiler/ml_optimize.m:
When optimizing tail calls, generate assignments rather than
initializers for the temporary variables. This is needed now
that tail call optimization is done before ml_elim_nested.m.
Also mark those temporary variables as not needing GC.
Estimated hours taken: 0.5
Branches: main
compiler/layout_out.m:
Fix a typo in my earlier change to add head variable numbers to
proc_layout structures.
Estimated hours taken: 1
Branches: main
compiler/rtti_out.m:
Cast the elements of the vectors inside TypeInfos and PseudoTypeInfos
to the right type, to shut up warnings. Do so systematically, instead
of as a special hack for PseudoTypeInfos. (We cannot avoid casts
altogether, because we want TypeCtorInfos to be acceptable as both
TypeInfos and as PseudoTypeInfos.)
Estimated hours taken: 0.5
Branches: main
compiler/polymorphism.m:
Give the Mercury variables containing type_ctor_infos a meaningful,
non-misleading name, i.e. name them TypeCtorInfo, not TypeInfo.
tests/debugger/nondet_stack.exp*:
Update expected output containing variable names affected by the
change to polymorphism.m.
Estimated hours taken: 3
Branches: main
Make the commands that update the browser parameters within the browser itself
affect the parameter settings only for the current browser caller type (print,
print all, or browse).
browser/browse_info.m:
Add the current call type to the browser state.
Add a more convenient mechanism for setting the parameters only for a
specified caller type.
Make some existing code look nicer.
browser/browse.m:
When setting parameters, set them only for the current caller type.
tests/debugger/browse_pretty.exp:
Update the expected output of this test case.
Estimated hours taken: 8
Branches: main
Allow arbitrary mappings from source file name to module name.
The mapping is created using the command `mmc -f *.m', which must
be run before `mmake depend'.
compiler/parse_tree.m:
compiler/source_file_map.m:
compiler/notes/compiler_design.html:
Add a new module to read, write and search the mapping.
compiler/modules.m:
Use the source file map when searching for source files.
Export `make_directory' for use by source_file_map.m.
Use the module name rather than the source file name to
generate the executable name. This matches the documentation
in the User's Guide, and it's needed to make the tests work.
compiler/prog_io.m:
Separate out the code to read the first item in a module to
find the module name into a new predicate, `find_module_name'.
compiler/handle_options.m:
Don't complain about the module name not matching the file
name when generating the Mercury.modules file -- the file
only needs to be generated when the module name doesn't
match the file name.
compiler/llds_out.m:
Remove a duplicate copy of `make_directory'.
compiler/options.m:
compiler/mercury_compile.m:
doc/user_guide.texi:
Add the `--generate-source-file-mapping' (-f) option
to generate the mapping.
NEWS:
Document the change.
tests/hard_coded/Mmakefile:
tests/hard_coded/source_file_map.m:
tests/hard_coded/mapped_module.exp:
Test case.
Estimated hours taken: 0.1
Branches: main
tools/makebatch:
Add an option to preserve the entire stage2 of each run in the batch.
This can be useful e.g. when one uses makebatch to find out which
optimization levels work and which do not, prior to applying
tools/binary.
Estimated hours taken: 0.2
tests/debugger/completion.exp2:
tests/debugger/completion.exp4:
tests/debugger/completion.exp5:
Handle differences in the output depending on whether the
declarative debugger is enabled or disabled.
tests/Mmake.common:
Handle `.exp4' and `.exp5' files.
Estimated hours taken: 6
Branches: main
compiler/reassign.m:
Fix a bug that caused the compiler to generate incorrect code
if both --use-local-vars and --optimize-reassign were enabled.
--use-local-vars generates references to temporaries. The bug
was that after an instruction sequence such as the following one
from parse_goal_with_purity:
r3 = tempr1;
tempr1 = r4;
reassign.m thought that tempr1 still had the same value in it
as r3. It effectively ignored the second assignment because it
wasn't assigning to an lval of the right form. The fix is to include
temporaries in the right forms.
Estimated hours taken: 0.1
Branches: main
runtime/mercury_unify_compare_body.h:
Fix some trivial compilation errors in code that is enabled only with
-DMR_COMPARE_BY_RTTI.
Estimated hours taken: 4
Branches: main
To handle the tracing of dependencies in polymorphic predicates, the
declarative debugger will soon need to know, for each procedure,
the full list of that procedure's head variables, not just the list of
programmer-created head variables.
To this end, we add to each procedure's layout structure a vector
of the head variables' variable numbers.
Code to make use of this new vector will be in a later change.
compiler/layout.m;
Add a way to refer to the head variable number vector.
compiler/layout_out.m;
compiler/opt_debug.m;
Add code to output the head variable number vector.
compiler/stack_layout.m;
Add code to generate the head variable number vector.
Fix some old variable names.
runtime/mercury_stack_layout.h;
Add the head variable number vector to procedure layouts.
Add some missing documentation.
Estimated hours taken: 0.1
Branches: main
runtime/mercury_ho_call.c:
Fix what appears to be a cut and paste error.
runtime/mercury_unify_compare_body.h:
Fix a type error -- a bool was being treated like a comparison_result.
Estimated hours taken: 40
Branches: main
A step towards RTTI in Mercury.
This step redefines the representation of pseudo-typeinfos inside the compiler
to be identical to the representation we will need for efficient interpretation
of RTTI data structures in Mercury. Later steps will do likewise for
typectorinfos. In the end, we will have two implementations of RTTI:
the current low-level, very efficient one written in C, which will be used
by the C backends (both LLDS and MLDS), and a new, higher-level one
which will use Mercury data structures and Mercury predicates for
interpretation (along the lines of library/rtti_implementation.m)
for the Java and IL backends.
A large part of this change concerns the fact that pseudo-typeinfos can now
contain typeinfos as well as other pseudo-typeinfos, and they do in the
frequent case that the type of an argument is ground. Given that typeinfos
are just special cases of pseudo-typeinfos, the code for handling the two
types is usually similar, with common code factored out when relevant.
In the process of redesigning the data structures concerning (pseudo-)
typeinfos, I also fixed an old naming scheme that has become misleading.
The representation of a (pseudo-) typeinfo depends on whether the principal
type constructor is fixed arity or not. We used to denote this distinction
with the phrases first-order vs higher-order, since at first the only variable
arity type constructors were pred and func. However, this hasn't been true
since we added tuples. I have changed the naming scheme to be fixed-arity vs
variable-arity.
compiler/rtti.m:
Add new, purely Mercury data structures for representing typeinfos
and pseudo-typeinfos, designed both for efficient interpretation
and as a source for the generation of static data structures in C.
compiler/pseudo_type_info.m:
Delete the type definitions here, since they are superseded by the new
definitions in rtti.m.
Add predicates for constructing typeinfos as well as pseudo-typeinfos,
since now we need those too.
Conform to the changed data structures for (pseudo-) typeinfos.
compiler/ll_pseudo_type_info.m:
compiler/ml_closure_gen.m:
compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
compiler/opt_debug.m:
compiler/type_ctor_info.m:
Conform to the changed data structures for (pseudo-) typeinfos.
compiler/mlds.m:
Since the MLDS now refers to type_infos, add their type
(mlds__type_info_type) to the list of types the MLDS knows about.
compiler/ml_code_util.m:
compiler/mlds_to_c.m:
compiler/mlds_to_il.m:
compiler/mlds_to_java.m:
Handle mlds__type_info_type.
compiler/mlds_to_gcc.m:
Conform to the changed data structures for (pseudo-) typeinfos,
and handle mlds__type_info_type.
runtime/mercury_bootstrap.h:
Override the compiler-generated names of the type_ctor_infos of the
variable arity type constructors. The MLDS backend requires these
to be module qualified; the LLDS backend requires them to be
unqualified. This is a problem because the same code now generates
the compiler's internal representation of pseudo-typeinfos for both
backends.
The temporary solution is to have the compiler generate these names
module qualified, and have these macros convert them to the unqualified
form. (The long term solution should be to always module qualify
everything, but doing that is for another change.)
runtime/mercury_type_info.h:
Change the naming scheme from first order vs higher order to fixed
arity vs variable arity.
library/construct.m:
library/deconstruct.m:
runtime/mercury.c:
runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_make_type_info_body.h:
runtime/mercury_ml_expand_body.h:
runtime/mercury_tabling.c:
runtime/mercury_type_desc.c:
runtime/mercury_type_info.c:
runtime/mercury_unify_compare_body.h:
Conform to the new naming scheme.
runtime/mercury.h:
Conform to the new naming scheme.
Declare fixed and variable arity types for typeinfos as well as
pseudo-typeinfos, since pseudo-typeinfos can now refer to typeinfos.
Estimated hours taken: 0.1
Branches: main
trace/mercury_trace_internal.c:
Don't include `dd' and `dd_dd' in the command
list if MR_USE_DECLARATIVE_DEBUGGER is not set.
Estimated hours taken: 1.5
Branches: main
Fix bugs in the handling of predicate and function
declarations using `with_type`.
compiler/prog_io.m:
Fix spurious errors for `with_type` and determinism
in the one declaration. Function declarations with
the default modes can use this form of declaration.
compiler/mercury_to_mercury.m:
Fix the order of `with_type` annotations and class constraints.
tests/recompilation/unchanged_with_type*:
Test case.
Estimated hours taken: 4
Branches: main
trace/mercury_trace_internal.c:
Break up the big function into 60 smaller functions, one for each
debugger command.
Make sure that all the commands are in the command table, since
after this change they cannot be invoked if they are not.
doc/mdb_categories:
Add some missing commands to the category lists.
tests/debugger/completion.exp:
Update the expected outcome to reflect the presence of more debugger
commands in the command table.