Estimated hours taken: 0.25
compiler/prog_io_goal.m:
Fix some misleading variable names and comments:
at this point in the compilation, arguments of lambda expressions
may be arbitrary terms, not just variables, so refer to them
as "Arg" or "argument" rather than "Var" or "variable".
Estimated hours taken: 0.5
Deprecate the old style of lambda expressions.
NEWS:
doc/reference_manual.texi:
Document that the old-style lambda expressions are now deprecated.
compiler/notes/todo.html:
Mention that we should warn about the use of old-style lambda
expressions.
Estimated hours taken: 0.1
compiler/base_type_layout.m:
compiler/polymorphism.m:
compiler/type_util.m:
Rename some missed references to base_type_* as type_ctor_* in
some comments and an error message.
Estimated hours taken: 0.1
compiler/base_type_layout.m:
compiler/polymorphism.m:
compiler/type_util.m:
Rename some missed references to base_type_* as type_ctor_* in
some comments and an error message.
Estimated hours taken: 8
During the writing of the RTTI paper, we decided that type_ctor_info
was a much better name than base_type_info.
Rename base_type* as type_ctor*, except we don't rename the modules
base_type_info and base_type_layout just yet.
Most of these changes were made using the following sed patterns:
s/base_type_info/type_ctor_info/g
s/base_type_layout/type_ctor_layout/g
s/base_type_functors/type_ctor_functors/g
s/BASETYPE_INFO/TYPE_CTOR_INFO/g
s/TYPEFUNCTORS/TYPE_CTOR_FUNCTORS/g
s/TYPELAYOUT/TYPE_CTOR_LAYOUT/g
s/BASE_TYPEINFO/TYPE_CTOR_INFO/g
s/BASE_TYPE_INFO/TYPE_CTOR_INFO/g
s/BaseTypeInfo/TypeCtorInfo/g
s/BaseTypeLayout/TypeCtorLayout/g
s/base_type(/type_ctor(/g
s/:- module type_ctor_info/:- module base_type_info/g
s/:- module type_ctor_layout/:- module base_type_layout/g
s/type_ctor_info__/base_type_info__/g
s/type_ctor_layout__/base_type_layout__/g
/import_module/s/type_ctor_info/base_type_info/g
/import_module/s/type_ctor_layout/base_type_layout/g
compiler/*.m:
library/*.m:
runtime/*.{c,h}:
profiler/demangle.m:
util/mdemangle.c:
Applied the above sed commands.
runtime/mercury_bootstrap.h:
Add bootstrapping #defines so the type_ctor_* substitutions in
the library don't cause link problems.
Delete some redundant bootstrapping definitions.
Estimated hours taken: 8
During the writing of the RTTI paper, we decided that type_ctor_info
was a much better name than base_type_info.
Rename base_type* as type_ctor*, except we don't rename the modules
base_type_info and base_type_layout just yet.
Most of these changes were made using the following sed patterns:
s/base_type_info/type_ctor_info/g
s/base_type_layout/type_ctor_layout/g
s/base_type_functors/type_ctor_functors/g
s/BASETYPE_INFO/TYPE_CTOR_INFO/g
s/TYPEFUNCTORS/TYPE_CTOR_FUNCTORS/g
s/TYPELAYOUT/TYPE_CTOR_LAYOUT/g
s/BASE_TYPEINFO/TYPE_CTOR_INFO/g
s/BASE_TYPE_INFO/TYPE_CTOR_INFO/g
s/BaseTypeInfo/TypeCtorInfo/g
s/BaseTypeLayout/TypeCtorLayout/g
s/base_type(/type_ctor(/g
s/:- module type_ctor_info/:- module base_type_info/g
s/:- module type_ctor_layout/:- module base_type_layout/g
s/type_ctor_info__/base_type_info__/g
s/type_ctor_layout__/base_type_layout__/g
/import_module/s/type_ctor_info/base_type_info/g
/import_module/s/type_ctor_layout/base_type_layout/g
compiler/*.m:
library/*.m:
runtime/*.{c,h}:
profiler/demangle.m:
util/mdemangle.c:
Applied the above sed commands.
runtime/mercury_bootstrap.h:
Add bootstrapping #defines so the type_ctor_* substitutions in
the library don't cause link problems.
Delete some redundant bootstrapping definitions.
Estimated hours taken: 1
Change the bit shift functions to perform checking to avoid
implementation defined behaviour.
library/int.m:
Add checking to `int:<<' and `int:>>'.
Add `int:unchecked_left_shift' and `int:unchecked_right_shift'
which do not perform any checking.
compiler/code_util.m:
Replace `int:<<' and `int:>>' with `int:unchecked_left_shift' and
`int:unchecked_right_shift' in the builtin table.
NEWS:
Mention the changes to int.m.
tests/hard_coded/Mmakefile:
tests/hard_coded/shift_test.m:
tests/hard_coded/shift_test.exp:
Test the shift functions.
Estimated hours taken: 0.5
Fix a bug where the generated code tested whether
a relation which was never created was empty.
compiler/rl_gen.m:
Don't include procedures with `generate_inline' markers
(used to create input relations for calls) in the list of entry
points for a procedure. Difference relations for these
are never created, so they should not be included in the
fixpoint check at the start of each iteration.
Estimated hours taken: 2
Fix a bug with typeclasses where the compiler would sometimes
generate code that called the wrong method.
compiler/make_hlds.m:
Ensure that the list(pred_proc_id) in the hlds_class_defn
is sorted, to match the way that check_typeclass.m generates
the corresponding list(pred_proc_id) for the hlds_instance_defn.
tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/func_default_mode_bug.m:
tests/hard_coded/typeclasses/func_default_mode_bug.exp:
tests/hard_coded/typeclasses/mode_decl_order_bug.m:
tests/hard_coded/typeclasses/mode_decl_order_bug.exp:
Add a couple of regression tests for problems fixed by
the above change.
Estimated hours taken: 0.25
compiler/hlds_out.m:
Improve the way we print out type class method calls:
- fix a missing newline bug
- print out the method number
Estimated hours taken: 5
Remove support for NU-Prolog and SICStus Prolog.
The reasons for this are:
(a) We now have a proper working debugger, so we don't need to use
NU-Prolog or SICStus Prolog for debugging.
(b) The Prolog support was only ever a hack, not a proper solution;
Mercury language features like functions or mode reordering
were never supported.
(c) It was a maintenance problem.
compiler/make_hlds.m:
Warn that NU-Prolog `when' declarations are deprecated.
compiler/prog_io.m:
Update a comment to say that NU-Prolog `when' declarations
are now deprecated.
library/*.m:
Delete `when' declarations.
configure.in:
bindist/bindist.configure.in:
Delete the autoconf tests for NU-Prolog and SICStus Prolog.
Delete the stuff for generating the NU-Prolog and SICStus Prolog
scripts.
tools/bootcheck:
Delete the options for testing using SICStus Prolog.
library/Mmakefile:
Delete the rules for building NU-Prolog and SICStus Prolog stuff.
library/library.nu.nl.in:
library/swi_*.m:
library/*.nu.nl:
library/array.nu.nl:
library/assoc_list.nu.nl:
library/char.nu.nl:
library/float.nu.nl:
library/int.nu.nl:
library/io.nu.nl:
library/library.nu.nl.in:
library/map.nu.nl:
library/mercury_builtin.nu.nl:
library/nc_builtin.nl:
library/require.nu.nl:
library/sp_builtin.nl:
library/sp_lib.nl:
library/std_util.nu.nl:
library/store.nu.nl:
library/string.nu.nl:
library/swi_builtin.m:
library/swi_lib.m:
library/term_io.nu.nl:
Delete these files.
scripts/mnc.in:
scripts/mnp.in:
scripts/mnl.in:
scripts/msc.in:
scripts/msl.in:
scripts/msp.in:
Delete these files.
doc/user_guide.texi:
Delete the documentation about the Prolog support.
NEWS:
w3/news/newsdb.inc:
Mention that we've removed the Prolog support.
Estimated hours taken: 0.5
boehm_gc/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
doc/Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
Separated out all the commands to create installation directories
into a single target in each Mmakefile, upon which all targets which
used to create directories depend. This avoids a race condition
with parallel installs into a new directory tree, whereby two or
more `mkdir -p' commands simultaneously try to create the same
missing path component, resulting in all but one failing.
Estimated hours taken: 0.1
compiler/rl_out.m:
Materialise streams where necessary when taking references.
Add indexes to the output of a copy instruction where appropriate.
Estimated hours taken: 0.25
compiler/make_hlds.m:
compiler/quantification.m:
doc/reference_manual.texi:
Some trivial changes to fix bugs in my previous change.
Estimated hours taken: 4
Fix some problems with quantification of lambda expressions.
doc/reference_manual.texi:
Document the new rules for quantification of lambda expressions.
compiler/make_hlds.m:
Implement the new rules for quantification of lambda expressions:
ensure that all variables in arguments of predicate or function
lambda expressions are locally quantified, but that variables
in the return value term of function lambda expressions are
quantified according to the usual rules.
compiler/quantification.m:
Add a comment about quantification of lambda expressions.
Also, in `rename_apart', check for and optimize the case
where no renaming is needed.
Estimated hours taken: 4
Fix some old problems with HLDS dumps, including blank lines between goals
(using vi's paragraph commands to move between predicates now works),
unescaped characters in strings and chars in unifications, and extra dots
in type definitions.
compiler/hlds_out.m:
Make the above fixes. To fix the problem of blank lines between goals,
we reinterpret the meaning of the Follow arguments of several
predicates that print goals, which say what to print after the
goal, to include the newline to print after the goal. This avoids
lots of separate calls to io__write_string("\n").
Document the meanings of the arguments of many predicates.
compiler/prog_out.m:
Modify prog_out__write_sym_name to escape any special characters
(e.g. newlines) in the symbols written. (Strings, as cons_ids,
are printed as symbols.)
Add a new predicate for printing a symbol with single forward quotes
around it.
compiler/mercury_to_mercury:
When printing cons_id, quote strings.
compiler/constraint.m:
compiler/mode_errors.m:
compiler/pd_debug.m:
compiler/rl_dump.m:
compiler/saved_vars.m:
Conform to the new meaning of the Follow arguments in hlds_out.m.
Estimated hours taken: 10
Allow the native collector to work for nondet code, by generating layout
structures for the resumption points whose addresses can be put into
redoip slots in nondet stack frames.
If the program is compiled with both native gc and debugging, entries
to disjunctions will have two labels and two layout structures, one
for gc and one for the debugger. At the moment we make no attempt
to try to combine the two structures, since doing so would add significant
extra complexity. Optimizing this option combination will not be important
for a while yet anyway.
compiler/code_info.m:
Update the code that generates resume points to also optionally
generate layout structures for the stack labels.
compiler/disj_gen.m:
When we save the heap pointer, update not only the current code_info
but the saved code_info that represents the branch start position
as well, since the slot containing the saved heap pointer will be
live in each of the following disjuncts.
compiler/labelopt.m:
compiler/mercury_compile.m:
compiler/optimize.m:
compiler/value_number.m:
Arrange to pass the global_data structure to the label elimination
and value numbering passes. This is to (a) prevent the label
elimination pass from removing labels (e.g. stack resume labels)
that have layout structures, and (b) to prevent value numbering
for moving computations across such labels, since that would
invalidate the layout structure.
(The presence of pragma_c_code fragments in the generated code avoids
both these potential problems for layout structures that correspond
to trace events, but that solution would be suboptimal for resume
labels.)
compiler/hlds_module.m:
Add a utility predicate needed by optimize.m.
Estimated hours taken: 0.1
compiler/make_hlds.m:
Don't halt-at-warn for warnings about clauses for builtins, since
this would require messing about with the test scripts.
Estimated hours taken: 0.1
compiler/make_hlds.m:
Ignore (with a warning) clauses for builtins.
This will make it easier to bootstrap a future change
to add checking for the integer shift operations.
Estimated hours taken: 2
Fix bugs in the Aditi bytecode output routines.
compiler/bytecode.m:
compiler/bytecode_data.m:
Move the data conversion predicates from bytecode.m to a new module
so they can be used by for output of Aditi-RL bytecode in the
compiler and in the RL bytecode assembler in the Aditi distribution.
Add new predicates to convert integers and floats to lists of
bytes rather than writing them out immediately.
compiler/rl_code.m:
Use the same data conversion predicates for Aditi-RL
bytecodes as for Mercury bytecodes.
This fixes a bug with the output of integers on 32 bit machines
(integers were being shifted by more than the width of the type,
the result of which is undefined) and endianness problems with
floating point numbers.
Estimated hours taken: 1
compiler/rl_block_opt.m:
Fix a performance bug where multiple copies of the
output of a projection were being created.
Add some comments.
Reorder the arguments of a predicate.
Estimated hours taken: 1
Avoid some spurious flow-on diagnostics.
compiler/mercury_compile.m:
Pass down a boolean indicating whether we got any type errors
to purity.m.
compiler/purity.m:
Only call post_typecheck__check_type_bindings if we didn't get
any type errors, because if we did get any type errors, then
calling check_type_bindings may lead to a lot of spurious
diagnostics.
tests/invalid/types.err_exp:
tests/invalid/errors2.err_exp:
Update the expected error messages for these test cases to
reflect the fact that we no longer warnings in these cases.
Estimated hours taken: 2
Update the documentation to use the new ftp site ftp.mercury.cs.mu.oz.au.
w3/include/mcorba.inc:
w3/download/include/*.inc:
Change the ftp site from turiel.cs.mu.oz.au to ftp.mercury.cs.mu.oz.au.
compiler/notes/release_checklist.html:
Update the documentation on ftp site maintenance
and also a few other things.
Estimated hours taken: 25
Fix a bug whereby the @#$!% typeclass-infos nested inside another
typeclass-info (ie. from the constraints on an instance decl) were being
inserted in the reverse order. This caused the code to jump to the wrong
type class method.
compiler/polymorphism.m:
Reverse the list of argument variables that we get back from
polymorphism__make_typeclass_info_vars_2 because they are built
up in reverse.
Also fix a buggy comment about the order that the extra arguments
are added in by this pass.
tests/hard_coded/typeclasses/implied_instance_multi_constraint.{m, exp}:
A test case for this bug fix.
tests/hard_coded/typeclasses/Mmakefile:
Add this test case.
Estimated hours taken: 0.5
Allow HLDS dumps to contain references to the pointers used by tabling.
Without this chance, HLDS dumps can abort on modules containing tabled
procedures.
compiler/hlds_out.m:
Allow HLDS dumps to contain references to the pointers used by tabling.
This requires adding an extra argument to an exported procedure.
compiler/mode_errors.m:
compiler/typecheck.m:
Pass the extra argument that exported procedure.
Estimated hours taken: 0.5
Fix a bug with the handling of instance declarations with no methods.
compiler/check_typeclass.m:
Ensure that the MaybePredProcs field of the HLDS instance definition
for instance definitions with no methods is set to `yes([])' rather
than `no' -- the latter would indicate that this pass hasn't been
run yet.
Estimated hours taken: 0.25
Implement abstract instance declarations.
(I forgot to commit changes to these two files as part of my last commit.)
compiler/mercury_to_mercury.m:
compiler/module_qual.m:
Change the code to reflect the new name and representation
of `instance_interface'.
Estimated hours taken: 9
Implement abstract instance declarations.
compiler/prog_data.m:
Rename the `instance_interface' type as `instance_body',
and make it a discriminated union: either `abstract',
or `concrete(Methods)'.
compiler/prog_io_typeclass.m:
compiler/hlds_data.m:
compiler/hlds_out.m:
compiler/equiv_type.m:
compiler/check_typeclass.m:
Change the code to reflect the new name and representation
of `instance_interface'.
compiler/prog_io_typeclass.m:
Parse abstract instance declarations.
compiler/make_hlds.m:
Clean up the code a bit, and make sure that it detects some errors
which previously we didn't detect: duplicate or overlapping
instance declarations, and instance declarations with methods for
classes with no methods.
compiler/check_typeclass.m:
If an instance is abstract, then we don't need to check
that the methods in the instance body match those in the class.
compiler/base_typeclass_info.m:
Only generate base_typeclass_infos for concrete instance
declarations, not for abstract ones.
doc/reference_manual.texi:
Document the change.
tests/hard_coded/typeclasses/Mmakefile:
tests/hard_coded/typeclasses/abstract_instance.m:
tests/hard_coded/typeclasses/use_abstract_instance.m:
tests/hard_coded/typeclasses/use_abstract_instance.exp:
tests/invalid/Mmakefile:
tests/invalid/typeclass_test_9.m:
tests/invalid/typeclass_test_9.err_exp:
Some test cases.
tests/hard_coded/typeclasses/Mmakefile:
Uncomment typeclass_test_5.m, since we pass that now
(and have done so for quite some time).
tests/invalid/typeclass_test_[3-5].err_exp:
Update to reflect additional error messages produced
by the improved error checking in compiler/make_hlds.m.
Estimated hours taken: 1
compiler/modules.m:
Fix a bug with the arguments passed to c2init by the generated `.dep'
file when using fact tables: it should not pass the fact table `.c'
files to c2init, because the fact table `.c' files do not have
(or need) any initialization function.
Estimated hours taken: 1.5
Fix a bug where inlining of fact tables caused duplicate
labels in the generated C code.
compiler/make_hlds.m:
Make `pragma fact_table' imply `pragma no_inline'.
compiler/fact_table.m:
Update some old comments which said that nondet `pragma c_code'
was not yet implemented.
doc/reference_manual.texi:
Document that `pragma c_code' should not contain labels
unless there is a matching `pragma no_inline'.
Estimated hours taken: 4.5
Implement demangling for instance declarations (i.e. base_typeclass_infos).
compiler/base_typeclass_info.m:
compiler/llds_out.m:
Change the way name mangling for base_typeclass_infos is done
to ensure that they can be unambiguously demangled.
util/mdemangle.c:
profiler/demangle.m:
Add code to demangle base_typeclass_infos.
util/mdemangle.c:
Fix a bug: if it got part way through demangling a symbol
before noticing that it had the wrong format, then it would
sometimes print out a partially demangled version of the
symbol rather than printing out the original symbol unchanged.
tests/debugger/*.exp*:
Update the expected output to reflect the new mangling scheme.
(Really the debugger ought to demangle the names, but
currently it doesn't.)
Estimated hours taken: 0.75
Fix some bugs where we were not properly escaping special characters in
C strings in the generated code.
compiler/llds_out.m:
Change a number of places to call output_quoted_c_string instead of
io__write_string, so that special characters will be properly escaped.
Add new predicate llds_out__quote_c_string, for use by pragma_c_gen.m.
compiler/pragma_c_gen.m:
Call llds_out__quite_c_string, to ensure that special characters
in the generated "pragma_c_raw_code" are properly escaped.
tests/valid/int64.m:
tests/valid/Mmakefile:
Regression test for the above-mentioned bug fix.
Estimated hours taken: 0.75
Fix a bug reported by Warwick Harvey <wharvey@cs.monash.edu.au>.
compiler/prog_io.m:
Don't complain if the module name in the final `end_module'
declaration doesn't match the expected name for the top-level
module, because it could be for a nested module.
compiler/make_hlds.m:
Report errors for unexpected `module' and `end_module' declarations.
This will catch the cases that used to be caught by prog_io.m,
among others.
Estimated hours taken: 0.5
Fix a bootstrapping problem with the changes to MR_OBTAIN_GLOBAL_C_LOCK()
that Tom Conway recently committed.
runtime/mercury_thread.h:
compiler/pragma_c_gen.m:
Rename MR_{OBTAIN,RELEASE}_GLOBAL_C_LOCK()
as MR_{OBTAIN,RELEASE}_GLOBAL_LOCK().
Also delete the unnecessary trailing semicolons
from the definitions of those macros.
runtime/mercury_bootstrap.h:
Add a definition of the old zero-arity MR_*_GLOBAL_C_LOCK() macros
in terms of the new unary MR_*_GLOBAL_LOCK() macros.
Estimated hours taken: 20
Improvements to coroutining support. These changes allow us to do
provide io primatives that cause the Mercury context to suspend rather
than causing the engine to block.
configure.in:
Test to see if we can handle contexts that block on IO
using select().
compiler/pragma_c_gen.m:
Include the predicate name in the calls to MR_OBTAIN_GLOBAL_C_LOCK
and MR_RELEASE_GLOBAL_C_LOCK for improved debugging.
Fix a bug where the global lock was not being released when
semidet pragma c code failed.
runtime/mercury_thread.h:
Change the global lock macros to include the message generated
by the changes to pragma_c_gen.
library/char.m:
library/std_util.m:
include `thread_safe' in the flags for a couple of pragma c
definitions that seem to have missed out.
runtime/mercury_context.{c,h}:
Add a list of "pending" contexts that are blocked on a
file descriptor. When the runqueue becomes empty, we call
select on all the pending contexts.
Move schedule from the header file to the c file (changing
it from a macro to a function) for easier debugging at a
slight performance cost.
TODO: add a nonblocking call to select so that we can poll
for io from time to time rather than waiting till there is
nothing else to do.
runtime/mercury_reg_workarounds.{c,h}:
Make functions that forward to the FD_* macros, which on Linux
attempt to use registers that we've already grabbed. Aarrggh!
runtime/mercury_thread.c:
Tidy up some of the conditional compilation.
runtime/mercury_types.h:
Remove the definition of SpinLock since we're not using them
and are not likely to any time soon.
Estimated hours taken: 8
Add support for exceptions to the debugger, and
add support for debugging to the exception module.
browser/debugger_interface.m:
Add `exception' to the trace_port_type enumeration.
runtime/mercury_trace_base.h:
Add MR_PORT_EXCEPTION to the MR_Trace_Port enumeration.
trace/mercury_trace_internal.c:
trace/mercury_trace.h:
trace/mercury_trace.c:
Modify the code to handle MR_PORT_EXCEPTION.
extras/exceptions/exception.m:
- Define stack layout structures for the hand-written procedures
`builtin_throw' and `builtin_catch'.
- Use mktempframe() rather than mkframe() to allocate the temporary
frames used to prevent hijacking of the exception-catching frame
(this is more efficient, and avoids the need to give a stack
layout for those frames).
- Change the code for builtin_throw/1 so that if MR_trace_enabled
is true, it calls a new function trace_throw(), which calls
MR_trace(..., MR_PORT_EXCEPTION, ...) for each stack frame.
- Fix some type errors occurring for non-GC grades.
- Fix some uses of obsolete names (e.g. replace `hp' with `MR_hp').
runtime/mercury_trace_base.c:
compiler/trace.m:
Add some comments relating to the above changes.
Estimated hours taken: 8
Fix a few bugs in the debugger.
compiler/trace.m:
Fix a bug for procedures compiled with shallow tracing:
if from_full is false, it still needs to save the call depth,
since calls in the body of the procedure will reset the
call depth to the saved value.
trace/mercury_trace_internal.c:
Fix a couple of problems with the retry command:
- if we're already at a call port, then just print a
warning rather than finishing the call and then
retrying it;
- restore MR_trace_from_full to TRUE before jumping
to the procedure.
runtime/mercury_stack_trace.c:
Fix some problems with the printing of detailed stack traces:
- for procedures whose stack layouts didn't include execution
tracing information, the columns didn't match up;
- for procedures with shallow (interface) tracing only,
it was sometimes printing out bogus details.
runtime/mercury_trace_base.c:
Fix some formatting problems in the error message output by
MR_trace_fake().