code_info.m:
Bug fix: change generate_pre_commit and generate_commit so that
the values which need to be saved and restored are always pushed
onto the det stack, even in nondet predicates. The reason is
that if the committed goal fails, curfr is not valid, so we
can't restore the fields from the nondet stack.
(This way may well be more efficient anyway.)
disj_gen.m, ite_gen.m:
Handle the case when the current failure continuation is unknown
on entry to the disjunction or nondet if-then-else by creating
a new frame on the nondet stack. (Originally we just aborted
in this case; recently we "fixed" this, but it turned out that
the fix was not correct, for the same reason as the above-mentioned
bug in pre_commit/commit.
llds.m:
Add succfr/1 and prevfr/1 to the rval type in llds.m,
since they were needed by the above bug fixes.
(This caused dozens of changes elsewhere to handle the
new types.)
Also fix a trivial bug that I recently introduced which
prevented --mod-comments from working.
live_vars.m:
Fix bug in allocation of stack slots for nondet code.
(This is the one that caused the bug that ksiew and I found
when writing a calculator program.)
peephole.m:
Disable the succeed_discard() optimization, since it
causes incorrect code to be generated. It was replacing
modframe(do_fail) ... succeed() with
modframe(do_fail) ... succeed_discard() even when there were
instructions such as mkframe() in between.
modes.m, hlds.m:
When modechecking switches, record the binding of the switch variable
as we enter each case, so that we get the determinism analysis
right.
mercury_compile.pp:
Make sure that we set the exit status to be non-zero if we
find any errors.
typecheck.m, modes.m, undef_types.m, undef_modes.m:
Don't invoke type-checking if there are undefined types.
Don't invoke mode-checking if there are undefined modes.
This avoids the problem of the compiler aborting with an
internal error if there are undefined types/modes.
compiler/*:
Add copyright messages.
Change all occurences of *.nl in comments to *.m.
compiler/mercury_compile.pp:
Change the output to the .dep files to use *.m rather than *.nl.
(NOTE: this means that `mmake' will not work any more if you
call your files *.nl!!!)
hlds.nl, hlds_out.nl, det_analysis.nl:
Remove the unused `declared_determinsm' field in the goal_info.
Rename the `inferred_determinism' field as just `determism'.
Add a new field `local_determinism'. In det_analysis.nl,
Plug the contents of the new `local_determinsm' field in the goal_info
into the computation of the determinism for each goal.
det_analysis.nl, fix_errs.sed:
For the cases which we currently don't handle correctly,
generate incorrect code in preference to generating spurious
error messages (we still have to handle these cases sometime,
but this means that we can deal with them one at a time).
arg_info.nl, builtins.nl, code_gen.nl, delay_info.nl, det_analysis.nl,
getopt.nl, globals.nl, make_hlds.nl, modes.nl, mode_util.nl, stack.nl,
string.nl, string.nu.nl, term.nl, undef_modes.nl, varset.nl:
Fix determinism errors uncovered by the changes in the determinism
analysis.
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...
prog_io.nl, hlds.nl, mercury_to_mercury.nl, modes.nl, undef_modes.nl,
mode_util.nl:
Bug fix: change unify_inst(inst, inst) to unify_inst(live, inst, inst),
so that we don't lose the effect of liveness of unifications
when looking up the results of unifications in the unify_inst_table.
hlds_out.nl, mercury_to_mercury.nl:
Rewrite most of hlds_out.nl so that the output is printed
as a Mercury program annotated with comments.
Export some more of the predicates in mercury_to_mercury.nl
for use by hlds_out.nl.
toplevel.nl:
Ensure that the message "dumping hlds..." goes to stdout/stderr,
not to the hlds dump file.
prog_io.nl, hlds.nl:
Add `arity' as an alias for `int'.
map.nl:
Improve the code for map__merge.
Add map__optimize.
Work-around a bug in the determinism analysis.
make_hlds.nl:
Use map__optimize rather than bintree__balance.
codegen.nl, std_util.nl:
Add a call to `semidet_succeed' in codegen.nl, and
implement that pred in std_util.nl, in an
attempt to suppress a determinism warning.
(The attempt failed, due to an as-yet unknown bug in
the determinism analysis.)
hlds.nl, modes.nl, mode_util.nl, mercury_to_mercury.nl, undef_modes.nl.
Replace the inst table with four tables, one for
user-defined insts, and three for compiler-generated
insts. Modify all the routines dealing with insts to
handle this. Change `inst_merge' in modes.nl to return
a compiler-generated recursive inst if necessary.
term_io.nl:
Fix bugs caused by recent changes to io__xxx_op preds.
Makefile, apply_sed_script, fix_errs.sed:
A quick hack to avoid the spurious determinism errors.
term_io.nl, char.nl, string.nl:
Add a few additional utility preds to string.nl.
Add some more preds to handle quoting to term_io.nl.
Remove the stuff which handled quoting in char.nl.
modes.nl, mode_errors.nl, delay_info.nl, mode_info.nl, undef_modes.nl:
Break modes.nl up into separate modules.
toplevel.nl (plus LOTS of other files):
Change the way module imports are handled. Fix the resulting missing
import problems found in most of the modules.
mode_util.nl:
Add predicate inst_is_bound_to_functors/3.
switch_detection.nl:
New file. Still very incomplete.
meta.nl:
Remove. This file was old junk.