*Makefile*:
Ensure that Makefile.mercury can be used as a generic
Makefile for Mercury programs. It now gets included by the
Makefiles in the tests/ directory.
(It's highly likely that these changes have broken something.)
code_util.nl, peephole.nl, code_info.nl:
Move peephole__neg_rval to code_util.nl, so that it can
also be used by code_info.nl. Improve it a bit.
disj_gen.nl:
Minor stylistic changes.
peephole.nl:
Use bintree_set(label) rather than map(label, bool).
ite_gen.nl:
Implement non-deterministic if-then-elses.
mercury_compile.nl:
Change the action in the automatically generated .dep makefile
to use `$(MNL)' rather than `$(NC)' to link the `.no' files
together.
mode_util.nl, mode_info.nl:
Fix some (recently detected) determinism errors.
options.nl:
Rearrange the options into a vaguely meaninful order and
add a couple of comments.
mercury_compile.nl, options.nl:
Fix a few bugs in the --compile option.
This required adding a new --c-include-directory option to specify
the appropriate -I flag to pass to the C compiler.
mercury_compile.nl, options.nl:
Implement some new options: --compile-to-c, --compile, --cc,
--cflags, --gcc-global-registers, --gcc-non-local-gotos,
--debug, and --optimize.
*.nl:
Rename globals__lookup*option as globals__io_lookup*option.
Create new globals__lookup*option predicates.
Fix up the option handling in the code generator.
code_gen.nl code_info.nl:
Fix assumptions about where variables go at the end of switches.
Add StoreMap.
live_vars.nl store_alloc.nl:
Passes to compute the stack allocations, and the "known" locations
for variables.
hlds.nl:
Add fields to procinfo for stack allocations.
options.nl:
Add options for eager and lazy code generation.
Eager code generation is still mostly untested. Its
even possible that there are unimplemented preds!
llds.nl:
Print the code in a slightly nicer format.
code_info.nl ite_gen.nl unify_gen.nl
Generate code with field numbers 0.... rather than 1....
Add stuff for heap reclaiming on failure.
Add options in code generation (not patched through to the
top levels of the compiler yet.
liveness.nl:
fix some bugs.
options.nl mercury_compile.nl:
Add some options for follow[code|vars].
options.nl:
Add a whole bunch of new options.
Please read `mercury_compile --help', everyone!
code_gen.nl:
Use the `--gc' flag instead of old `save-succip' flag.
globals.nl:
Added two new global vars for two of the new options;
lots of new access predicates.
int.nl:
Add int__pow; also use slightly more meaningful variable names
in the code for the other preds.
llds.nl:
Output field(...) rvals and lvals with the proper `mktag(...)'.
Also a a new mktag(...) rval.
make_hlds.nl:
Pass the command-line options to make_tags.nl.
make_tags.nl:
Assign the tags according to the --num-tag-bits option.
mercury_compile.nl:
Allow more than one file on the command line;
Also a little bit of special processing for two of the
new options.
unify_gen.nl:
Rearrange unify_gen__generate_tag_test slightly.
Generate better code for tests of complicated_constant_tags.
code_gen.nl code_info.nl:
Fix bugs: save the status of succip_used across branched stuctures.
use liveness and deadness info properly in semidet goals.
llds.nl:
Fix syntax error in the output code.
mercury_compile.nl options.nl:
change xmod to mod. We're hitting the big time now ;-)
(Changes to Makefile.* to follow)
array.nl:
Improved the code. Added array__resize.
call_gen.nl code_gen.nl code_info.nl switch_gen.nl unify_gen.nl:
Made a start towards abstracting "tag tests".
hlds.nl hlds_out.nl liveness.nl modes.nl code_gen.nl:
Fixed the "before" and "after" liveness problem.
io.nl, prog_io.nl.
Reorganize io.nl a bit. Added some new predicates (but
didn't implement them yet.)
Renamed a couple of things, which forced the changes to prog_io.nl.
options.nl, toplevel.nl:
Add a new `-M' option to generate a `Make'-style dependency file.
GNUMakefile, Makefile, Makefile.common:
Moved the Makefile to Makefile.common and removed the old
`$(ERR) : $(INT)' dependency where every .err file depended
on every .int file. Added a rule to create a Makefile
by catting Makefile.common and the dependencies in toplevel.dep.
Added a GNUMakefile which just includes the Makefile.common
and toplevel.dep.
Also, use `&&' rather than `;' in `sh -c' commands so that it will
stop when a command encounters an error.
bintree.nl, map.nl, varset.nl:
Remove map__search_insert; it's not needed and it's not
really useful.
bintree.nl:
Fix determinism problem in bintree__from_list_2.
options.nl, det_analysis.nl, make_hlds.nl:
Add options to suppress determinism warnings.
det_analysis.nl, hlds.nl, modes.nl:
Allow the delta-instmap to be `unreachable'.
hlds_out.nl:
Output the delta-instmap.
Output conjunctions differently in verbose mode.
llds.nl:
Fix determinism problem.
Change GOTO(LABEL(...)) into GOTO_LABEL(...) which can be
more efficient.
map.nl:
Add map__overlay/3.
typecheck.nl, modes.nl, mode_errors.nl, options.nl, hlds_out.nl.
Split the old `debug' option into debug-types and debug-modes.
Change the default for the `modecheck' option to `yes'.
Add a new verbose-dump-hlds option, and use that instead
of the very-verbose option in hlds_out.nl.
mode_util.nl:
Export mode_get_insts/4.
Add instmap_lookup_var (moved from modes.nl).
Add apply_instmap_delta.
modes.nl, term.nl, prog_util.nl:
Add determinism annotations.
term.nl, prog_io.nl:
Fix bugs in when declarations.
std_util.nl, prog_io.nl:
Add a maybe(T) type to std_util.nl.
Rename the maybe(T) type in prog_io.nl as maybe1(T).
mercury_builtin.nl:
Use det_pred(...), semidet_pred(...), nondet_pred(...)
rather than call_pred(...) for the higher-order predicate modes.
prog_io.nl, io.nl, varset.nl, etc.
Add determinism annotations.
hlds.nl, make_hlds.nl, LOTS of other files:
Reorganize the way the predicate table works.
Make hlds.nl a bit more modular.
Change call/4 to call/5.
Remove all/2 from the hlds.
Changed pred_id to an integer.
Added pred_call_id which is similar to the old pred_id.
Makefile:
Add a rule for creating *.hlds_dump.
array.nl:
Fix determinism error.
det_analysis.nl:
Fix a bug in printing determinism warnings.
fix_errors.sed:
Modify this so it allows all the `inferred nondet' determinism
errors but none of the `inferred semidet' ones.
llds.nl:
Rename llds__pred_mode_id as llds__proc_id.
mode_errors.nl:
Finally got around to implementing Zoltan's suggestions
about the error messages from the mode analysis.
If an error occurs in a conjunction, only one error message
is printed out - the first error which doesn't relate to
a head unification.
modes.nl:
Handle X = f(X) properly. NB: determinism analysis and code
generation still get it wrong!
undef_modes, undef_insts:
I've broken the error message code, since it's not easy
to print pred_ids. I just changed it so that it didn't
print the pred_ids out. Should fix this properly at some stage...
hlds_out.nl:
Print out the delta liveness info.
options.nl:
Add some documentation about the effect of -d -V.
list.nl:
Fix a couple of determinism errors.
mode_info.nl:
Move the pred declarations into the interface.
modes.nl:
Improve the debugging output and the error messages.
Use hlds_out__write_pred_id rather than write_pred_id.
Implement mode-checking of disjunctions and if-then-else.
make_hlds.nl:
Improve the transformation to super-homogenous form so that
it doesn't introduce unnecessary variables.
hlds_out.nl, typecheck.nl:
Move write_unify_context from typecheck.nl to hlds_out.nl.
Fix a couple of minor problems with the error messages in
typecheck.nl.
options.nl:
Add a `debug' option. Also tidy up the help message.
int.nl:
Avoid unnecessary parentheses.
hlds.nl:
Change mode_is_input and mode_is_output so that abstract
insts are assumed to be bound.
Add predicate `inst_is_ground'.
Add predicate `moduleinfo_set_num_errors'.
Also change instmap_delta back into a map again (probably a mistake! -
but I'll fix it later).
map.nl:
Add predicate `map__from_sorted_assoc_list'.
mercury_to_mercury.nl:
Export `mercury_output_inst' and `mercury_output_mode_list'.
modes.nl:
Lots of changes. It should be almost useable now.
options.nl:
Add a new --modecheck option to invoke the mode checker.
This is disabled by default since the modechecker doesn't
quite work yet.
parser.nl:
Remove obsolete comment.
prog_io.nl:
Ensure that the bound insts in a bound(...) list are in sorted
order.
set.nl:
Add predicate `set__sorted_list_to_set'.
toplevel.nl:
Changed to match the new interface to `modecheck'.
Also don't generate code if there were any errors detected by
make_hlds.
typecheck.nl:
Fix a couple of minor typos in the error messages.
bintree.nl, map.nl, std_util.nl:
Use assoc_list/2 rather than list(pair(...)).
hlds.nl, det_analysis.nl:
Make instmap delta an association list rather than a map;
fix the determinism analysis to use that.
Makefile, doit.nl:
Add det_analysis.nl and builtins.nl.
builins.nl:
Fix bug.
codegen.nl:
Make unimplemented cases abort rather than just fail.
modes.nl, typecheck.nl:
Fix bugs introduced by the performance fixes.
(I wonder if the performance problem will come back now? ;-)
options.nl, toplevel.nl:
Add a new pred `maybe_flush_output' and use it in toplevel.nl.
(2) Fix the singleton variable warnings in prog_io.nl (found and fixed
a bug in the DCG expansion).
(3) Improve the error reporting in typecheck.nl
(4) Improve the layout of error messages.
Makefile:
`make clean' now removes *.ugly.
mercury_to_goedel.nl mercury_to_mercury.nl options.nl:
Add a new option `-l' to indicate whether we should
output comments indicating the source line numbers
in the generated code.
Makefile, doit.nl:
Add set.nl.
Makefile:
Remove the old (now obsolete) Goedel stuff.
hlds.nl:
Add a new field which holds to non-local vars of each
goal to the goalinfo.
make_hlds.nl:
*** Handle implicit quantification. ***
mercury_to_mercury.nl, toplevel.nl, options.nl:
Send the mercury-to-mercury output to `<module>.ugly'
instead of overwriting `<module>.int'.
Also fix a silly bug with the --convert-to-goedel flag.
set.nl:
Add a new predicate set__list_to_set/2.
Also a couple of bug fixes.
term_io.nl, list.nl:
Trivial changes.
Makefile, toplevel.nl, mercury_to_goedel.nl, mercury_to_mercury.nl, options.nl:
- Integrate mercury_to_goedel into the compiler;
mercury_to_goedel is now just an option (-M) to mercury_compile.
Also add the ability to call mercury_to_mercury on the
whole source file (XXX but the output file gets named <module.int>,
which is wrong).
mercury_to_mercury.nl:
Output `:- interface' and `:- implementation' directives.
toplevel.nl, options.nl:
Add a `--help' option. Only display the long description of the
options if `--help' is specified.
llds.nl:
Add an XXX comment.
--------------------
options.nl, prog_io.nl:
Add a -I option.
--------------------
bintree.nl:
Add predicates to work out the depth and number of items
in a bintree.
map.nl:
Make the fact that maps are bintrees externally visible,
so that toplevel.nl can print out some stats about some maps.
toplevel.nl:
Print out some stats about the pred, type, and cons maps.
typecheck.nl:
Improve error messages.
make_hlds.nl:
Do part of the transformation to super-homogenous form.
options.nl, toplevel.nl, make_hlds.nl, typecheck.nl, modes.nl:
Use different options to control the different output messages.
Introduced two new options -e and -s, and changed various
places to check for these options instead of -v or -w.
std_util.nl:
Change the statistics output by report_stats so that they
fit in a single line.
mercury_to_mercury.nl:
New file: converts the prog_io data structure back into Mercury source
code.
term_io.nl:
Export mercury_quote_string for use by mercury_to_mercury.nl.
Makefile, doit.nl:
Add mercury_to_mercury.
options.nl, toplevel.nl:
Add a new option to save the interface of a module to a `.int' file,
using mercury_to_mercury.
Makefile:
Modify the rule for the `clean' target so that it removes `.int' files.
mercury_builtin.nl:
Fix the module name.
std_util.nl:
Suppress warnings from nit.
prog_io.nl:
An error message was omitting the file name & line number.
Also ensure that all error messages start with "error:".
codegen.nl, interpreter.nl, bintree.nl, list.nl:
Fix stuff detected by nit.
make_hlds.nl:
Transform to `semi-homogeneous' form (still need to expand
unifications).
prog_util.nl:
Fix bug.
mercury_builtin.nl:
Add call/1.
hlds.nl:
Add a count of the number of errors and warnings to the module_info
data structure.
toplevel.nl:
Continue processing after syntax errors.
varset.nl:
Added predicate varset__vars.
term.nl:
Added predicate term__vars_list.
typecheck.nl:
Implement two previously unimplemented parts of the typechecker:
detect attempts to instantiate type variables which occur in
the predicate's type declaration, and detect any failure to
bind all other type variables. (That was the last two;
apart from
prog_util.nl:
Fix problem where the expansion of equivalence types was
introducing fresh variables into the type varset, which caused
problems in relation to the above changes to typecheck.nl.
hlds_out.nl:
Fix typo in type declaration (found by above fixes to typechecker).
options.nl:
Fix bug in type definition introduced by last change.
make_hlds.nl:
Add a missing pred & mode declaration.
modes.nl:
Don't display the verbose messages unless the very-verbose
flag was specified.
no_builtin.nl which is an empty module for use with that option.
Note that `mercury_compile -g -b no_builtin some_simple_file'
should now work if the file `some_simple_file.nl' contains a sufficiently
simple program, like the one in my email.
toplevel.nl, typecheck.nl:
Added handling of command-line options.
globals.nl:
Added predicate `lookup_option'.
options.nl:
Added new option `-d' / `--dump-hlds'. Also added some new
predicates `maybe_write_string' and `maybe_report_stats'.
io.nl:
Added predicate io__report_stats. The old report_stats
should not be used.