Estimated hours taken: 0.1
Branches: main
util/Mmakefile:
Remove a reference to the MERCURY_C_INCL_DIR environment
variable, which is no longer supported.
Estimated hours taken: 0.5
Branches: gc
Import version 6.1alpha5 of the Boehm collector,
using the following commands:
zcat gc6.1alpha5.tar.gz | tar -xvf -
cd gc6.1alpha5
cvs import -I \! mercury/boehm_gc gc gc_6_1alpha5
Estimated hours taken: 0.5
Branches: gc
Import version 6.1alpha5 of the Boehm collector,
using the following commands:
zcat gc6.1alpha5.tar.gz | tar -xvf -
cd gc6.1alpha5
cvs import -I \! mercury/boehm_gc gc gc_6_1alpha5
Estimated hours taken: 2
Branches: main
Backout out my previous change to place foreign_decls in header files so
that the definitions would be available for use by pragma exports.
compiler/export.m:
compiler/foreign.m:
compiler/mercury_compile.m:
Backout changes.
library/io.m:
runtime/mercury_init.h:
Remove foreign_type version of io__stream, as this required the
previous change.
Estimated hours taken: 0.2
Branches: main
tools/speed_summary:
Generalize the script to allow it to summarize the results from speed
trials of programs other than the compiler.
Estimated hours taken: 0.1
Branches: main
compiler/export.m:
compiler/foreign.m:
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
Back out Peter Ross's last change. It doesn't compile.
Estimated hours taken: 0.5
Branches: main
compiler/modules.m:
Put instance declarations in the `.int2' files to avoid
producing `superclass constraints not satisfied' errors
for instance declarations for subclasses defined in the
interface of importing modules.
Without this change, all modules importing the module defining
the instance for the subclass must also import the module
defining the instance for the superclass.
tests/valid/Mmakefile:
tests/valid/transitive_instance.m:
Test case.
Estimated hours taken: 2
Branches: main
Place the decls both in the .mh file and in either the .c (LLDS) or .mih (HLDS) file protected with a #ifndef/#define block.
compiler/export.m:
Don't output #line blocks around the decls so as to avoid unnecessary
changes to the .mh file and redundant compilations.
compiler/foreign.m:
Add the function decl_guard which returns the string that is used to
protect the declarations from being defined twice.
compiler/export.m:
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
Protect all the declarations with a #ifndef/#define block.
Estimated hours taken: 0.25
Branches: main
compiler/mlds_to_il.m:
Add the change to mlds_to_il.m which checks that every argument is
boxed that didn't get commited in my previous change.
Estimated hours taken: 120
Branches: main
Allow the library to compile in the grade il (high level data).
compiler/ml_util.m:
Add more types which need to be represented using the low level
representation because of how they are handled in the library.
compiler/mlds_to_il.m:
Remove an XXX which is no longer necessary.
Add the heap_pointer type to the list of types whose RTTI is defined
by hand.
library/exception.m:
Move the definition of Exception from the runtime to the local module.
This is needed for when univ/0 is no longer represented as a low level
type.
runtime/mercury_mcpp.cpp:
Remove the implementation of Exception that is now in exception.m.
library/Mmakefile:
The lowlevel Exception type is now defined in the library not the
runtime, so add rules to ensure that the foreign code is built in
the correct order.
library/io.m:
Reimplement io__stream as a foreign_type. This makes the code more
type safe and avoids problems with the different representation of
the io__stream type when using high and low level data.
Change io__command_line_arguments so that it throws an exception
when we use high level data, as I am yet to work out how to access
high level lists.
library/rtti_implementation.m:
Add a comment that get_subterm doesn't work with high level data.
Fix some bugs with the default versions of type_ctor_compare_pred and
type_ctor_unify_pred.
library/sparse_bitset.m:
Remove the foreign_proc implementation of make_bitset_elem as it
will not work with both data representations and their is a Mercury
implementation.
library/string.m:
Remove the foreign_proc implementation of all the predicates which
manipulate lists as they all have a Mercury implementation, as I am yet
to work out how to access high level lists.
Add a Mercury implementation for string__join_list.
runtime/mercury_mcpp.h:
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
Define and use typedefs where appropiate for type_info/0, type_info/1,
comparison_result/0 and univ/0, as there representation may change in
the future between using high level and low level data.
Estimated hours taken: 0.1
Branches: main
browser/util.m:
Fix a bug in Zoltan's last change which broke hlc grades.
Use `:- pragma foreign_import_module(c, bool)' rather
than `#include "bool.h"'.
Estimated hours taken: 12
Branches: main
Until now, programmers could add `tabled_for_io' annotations to foreign_procs
that do I/O, which asks the compiler to make those foreign_procs idempotent,
i.e. ensures that they are performed at most once even in the presence of a
retry operation in the debugger. This change adds a compiler option,
--trace-table-io-require, which generates an error if a foreign_proc that does
I/O does not have this annotation. Specifying this option thus ensures
that all I/O done by the program is idempotent.
In the future, we may want to have this option turned on in all debugging
grades. Until we decide about, the new option is not yet documented.
compiler/options.m:
Add the new option --trace-table-io-require.
compiler/handle_options.m:
Make --trace-table-io-require imply --trace-table-io.
compiler/table_gen.m:
If --trace-table-io-require is enabled, require all I/O primitives
to have the tabled_for_io annotation.
compiler/mercury_compile.m:
Pass I/O states to table_gen.m, since it can now generate error
messages.
trace/mercury_trace_util.h:
trace/mercury_trace_vars.c:
When calling Mercury code from the trace directory, disable I/O
tabling, since any I/O actions executed by Mercury code in the browser
directory (or by library code called from there) should not be tabled,
not being part of the user program.
Due to the depth of nesting, make mercury_trace_vars.c use four-space
indentation.
browser/collect_lib.m:
browser/declarative_debugger.m:
browser/declarative_execution.m:
browser/dl.m:
browser/io_action.m:
browser/mdb.m:
browser/name_mangle.m:
browser/util.m:
compiler/gcc.m:
compiler/mercury_compile.m:
compiler/passes_aux.m:
compiler/process_util.m:
compiler/stack_layout.m:
library/io.m:
library/time.m:
tests/debugger/declarative/tabled_read_decl.m:
Add a whole lot of tabled_for_io annotations, to enable the compiler to
bootstrap with --trace-table-io-require enabled.
In many cases, this required turning old-style pragma c_code into
pragma foreign_proc. While doing that, I standardized the layouts
of pragma foreign_procs.
browser/util.m:
Turn an impure semidet predicate into a pure det predicate with I/O
states, to allow it to be tabled. Make it return a Mercury bool
to indicate success or failure.
library/bool.m:
Add functions that allow C code to get their hands on the constants
`yes' and `no', for communication with Mercury code.
library/table_builtin.m:
Add debugging code to the main primitive of I/O tabling. This is
controlled both by the macro for retry debugging and a boolean global.
library/mercury_trace_base.[ch]:
Add the boolean global variable to switch the new debugging code in
table_builtin.m on and off.
library/mercury_trace_internal.c:
When starting I/O tabling with retry debug enabled, turn on the switch.
tests/debugger/queens.exp3:
New expected output file that applies when the library is compiled with
--trace-table-io-require.
Estimated hours taken: 5
Branches: main
Fix a bug which caused type-incorrect HLDS to be generated by mode
analysis, which then caused a compiler abort in simplification.
In the code below, mode analysis must treat the headvar unification
as a construction followed by a var-var unification. If it is treated
as a deconstruction, the argument unifications will be ill-typed.
:- type t ---> some [T] f(T) => enum(T).
:- pred p(t::in) is semidet.
p('new f'(1)).
compiler/modecheck_unify.m:
Make sure unifications with a RHS of the form 'new f(X)'
are always classified as constructions.
compiler/hlds_goal.m:
compiler/*.m:
Add a field to var-functor unifications which identifies
those which must be treated as constructions.
compiler/polymorphism.m:
Fill in the field.
tests/hard_coded/Mmakefile:
tests/hard_coded/unify_existq_cons.{m,exp}:
Test case.
Estimated hours taken: 0.2
Branches: main
compiler/make_hlds.m:
Removed redundant "\n"s from format arguments for report_error calls
introduced in the state variable transformation.
ts/invalid/state_vars_test1.m:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test2.m:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test3.m:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/state_vars_test4.m:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/state_vars_test5.m:
tests/invalid/state_vars_test5.err_exp:
Minor clean-ups and changed the .err_exp files to match the
expected output after the change to the error message
formatting.
Estimated hours taken: 0.2
Branches: main
compiler/make_hlds.m:
Removed redundant "\n"s from format arguments for report_error calls
introduced in the state variable transformation.
Estimated hours taken: 3
Branches: main
compiler/inlining.m:
Fix a bug in inlining of procedures with typeclass constraints.
The type_info location for the callee overwrote the location
in the caller, but the location in the callee may have been
computed by extracting type_infos from typeclass_infos in the
caller, so it wouldn't be valid when computing the locations of
the type variables in the head of the caller.
Remove a partial work-around for this bug, which disabled
inlining of procedures with class constraints when tracing
is enabled. The work-around didn't prevent the code generator
abort occurring when constructing closure layouts.
tests/valid/Mmakefile:
tests/valid/typeclass_inlining_bug.m:
Test case.
Estimated hours taken: 120
Branches: main
Allow the library to compile in the grade il (high level data).
compiler/ml_util.m:
Add more types which need to be represented using the low
level representation because of how they are handled in the library.
compiler/mlds_to_il.m:
Remove an XXX which is no longer necessary. Add the
heap_pointer type to the list of types whose RTTI is defined by hand.
library/exception.m:
Move the definition of Exception from the runtime to the local
module. This is needed for when univ/0 is no longer represented
as a low level type.
runtime/mercury_mcpp.cpp:
Remove the implementation of Exception that is now in exception.m.
library/Mmakefile:
The lowlevel Exception type is now defined in the library not
the
runtime, so add rules to ensure that the foreign code is built
in
the correct order.
library/io.m:
Reimplement io__stream as a foreign_type. This makes the code more
type safe and avoids problems with the different representation of
the io__stream type when using high and low level data.
Change io__command_line_arguments so that it throws an exception
when we use high level data, as I am yet to work out how to access
high level lists.
library/rtti_implementation.m:
Add a comment that get_subterm doesn't work with high level data.
Fix some bugs with the default versions of type_ctor_compare_pred and
type_ctor_unify_pred.
library/sparse_bitset.m:
Remove the foreign_proc implementation of make_bitset_elem as it
will not work with both data representations and their is a Mercury
implementation.
library/string.m:
Remove the foreign_proc implementation of all the predicates which
manipulate lists as they all have a Mercury implementation, as I am yet
to work out how to access high level lists.
Add a Mercury implementation for string__join_list.
runtime/mercury_mcpp.h:
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
Define and use typedefs where appropiate for type_info/0, type_info/1,
comparison_result/0 and univ/0, as there representation may change in
the future between using high level and low level data.
Estimated hours taken: 8
Branches: main
Fix generated C errors where a `:- pragma foreign_type' refers to a C
type which is not in scope where it is used in the prototype for a
predicate with a `:- pragma export' declaration.
compiler/export.m:
Record in the foreign_export_decls type all the foreign_decls iff
the module contains foreign types.
Output the foreign decls in the header file if needed.
compiler/foreign.m:
Change foreign_export_decls so that it records the foreign_decls
if needed by virtue of the module containing foreign_types.
compiler/hlds_module.m:
Add a new field to the module_info which records whether or not a
module contains a foreign type.
compiler/make_hlds.m:
Set the contains_foreign_type field.
compiler/mercury_compile.m:
If the module contains a foreign type then the decls will be placed
in the header file so remove them from processing in the c file.
Estimated hours taken: 0.1
Branches: main
tools/bootcheck:
Allow a workspace to have a file, .BOOT_GRADE, that sets the default
grade for bootchecks.
Do not require .KEEP_OBJS, which turns on --keep-objs by default,
to be a directory.
Estimated hours taken: 0.25
Branches: main, release
tests/startup:
tests/shutdown:
tests/handle_options:
Don't use `mmake -j realclean' (which puts no limit on the
number of jobs run). This was exceeding the process limit
on mundroo.
Estimated hours taken: 1.5
Branches: main
library/pprint.m:
Clean up this file a bit, to make future merges with the
mode-constraints branch easier.
Add special casing for variables and sparse bitsets, since these can be
useful.
Group predicates and functions logically.
Put the casting predicates and the *_to_doc functions for the special
cases in the same order as the special case tests in to_doc itself.
Shorten excessively long dividing lines.
tests/hard_coded/pprint_test.{m,exp}:
A new test case to test the new additions to to_doc.
tests/hard_coded/Mmakefile:
Enable the new test case.
Estimated hours taken: 0.1
tools/test_mercury:
Test the hl.* grades. Previously they weren't tested
because installation of header files for both hl and hlc
grades didn't work.
Estimated hours taken: 0.1
Branches: main
scripts/Mmake.vars.in:
compiler/handle_options.m:
Fix a bug -- the grade-specific `inc' directory
for an installed library must be searched first.
`.mih' files are installed into the non-grade-specific
directory to avoid adding an extra entry in VPATH,
but those files won't necessarily be the right ones
for the current grade.
Estimated hours taken: 2
Branches: main
Fix a bug in inter-module optimization with sub-modules reported
by Michael Day <mikeday@bigpond.net.au>. The symptom was a compiler
abort due to an attempt to take the address of a predicate with
multiple modes. The predicate only had multiple mode declarations
because the declarations were read from both the `.int0' and `.opt'
files for the module.
compiler/post_typecheck.m:
compiler/purity.m:
Remove duplicate modes and report other errors in type
declarations for all predicates in a separate pass before
purity checking and overloading resolution.
tests/valid/Mmakefile:
tests/valid/intermod_nested_module_bug.m:
tests/valid/intermod_nested_module_bug2.m:
Test case.
tests/valid/assoc_list.m:
tests/valid/assoc_list_bug.m:
Rename the assoc_list test case -- it interfered with
other test cases attempting to import the assoc_list
library module.
Estimated hours taken: 2
Branches: main
Fix a bug that meant we generated invalid code for foreign_proc IL.
Recent changes to variable naming unifications uncovered this bug.
compiler/ml_code_gen.m:
Use the user's names for variables when generating locals for
use in foreign_proc for IL, so that they match the names given
in the foreign code.
Estimated hours taken: 0.5
Branches: main
Give a better error message for nonexistent modules specified
in `:- import_module' or `:- include_module' declarations.
compiler/make.m:
compiler/make.dependencies.m:
compiler/make.module_dep_file.m:
Track which module imported or included the module
currently being processed when generating dependencies,
and include the name of the importing module in the error
message generated when a module can't be found.
tests/invalid/Mmakefile:
tests/invalid/nonexistent_import.{m,err_exp}:
Test case.
Estimated hours taken: 0.2
Branches: main
bench/*:
Update the benchmarking tools for the stack slot optimization to
allow testing at different optimization levels.
Estimated hours taken: 4
Branches: main
bench/progs/compress/*:
bench/progs/icfp2000/*:
bench/progs/icfp2001/*:
bench/progs/nuc/*:
The source code of four benchmark programs, and everything you
need to build them and run run.
bench/progs/*:
Tools for measuring the speed of these programs.
Estimated hours taken: 600
Branches: main
Implemented state variable transformation.
NEWS:
Record new syntax and withdrawl of !/0 as Prolog cut.
compiler/hlds_goal.m:
compiler/hlds_out.m:
Added implicit/1 constructor to unify_main_context for cases where
variables are introduced by compiler transformations.
compiler/make_hlds.m:
Integrated the state variable transformation with the conversion to
HLDS.
compiler/mercury_compile.m:
Removed two unnecessary Prolog cuts left over from the Dark
Ages.
compiler/mercury_to_mercury.m:
Added code to output the new goal_expr constructors for state
variable quantifiers (some_state_vars and all_state_vars.)
Adapted to handle changes to if_then and if_then_else
goal_expr constructors which now include lists of state
variables that scope over the condition- and then-goals.
compiler/module_qual.m:
compiler/prog_util.m:
Changes to handle some_state_vars, all_state_vars, and changes
to if_then and if_then_else goal_expr constructors.
compiler/prog_data.m:
Added some_state_vars, all_state_vars constructors and changed
if_then and if_then_else constructors in type goal_expr.
compiler/prog_io_dcg.m:
Changes to handle quantified state variables.
compiler/prog_io_goal.m:
parse_some_vars_goal now also separates out quantified state
variables.
compiler/prog_io_util.m:
Added pred parse_quantifier_vars/3 which also detects state
variables.
compiler/typecheck.m:
Added case to report_error_undef_cons to handle any uncaught
uses of !/1.
doc/reference_manual.texi:
Documented the transformation.
library/builtin.m:
library/prolog.m:
Deleted code for `!' as fake Prolog cut.
library/lexer.m:
Made `!' a graphic token rather char than a special token.
library/ops.m:
Added `!', `!.' and `!:' as prefix ops.
library/term.m:
Added func var_id/1 which returns an int associated with its
var argument which is unique in the context of the given var
and the varset it belongs to.
library/varset.m:
Added pred new_uniquely_named_var/4 which creates a named
variable with a unique (w.r.t. the varset) number suffix.
tests/general/Mmakefile:
tests/general/state_vars_tests.exp:
tests/general/state_vars_tests.m:
tests/general/state_vars_typeclasses.exp:
tests/general/state_vars_typeclasses.m:
tests/invalid/Mmakefile:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test1.m:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test2.m:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/state_vars_test3.m:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/state_vars_test4.m:
tests/invalid/state_vars_test5.err_exp:
tests/invalid/state_vars_test5.m:
Added.
Estimated hours taken: 0.1
Branches: main
extras/moose/moose.m:
Action methods are functions so write them out using function syntax
rather than pred syntax.
Estimated hours taken: 600
Branches: main
Implemented state variable transformation.
NEWS:
Record new syntax and withdrawl of !/0 as Prolog cut.
compiler/hlds_goal.m:
compiler/hlds_out.m:
Added implicit/1 constructor to unify_main_context for cases where
variables are introduced by compiler transformations.
compiler/make_hlds.m:
Integrated the state variable transformation with the conversion to
HLDS.
Changed references to foreign_type and du_type constructors to
match recent changes to the foreign type interface.
compiler/mercury_compile.m:
Removed two unnecessary Prolog cuts left over from the Dark
Ages.
compiler/mercury_to_mercury.m:
Added code to output the new goal_expr constructors for state
variable quantifiers (some_state_vars and all_state_vars.)
Adapted to handle changes to if_then and if_then_else
goal_expr constructors which now include lists of state
variables that scope over the condition- and then-goals.
compiler/module_qual.m:
compiler/prog_util.m:
Changes to handle some_state_vars, all_state_vars, and changes
to if_then and if_then_else goal_expr constructors.
compiler/prog_data.m:
Added some_state_vars, all_state_vars constructors and changed
if_then and if_then_else constructors in type goal_expr.
compiler/prog_io_dcg.m:
Changes to handle quantified state variables.
compiler/prog_io_goal.m:
parse_some_vars_goal now also separates out quantified state
variables.
compiler/prog_io_util.m:
Added pred parse_quantifier_vars/3 which also detects state
variables.
compiler/typecheck.m:
Added case to report_error_undef_cons to handle any uncaught
uses of !/1.
doc/reference_manual.texi:
Documented the transformation.
library/builtin.m:
library/prolog.m:
Deleted code for `!' as fake Prolog cut.
library/lexer.m:
Made `!' a graphic token rather char than a special token.
library/ops.m:
Added `!', `!.' and `!:' as prefix ops.
library/term.m:
Added func var_id/1 which returns an int associated with its
var argument which is unique in the context of the given var
and the varset it belongs to.
library/varset.m:
Added pred new_uniquely_named_var/4 which creates a named
variable with a unique (w.r.t. the varset) number suffix.
tests/general/Mmakefile:
tests/general/state_vars_tests.exp:
tests/general/state_vars_tests.m:
tests/general/state_vars_typeclasses.exp:
tests/general/state_vars_typeclasses.m:
tests/invalid/Mmakefile:
tests/invalid/state_vars_test1.err_exp:
tests/invalid/state_vars_test1.m:
tests/invalid/state_vars_test2.err_exp:
tests/invalid/state_vars_test2.m:
tests/invalid/state_vars_test3.err_exp:
tests/invalid/state_vars_test3.m:
tests/invalid/state_vars_test4.err_exp:
tests/invalid/state_vars_test4.m:
tests/invalid/state_vars_test5.err_exp:
tests/invalid/state_vars_test5.m:
Added.