Estimated hours taken: 6
Change the way mode analysis chooses which mode of a predicate to call.
If there are multiple matching modes, choose the best one, rather
than just the first one. "Best" is determined by comparing the
argument insts and livenesses, and (if that fails) determinism
of all the modes which do match. If two modes are equal, or
incomparable, in this partial ordering, we choose the first one
(according to the order in which they were declared).
Still to do (will be committed seperately): delete the hacks in make_hlds.m
etc. that assign mode numbers with a priority based on determinism.
compiler/modecheck_call.m:
For calls to predicates with multiple modes, find all the modes
which match and select the best one, rather than just picking
the first one that matches.
compiler/det_report.m:
Export compare_determinism/3, for use by modecheck_call.m.
NEWS:
LIMITATIONS:
We've fixed one of the limitations: unique mode declarations
no longer have to precede non-unique mode declarations.
tests/hard_coded/Mmakefile:
tests/hard_coded/mode_choice.m:
tests/hard_coded/mode_choice.exp:
Some tests cases for this change.