mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-06 16:08:32 +00:00
compiler/switch_detection.m:
The existing switch detection algorithm does a single forward
traversal of the procedure body, doing only very limited lookahead.
This prevents it from recognizing some switches. To fix this, add
a new prepass that provides unlimited lookahead.
Add one use of this lookahead information. Later diffs should add
more uses.
compiler/print_help.m:
Fix the code that served as motivation for this change.
It was a block of unifications that was intended to supply
the lookahead that the old algorithm needed but did not have,
but it actually lied: it said that the the following disjunction
covered cons_ids that it actually did not cover. The fact that
the compiler did not diagnose this lie until now was a bug.
(After this diff, the compiler now reports an error.)
deep_profiler/message.m:
Avoid the limitation of the new algorithm that was discussed today
on m-dev.
compiler/options.m:
Add a way to test for the presence of this new capability
in the installed compiler.
tests/warnings/help_text.err_exp:
Expect the new option name.
For documentation on the deep profiler, see the following:
- The "Deep Profiler" section of the Mercury web page
<http://www.cs.mu.oz.au/mercury/information/deep_demo.html>
gives an overview of what deep profiling is.
- The deep profiling paper on our web site, "Deep profiling:
engineering a profiler for a declarative programming language"
<http://www.cs.mu.oz.au/mercury/information/papers.html#mu_01_24>
explains in detail what deep profiling is, why it is needed,
and how it is implemented in the Mercury compiler.
- The "Using mdprof" section of the "Profiling" chapter of the
Mercury user's guide explains how to use it.
- The file deep_profiler/notes/deep_profiling.html gives an overview of
the specifics details of our implementation of deep profiling.