Estimated hours taken: 0.75
Report an error if the first argument of a `some' goal
is not a list of variables.
compiler/prog_io.m:
compiler/prog_io_util.m:
Move `parse_list_of_vars' from prog_io.m to prog_io_util.m.
compiler/prog_io_goal.m:
Check to make sure that the first argument to a some
goal is a list of variables. (If not, we don't report
an error here -- the error will be reported by typecheck.m.)
compiler/typecheck.m:
Report an proper error message if there is a call to an
undefined predicate `some/2'.
Also add `some/2' and `all/2' to the list of language builtins
for which we report a special error message if they occur as
undefined function symbols.
tests/invalid/Mmakefile:
tests/invalid/some.m:
tests/invalid/some.err_exp:
Regression test for the above change.
Estimated hours taken: 3
Port Mercury to egcs-1.1 on sparc-sun-solaris2.6.
configure.in:
When using non-local gotos and egcs on sparc,
include `-fno-function-cse -fno-gcse' in cflags.
scripts/mgnuc.in:
Work-around some gcc internal errors for egcs-1.1 on sparc.
Estimated hours taken: 0.25
Fix a bug reported by Warwick Harvey <wharvey@cs.monash.edu.au>.
scripts/Mmakefile:
Make sure we delete the installed `mmake' file, if any,
before (re)installing it, to avoid problems that can occur
if we overwrite the script while it is still running.
Estimated hours taken: 0.75
Test passing typeclass_infos to C code.
tests/hard_coded/typeclasses/existential_type_classes.m:
tests/debugger/existential_type_classes.m:
Add some code to test passing typeclass_infos to C code.
tests/debugger/existential_type_classes.inp:
Change the mdb input for this test case so that that
output will match what happened previously.
tests/hard_coded/typeclasses/existential_type_classes.exp:
tests/debugger/existential_type_classes.exp:
Modify the expected output for these test cases to reflect
what mdb now outputs for them.
Estimated hours taken: 1
Minor improvements to some compiler error messages.
compiler/modules.m:
Fix a missing close-quote in an error message.
Also improve the wording of the message slightly.
compiler/check_typeclass.m:
compiler/typecheck.m:
Add quotes (`...') in a couple of places
tests/invalid/sub*.err_exp:
tests/invalid/typeclass_test*.err_exp:
Update to reflect the new error messages.
tests/invalid/Mmakefile:
Delete an obsolete comment about a poor error message.
Estimated hours taken: 1
Minor improvements to some compiler error messages.
compiler/modules.m:
Fix a missing close-quote in an error message.
Also improve the wording of the message slightly.
compiler/check_typeclass.m:
compiler/typecheck.m:
Add quotes (`...') in a couple of places
tests/invalid/sub*.err_exp:
tests/invalid/typeclass_test*.err_exp:
Update to reflect the new error messages.
tests/invalid/Mmakefile:
Delete an obsolete comment about a poor error message.
Estimated hours taken: 0.1
tests/invalid/Mmakefile:
Fix a typo in a previous change of mine: I had
accidentally added `uu_type' instead of `uu_type.m'
to the list of source files.
Estimated hours taken: 1
Change the syntax for existential type class constraints to use
`=>' instead of `&'.
We eventually decided that `=>' was better, even though semantically
speaking it's more like conjunction than implication, because of the
symmetry with `<=' for universal type class constraints, and because
the precedence of `=>' matches what we want.
[However, the associativity might not.]
compiler/prog_io.m:
Update the code that parses existential type class constraints.
compiler/mercury_to_mercury.m:
Update the code that prints existential type class constraints.
tests/hard_coded/typeclasses/existential_type_classes.m:
tests/debugger/existential_type_classes.m:
Update the test case that tests existential type class constraints.
Also add a test of passing typeclass_infos to C code.
Estimated hours taken: 6
Fix a bug where type errors were causing spurious mode errors,
compiler/post_typecheck.m:
Add new predicate post_typecheck__ill_typed_pred,
which just module-qualifies the pred declaration for that pred.
This is necessary to avoid spurious mode errors in predicates
that call the ill-typed pred.
compiler/typecheck.m:
Call post_typecheck__ill_typed_pred on ill-typed predicates
before calling module_info_remove_pred. We need to call it
here because later passes won't process the pred once it
has been removed.
tests/invalid/Mmakefile:
tests/invalid/spurious_mode_error.m:
tests/invalid/spurious_mode_error.err_exp:
Regression test for the above-mentioned bug.
Estimated hours taken: 0.1
library/random.m:
Change the coefficients for the linear-congruential generator.
They now assume only 31 bits (unsigned) rather than 32. This
should prevent the defective behaviour reported on the
mercury-users mailing list.
Estimated hours taken: 0.25
tests/warnings/Mmakefile:
tests/warnings/uu_type.m:
tests/warnings/uu_type.exp:
tests/invalid/Mmakefile:
tests/invalid/uu_type.m:
tests/invalid/uu_type.err_exp:
Move the `uu_type' test case from the `warnings' directory
to the `invalid' directory, since the compiler reports an
error rather than a warning. This also fixes a problem where
the hard-coded rule for `uu_type.err' in tests/warnings/Mmakefile
broke things (e.g. it broke `tools/bootcheck --use-subdirs').
Estimated hours taken: 0.1
tests/general/string_format_test.m:
Fix a number of places where there were the wrong
number of arguments in the list passed to string__format.
These needed to be fixed now that string__format is
more picky about rejecting those sort of errors.
Estimated hours taken: 0.25
Fix a bug which had crept in which meant that you needed to have `info'
installed in order to build from the source distribution.
Mmakefile:
In the rule for `mmake tar', make doc/mdb_doc.
Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/Mmakefile,v
retrieving revision 1.26
diff -u -r1.26 Mmakefile
--- Mmakefile 1998/10/22 05:22:07 1.26
+++ Mmakefile 1998/10/28 08:39:39
@@ -212,7 +212,7 @@
cd compiler && $(SUBDIR_MMAKE) cs tags
cd profiler && $(SUBDIR_MMAKE) depend
cd profiler && $(SUBDIR_MMAKE) cs tags
- cd doc && $(SUBDIR_MMAKE) info html dvi
+ cd doc && $(SUBDIR_MMAKE) info html dvi mdb_doc
cd bindist && $(SUBDIR_MMAKE) bindist.configure
# the following command might fail on Windows?
-cd bindist && $(SUBDIR_MMAKE) bindist.build_vars
Estimated hours taken: 1
compiler/modules.m:
compiler/mercury_compile.m:
Warn about modules with no exports when compiling,
not just when making interfaces. Previous it would
only issue this warning when doing `mmc --make-int',
not when doing `mmc --compile-to-c'.
tests/invalid/Mmakefile:
tests/invalid/no_exports.err_exp:
Enable the already-existing test case for this.
Estimated hours taken: 1
library/map.m:
Fix a cut-and-paste error in the comment for map__det_union where
it was referring to map__insert instead map__union.
Delete the error message argument from map__det_union
and map__det_insert, for consistency with other det_* predicates,
and to make them easier to use.
Estimated hours taken: 3
Improve the debugger's handling of compiler-generated and inter-module-inlined
procedures.
compiler/stack_layout.m:
Update a comment.
runtime/mercury_stack_layout.h:
Introduce provisions for dealing with the procedure id section
of the layout structures of compiler-generated procedures.
runtime/mercury_stack_trace.c:
Use the new provisions to generalize the function that prints out
procedure ids for both stack traces and the debugger, so that it now
works for both user-written and compiler-generated procedure, and
prints out the extra info needed for a full identification in cases
where the defining and declaring modules are not the same. (This can
happen due to intermodule inlining, or the generation of local
unification procedures for imported types.)
trace/mercury_trace_tables.c:
Update the code to conform to the changes in mercury_stack_layout.h.
We still collect layout info only from user-written procedures,
which means you can put breakpoints on only user-written procedures.
Putting break-points on compiler-generated procedures would be
unnecessary, even in the case of user-defined equality.
trace/mercury_trace_external.c:
Update the code to conform to the changes in mercury_stack_layout.h,
and add comments asking Erwan to eventually either generalize his code
or explicitly restrict it to user-defined procedures.
Estimated hours taken: 0.5
Fix a bug with quoting of module-qualified terms in .opt files.
Add a test case for this bug.
compiler/hlds_out.m:
Add a version of `hlds_out__write_functor' which has a
`needs_quotes' argument. Call this new predicate from
`hlds_out__write_qualified_functor' to ensure that functors
are properly quoted after the `:'.
compiler/mercury_to_mercury.m:
Export `mercury_output_term/6' so it can be called by
`hlds_out__write_functor/7'.
tests/valid/Mmakefile:
Add the new test case.
tests/valid/intermod_quote.m:
tests/valid/intermod_quote2.m:
New test case for this bug.
Estimated hours taken: 0.25
boehm_gc/config.h:
Fix a portability problem: on alphas, it was using `end',
which is undefined if you link with `cc -std1'. I changed
it to use `_end', which is always defined.
Estimated hours taken: 0.25
boehm_gc/config.h:
Fix a portability problem: on HPUX systems, with egcs as
the C compiler, the test for HPUX wasn't working, because
egcs doesn't define `_PA_RISC1_0' or `_PA_RISC1_1'.
I changed it to also check for `hppa' and `__hppa__',
which egcs does define.
Estimated hours taken: 3
Fix a bug where the compiler was generating incorrect code for
list__reverse_2/3 if the `--typeinfo-liveness' option was set
(e.g. for `--gc accurate').
compiler/handle_options.m:
Make `--typeinfo-liveness' disable middle recursion optimization,
and add a comment explaining why.
Estimated hours taken: 0.25
Some minor source cleanups.
runtime/mercury_stacks.h:
Add some missing parentheses to various macro definitions,
so that they give the correct results even if the argument
is a complicated expression rather than just a single variable.
Also fix the layout in a few places by adding whitespace
around operators.
Estimated hours taken: 0.75
library/string.m:
Fix a bug in string__format: it was not reporting an error
in the case where the argument list had more elements
than was appropriate for the format string.
tests/general/Mmakefile:
tests/general/string_format_test_2.m:
tests/general/string_format_test_2.exp:
tests/general/string_format_test_3.m:
tests/general/string_format_test_3.exp:
Test cases for the above-mentioned bug fix.
Estimated hours taken: 40
Add a simple term browser for use by the trace-based debugger.
This is minimal but useful browser. Not included in this version
are a scripting language, Windows Explorer-style tree expansion,
and other features not yet thought of.
N.B. This still needs to be hooked into the debugger.
browser/Mmakefile:
Added target browse_test.
browser/browser_library.m:
Added modules required for the browser.
browser/browse_test.m:
A simple driver for the browser with an example
data structure to browse. (new file)
browser/browse.m:
The browser proper. (new file)
browser/parse.m:
Parser for browser's command language. (new file)
browser/util.m:
Miscellaneous utilities used in the browser code. (new file)
browser/frame.m:
Bare minimal ASCII graphics frames. (new file)
Estimated hours taken: 0.5
README.Linux:
Document that you should use --shared, not just --mercury-libs
shared, if you want to link statically against other
libraries.
Estimated hours taken: 6
Fix a bug which caused an internal compiler error for disjunctions
in single-solution contexts with e.g. the first two disjuncts `det'
and third disjunct `cc_multi'.
compiler/det_analysis.m:
In det_infer_disj, replace `at_most_many' with `at_most_many_cc'
if in a single-solution context. This is also done by det_infer_goal,
but it needs to be done here too, to avoid calling error/1 in
det_disjunction_maxsoln.
tests/hard_coded/Mmakefile:
tests/hard_coded/cc_multi_bug.m:
tests/hard_coded/cc_multi_bug.exp:
Test case for the above-mentioned bug.
Estimated hours taken: 6
Fix a bug which caused an internal compiler error for disjunctions
in single-solution contexts with e.g. the first two disjuncts `det'
and third disjunct `cc_multi'.
compiler/det_analysis.m:
In det_infer_disj, replace `at_most_many' with `at_most_many_cc'
if in a single-solution context. This is also done by det_infer_goal,
but it needs to be done here too, to avoid calling error/1 in
det_disjunction_maxsoln.
tests/hard_coded/Mmakefile:
tests/hard_coded/cc_multi_bug.m:
tests/hard_coded/cc_multi_bug.exp:
Test case for the above-mentioned bug.
Estimated hours taken: 0.25
profiler/Mmakefile:
Link the profiler with the `trace' and `browser' libraries.
This is needed in case you try to build the profiler
with debugging enabled.
Estimated hours taken: 16
Extend the layout scheme to handle typeinfos inside typeclass infos,
and thus enable the debugger (and later native gc) to work with programs
that use type classes and existential types.
compiler/llds.m:
Change the data structure that holds information about the locations
of the typeinfo variables of the tvars active at call return sites
from set(pair(tvar, lval)) to map(tvar, set(layout_locn)).
The change from set to map avoids the possibility of inadvertently
duplicating the info for a give type variable.
The change to explicitly keep a set of locations in which the typeinfo
var may be found allows us to use set intersection on those sets if
(a) the program point may be reached via more than one path, and
(b) not all paths have the same sets. Both of these can happen in
programs that use type classes.
The change from lval to layout_locn (which encodes either an lval,
or an lval representing a typeclass info and an (indirect) offset
inside that typeclass info) is necessary support programs with
type classes.
compiler/continuation_info.m:
Change the data structure that holds information about the locations
of the typeinfo variables of the tvars active at a particular program
point the same way and for the same reasons as in llds.m.
Take set intersections of typeinfo var locations whenever we find
multiple live variable info records for the same label.
compiler/call_gen.m:
Delay the construction of the return live variable information
until the code generator state has been updated to reflect where
things will be on return, instead of trying to cobble up this
info into the code generator state that reflects the point just
before the call. Apart from being cleaner, this is necessary
to avoid compiler aborts for programs that use existential types.
The old compiler could not find the typeinfos of any existentially
quantified type vars, since they do not exist before the call.
compiler/code_info.m:
Rewrite and generalize the code for generating live value information.
compiler/trace.m:
Remove the specialized code for generating live value information;
call code_info instead.
compiler/stack_layout.m:
Pick one of several possible locations for a typeinfo var.
Generate the new indirect layout location descriptions.
Reduce the number of tag bits used to describe different kinds of
lvals, to leave more room for the indirect information.
compiler/*.m:
Conform to the above data structure changes.
compiler/hlds_pred.m:
Clarify the documentation of type_info_locn.
runtime/mercury_stack_layout.h:
Update the section that deals with MR_Live_Lval to take
indirect typeinfo locations into account.
runtime/mercury_layout_util.c:
Handle indirect typeinfo locations when interpreting layout structures.
runtime/mercury_layout_util.c:
trace/mercury_trace_internal.c:
Ignore variables whose names start with TypeClassInfo.
runtime/mercury_accurate_gc.c:
runtime/mercury_agc_debug.c:
Add markers to remind Tyson to handle indirect typeinfo locations.
tests/debugger/implied_instance.{m,inp,exp}:
tests/debugger/multi_paramster.{m,inp,exp}:
tests/debugger/existential_type_classes.{m,inp,exp}:
Copies of the tests in tests/hard_coded/typeclasses, modified to
avoid or delay I/O, so that the calls to I/O preds that may or may
not be traced to do not affect the output.
tests/debugger/Mmakefile:
Add the new test cases.
Remove references to the *_lib variants of the old test cases.
They are not necessary if I/O is delayed until after the last
reported trace event.
tests/hard_coded/typeclasses/Mmakefile:
Remove --trace deep from existential_type_classes, since that
aspect of the test case is now covered in the debugger directory.
Estimated hours taken: 16
Extend the layout scheme to handle typeinfos inside typeclass infos,
and thus enable the debugger (and later native gc) to work with programs
that use type classes and existential types.
compiler/llds.m:
Change the data structure that holds information about the locations
of the typeinfo variables of the tvars active at call return sites
from set(pair(tvar, lval)) to map(tvar, set(layout_locn)).
The change from set to map avoids the possibility of inadvertently
duplicating the info for a give type variable.
The change to explicitly keep a set of locations in which the typeinfo
var may be found allows us to use set intersection on those sets if
(a) the program point may be reached via more than one path, and
(b) not all paths have the same sets. Both of these can happen in
programs that use type classes.
The change from lval to layout_locn (which encodes either an lval,
or an lval representing a typeclass info and an (indirect) offset
inside that typeclass info) is necessary support programs with
type classes.
compiler/continuation_info.m:
Change the data structure that holds information about the locations
of the typeinfo variables of the tvars active at a particular program
point the same way and for the same reasons as in llds.m.
Take set intersections of typeinfo var locations whenever we find
multiple live variable info records for the same label.
compiler/call_gen.m:
Delay the construction of the return live variable information
until the code generator state has been updated to reflect where
things will be on return, instead of trying to cobble up this
info into the code generator state that reflects the point just
before the call. Apart from being cleaner, this is necessary
to avoid compiler aborts for programs that use existential types.
The old compiler could not find the typeinfos of any existentially
quantified type vars, since they do not exist before the call.
compiler/code_info.m:
Rewrite and generalize the code for generating live value information.
compiler/trace.m:
Remove the specialized code for generating live value information;
call code_info instead.
compiler/stack_layout.m:
Pick one of several possible locations for a typeinfo var.
Generate the new indirect layout location descriptions.
Reduce the number of tag bits used to describe different kinds of
lvals, to leave more room for the indirect information.
compiler/*.m:
Conform to the above data structure changes.
compiler/hlds_pred.m:
Clarify the documentation of type_info_locn.
runtime/mercury_stack_layout.h:
Update the section that deals with MR_Live_Lval to take
indirect typeinfo locations into account.
runtime/mercury_layout_util.c:
Handle indirect typeinfo locations when interpreting layout structures.
runtime/mercury_layout_util.c:
trace/mercury_trace_internal.c:
Ignore variables whose names start with TypeClassInfo.
runtime/mercury_accurate_gc.c:
runtime/mercury_agc_debug.c:
Add markers to remind Tyson to handle indirect typeinfo locations.
tests/debugger/implied_instance.{m,inp,exp}:
tests/debugger/multi_paramster.{m,inp,exp}:
tests/debugger/existential_type_classes.{m,inp,exp}:
Copies of the tests in tests/hard_coded/typeclasses, modified to
avoid or delay I/O, so that the calls to I/O preds that may or may
not be traced to do not affect the output.
tests/debugger/Mmakefile:
Add the new test cases.
Remove references to the *_lib variants of the old test cases.
They are not necessary if I/O is delayed until after the last
reported trace event.
tests/hard_coded/typeclasses/Mmakefile:
Remove --trace deep from existential_type_classes, since that
aspect of the test case is now covered in the debugger directory.
Estimated hours taken: 2
trace/mercury_trace_internal.c:
Fix a bug: when printing help on the "help" command,
look it up in the "help" category, not the "misc" category.
This avoids an mdb internal error for a command such as
"help help help help".
Estimated hours taken: 1.5
Fix a couple of bugs related to pruning of impure goals with no output
variables.
compiler/det_analysis.m:
Fix a bug: the compiler was automatically inserting pruning
across impure goals with no output variables. That should
happen only for pure or semipure goals. To prevent pruning
in those cases, I changed it so that impure goals with no
output variables are not considered single-solution contexts.
doc/reference_manual.texi:
Document the above-mentioned change.
compiler/clause_to_proc.m:
Fix a bug: when converting a bunch of clauses into a disjunction,
clause_to_proc.m was not computing the proper purity annotation
on the goal_info for the disjunction.
tests/hard_coded/Mmakefile:
tests/hard_coded/impure_prune.m:
tests/hard_coded/impure_prune.exp:
A test case for the above-mentioned changes to det_analysis.m
and clause_to_proc.m.
Estimated hours taken: 2
compiler/llds_out.m:
Use map (and thus tree234) instead of bintree_set to represent
the set of things declared so far. With --trace deep, the binary
trees of items were almost always sticks. This change reduces
the time spent in writing out typecheck.c with --trace deep
from 58 seconds to 15 seconds on cyclone.
The alternative solution, using set_bbbtree, requires about
half a second more, because it allocates a bit more memory
(930 Kb vs 890 Kb for map, even though the map has a dummy value).
Estimated hours taken: 2
library/map.m:
Add some predicates that may be generally useful. Some of them
are needed in a near-future change to the compiler.
NEWS:
Mention the new predicates.
Estimated hours taken: 0.75
Fix a bug where the debugger was unable to find the `mdbrc' script,
since it had been installed into the wrong directory.
Mmake.common.in:
doc/Mmakefile:
Rename the `INSTALL_DOC_DIR' variable and `install_doc' targets
as `INSTALL_MDB_DOC_DIR' and `install_mdb_doc', to more accurately
reflect their function.
Change the value of the INSTALL_MDB_DOC_DIR so that it installs
into lib/mercury/mdb instead of lib/mercury/doc, because (a)
the documentation is in `mdb script' format, which is not really
suitable as an end-user documentation format, and (b) that
is where the debugger expected it to be.
Estimated hours taken: 60
Changes required to get the samples directory to compile using lcc in
the grade `none.gc'.
compiler/llds_out.m:
Add a pass to make sure that the constants are all declared (with
a complete type) before they are initialised. We can't just
forward declare each constant immediately before it is used in an
initializer, as was done previously, because at that point we don't
know the type of the constant, and ANSI C doesn't allow forward
declarations of static variables with incomplete types.
Also change data_ptr to type (Word *). This is because (Word *) is
a superset of (const Word *) and it is a non-trivial task to get the
consts output in the correct places. Hopefully consts will be
output when I get the compiler to bootstrap using lcc.
scripts/mgnuc.in:
Don't warn about casts which remove the const. ie (const char *) to
(char *)
runtime/mercury_string.h:
Get rid of a cast.
runtime/mercury_tags.h:
Get rid of some of the const casts.
util/mkinit.c:
Make mkinit compile using lcc.