compiler/COMP_FLAGS.in:
Specify --warn-dead-preds for all modules by default.
compiler/Mercury.options:
Stop specifying --warn-dead-preds for modules individually.
compiler/mlds_to_c_func.m:
compiler/mlds_to_c_type.m:
compiler/parse_tree_out_type_repn.m:
Delete some unused predicates.
compiler/equiv_type_hlds.m:
Shut up a warning about an unused predicate that may be needed later.
compiler/det_analysis.m:
Use a bespoke format component.
compiler/error_util.m:
Fix some comments.
compiler/process_util.m:
Don't use mode-specific clauses unnecessarily.
compiler/timestamp.m:
Give a predicate a more descriptive name.
compiler/process_util.m:
Make do_wait always assign all output variables.
Make do_wait return an error message if waitpid() fails.
Do not use MR_perror.
Make wrappers wait_pid and wait_any return errors from waitpid().
Change wait_any to return maybe(pid) in case waitpid() does not
return a child process id.
Use the non-hyphenated forms of "submodule" and "fully qualified" throughout.
doc/reference_manual.texi:
doc/user_guide.texi:
compiler/add_type.m:
compiler/deps_map.m:
compiler/module_imports.m:
compiler/pred_table.m:
compiler/process_util.m:
compiler/status.m:
As above.
browser/collect_lib.m:
browser/declarative_execution.m:
browser/dl.m:
browser/io_action.m:
compiler/make.util.m:
compiler/pickle.m:
compiler/process_util.m:
compiler/prog_event.m:
library/array.m:
library/benchmarking.m:
library/bit_buffer.m:
library/builtin.m:
library/char.m:
library/deconstruct.m:
library/dir.m:
library/erlang_rtti_implementation.m:
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/io.m:
library/math.m:
library/mutvar.m:
library/private_builtin.m:
library/profiling_builtin.m:
library/rtti_implementation.m:
library/store.m:
library/string.format.m:
library/string.m:
library/table_builtin.m:
library/term_size_prof_builtin.m:
library/thread.m:
library/time.m:
library/type_desc.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
ssdb/ssdb.m:
As above. This mostly involved two things.
The first was grouping foreign_procs by predicate instead of by language.
In a few cases, this revealed that some predicates *had* no foreign_proc
for a language, while related predicates did have one that just aborted
if called. This diff adds similar aborting foreign_procs to predicate/
language combinations that were missing them, when this seemed obviously
the right thing to do.
The second was moving pragmas about a predicate from the middle of the
block of clauses of that predicate to the start of that block.
Many predicates that do their jobs via foreign_procs in C have a fallback
Mercury clause for non-C backends, which usually throws an exception.
When compiled in non-C grades, these often get a warning that their
determinism declaration could have been tigther, e.g. erroneous instead of det.
*.m:
Add no_determinism_warnings pragmas before such fallback clauses.
library/dir.m:
As above, but also remove the unnecessary "dir." prefix on many predicate
declarations and clause heads.
MSVC doesn't provide the WIFEXITED and other macros that help a programmer
determine if a child process exited with an error message or was killed by a
signal. In these cases Mercury assumes that positive numbers are exit codes
and negative numbers mean that a process was killed by a signal.
When "cl" exited with errors, returning the error code -2, mmc --make
thought that it was killed by a signal and failed to display the compilation
errors.
This patch removes the existing code that tries to detect signals when these
macros are not available. As far as I know platforms like windows don't
have a concept of SysV signals, therefore signals can only occur when using
cygwin or some other compatibility layer which will then provide the
WIFEXITED and other macros.
I considered using the windows API directly however it didn't (as far as I
could find) provide any concept of signals, so I rejected this idea.
library/io.m:
As above.
Also avoid the use of magic numbers such as 127 for failure.
Rename the handle_system_command_exit_status/1 function to
decode_system_command_exit_code,
compiler/process_util.m:
Conform to changes in io.m
compiler/module_cmds.m:
If a subprocess is killed by a signal then report this both to the
desired stream (the error stream for the subtask) and to standard
output.
After reporting the error then re-raise the signal, not before.
compiler/file_util.m:
Flush output after reporting an error to make sure that it is seen.
compiler/*.m:
Module qualify the end_module declarations. In some cases, add them.
compiler/table_gen.m:
Remove an unused predicate, and inline another in the only place
where it is used.
compiler/add_pragma.m:
Give some predicates more meaningful names.
library/io.m:
Add casts where appropriate to avoid warnings.
Return a dummy time value in io.file_modification_time_2/6 when the
call to stat() fails. (This is safe since the caller will never
examine this value if the call to stat() fails.) Doing so avoids
a warning about the time value not being initialized in some branches.
library/string.m:
Delete unused local variables in foreign_procs.
library/time.m:
compiler/timestamp.m:
Cast assignments to the fields of the tm structure to ints.
compiler/md4.m:
Avoid a warning about comparing integers of different signedness.
compiler/process_util.m:
Add casts where appropriate to avoid warnings.
Branches: main, 11.07 (maybe)
Avoid warnings from MSVC concerning assignments from uninitialized variables.
These assignments arise due to the assignment of the initial I/O state to the
final I/O state in foreign_proc bodies. In low-level C grades this leads to
code like the following:
{
MR_Word IO0;
MR_Word IO;
...
IO = IO0;
}
Even though IO is itself unused, MSVC still emits a warning about the
assignment (many hundreds of warnings when the io module is opt-imported).
To avoid this, use don't-care variables for the I/O state in foreign procs
and don't include references to the I/O state in their bodies at all.
(We already did this in some places but not others.)
library/benchmarking.m:
library/dir.m:
library/io.m:
library/par_builtin.m:
library/stm_builtin.m:
library/thread.semaphore.m:
library/time.m:
compiler/make.util.m:
compiler/process_util.m:
Make the above change.
Delete the MR_update_io macro that is defined in a couple of spots.
library/io.m:
Unrelated change: s/MR_CONSERVATIVE_GC/MR_BOEHM_GC/ in a spot
since the former does not imply the later and the code that is
protecting is Boehm GC specific.
tests/debugger/poly_io_retry2.m:
Conform the the above change.
Estimated hours taken: 6
Branches: main
compiler/*.m:
Convert almost all remaining modules in the compiler to use
"$module, $pred" instead of "this_file" in error messages.
In a few cases, the old error message was misleading, since it
contained an incorrect, out-of-date or cut-and-pasted predicate name.
tests/invalid/unresolved_overloading.err_exp:
Update an expected output containing an updated error message.
Estimated hours taken: 2
deep_profiler/autopar_calc_overlap.m:
New module for calculating the overlap between the conjuncts of a
parallelised conjunction. Its contents are taken from the old
autopar_search_callgraph.m.
deep_profiler/autopar_costs.m:
New module for calculating the costs of goals. Its contents
are taken from the old autopar_search_callgraph.m.
deep_profiler/autopar_reports.m:
New module for creating reports. Its contents are taken from
the old autopar_search_callgraph.m.
deep_profiler/autopar_search_goals.m:
New module for searching goals for parallelizable conjunctions.
Its contents are taken from the old autopar_search_callgraph.m.
deep_profiler/autopar_search_callgraph.m:
Remove the code moved to other modules.
deep_profiler/mdprof_fb.automatic_parallelism.m:
Add the new modules.
deep_profiler/*.m:
Remove unnecessary imports.
Fix copyright years on the new modules.
browser/*.m:
compiler/*.m:
mdbcomp/*.m:
Remove unnecessary imports.
library/Mercury.options:
Make it possible to compile a whole workspace with
--warn-unused-imports by turning that option off for type_desc.m
(which has a necessary import that --warn-unused-imports thinks
is unused).
Branches: main, 11.01
A step towards getting the compiler to build in the java (and other non-C)
grade(s).
library/Mmakefile:
Don't make lib_std depend on Native.so (which is currently
unused) in the java grade.
The lib_std target for the java grade *does* need to be
defined if mmake --use-mmc-make is being used; not the
other way round.
browser/Mmakefile:
There is no "jars" target (and in any case the standard
top-level in this directory works.)
compiler/Mmakefile:
Bump the heap size for javac since the default is not
sufficient.
compiler/make.util.m:
compiler/md4.m:
compiler/pickle.m:
compiler/process_util.m:
compiler/prog_events.m:
Provide definitions of some predicates for the non-C backends.
Estimated hours taken: 8
Branches: main
Make error messages for require_complete_switch scopes report the missing
functors.
Knowing which functors are missing requires knowing not only the set of
functors in the switched-on variable's type, but also which of these functors
have been eliminated by earlier tests, which requires having the instmap at
the point of entry to the switch. Simplification, which initially detected
unmet require_complete_switch requirements, does not have the instmap, and
threading the instmap through it would make it significantly less efficient.
So instead we now detect any problems with require_complete_switch scopes
(and require_detism scopes, which are similar) during determinism checking.
compiler/det_report.m:
Factor out the code for finding the missing functors in conventional
determinism errors, to allow it to be used for this new purpose.
Check whether the requirements of require_complete_switch and
require_detism scopes are met IF the predicate has any such scopes.
compiler/det_analysis.m:
compiler/det_util.m:
Record whether the predicate has any such scopes.
compiler/hlds_pred.m:
Add a predicate marker that allows this recording.
compiler/simplify.m:
Delete the code that checks the require_complete_switch and
require_detism scopes. Keep the code that deletes those scopes.
(We have to do that here because determinism error reporting
never updates the goal).
compiler/prog_out.m:
Delete an unused predicate.
compiler/*.m:
Remove unnecesary imports as flagged by --warn-unused-imports.
Estimated hours taken: 60
Branches: main
Stop storing globals in the I/O state, and divide mercury_compile.m
into smaller, more cohesive modules. (This diff started out as doing
only the latter, but it became clear that this was effectively impossible
without the former, and the former ended up accounting for the bulk of the
changes.)
Taking the globals out of the I/O state required figuring out how globals
data flowed between pieces of code that were often widely separated.
Such flows were invisible when globals could be hidden in the I/O state,
but now they are visible, because the affected code now passes around
globals structures explicitly.
In some cases, the old flow looked buggy, as when one job invoked by
mmc --make could affect the globals value of its parent or the globals value
passed to the next job. I tried to fix such problems when I saw them. I am
not 100% sure I succeeded in every case (I may have replaced old bugs with
new ones), but at least now the flow is out in the open, and any bugs
should be much easier to track down and fix.
In most cases, changes the globals after the initial setup are intended to be
in effect only during the invocation of a few calls. This used to be done
by remembering the initial values of the to-be-changed options, changing their
values in the globals in the I/O state, making the calls, and restoring the old
values of the options. We now simply create a new version of the globals
structure, pass it to the calls to be affected, and then discard it.
In two cases, when discovering reasons why (1) smart recompilation should
not be done or (2) item version numbers should not be generated, the record
of the discovery needs to survive this discarding. This is why in those cases,
we record the discovery by setting a mutable attached to the I/O state.
We use pure code (with I/O states) both to read and to write the mutables,
so this is no worse semantically than storing the information in the globals
structure inside the I/O state. (Also, we were already using such a mutable
for recording whether -E could add more information.)
In many modules, the globals information had to be threaded through
several predicates in the module. In some places, this was made more
difficult by predicates being defined by many clauses. In those cases,
this diff converts those predicates to using explicit disjunctions.
compiler/globals.m:
Stop storing the globals structure in the I/O state, and remove
the predicates that accessed it there.
Move a mutable and its access predicate here from handle_options.m,
since here is when the mutables treated the same way are.
In a couple of cases, the value of an option is available in a mutable
for speed of access from inside performance-critical code. Set the
values of those mutables from the option when the processing of option
values is finished, not when it is starting, since otherwise the copies
of each option could end up inconsistent.
Validate the reuse strategy option here, since doing it during ctgc
analysis (a) is too late, and (b) would require an update to the
globals to be done at an otherwise inconvenient place in the code.
Put the reuse strategy into the globals structure.
Two fields in the globals structure were unused. One
(have_printed_usage) was made redundant when the one predicate
that used it itself became unused; the other (source_file_map)
was effectively replaced by a mutable some time ago. Delete
these fields from the globals.
Give the fields of the globals structure a distinguishing prefix.
Put the type declarations, predicate declarations and predicate
definitions in a consistent order.
compiler/source_file_map.m:
Record this module's results only in the mutable (it serves as a
cache), not in globals structure. Use explicitly passed globals
structure for other purposes.
compiler/handle_options.m:
Rename handle_options as handle_given_options, since it does not
process THE options to the program, but the options it is given,
and even during the processing of a single module, it can be invoked
up the three times in a row, each time being given different options.
(It was up to four times in a row before this diff.)
Make handle_given_options explicitly return the globals structure it
creates. Since it does not take an old global structure as input
and globals are not stored in the I/O state, it is now clear that
the globals structure it returns is affected only by the default values
of the options and the options it processes. Before this diff,
in the presence of errors in the options, handle_options *could*
return (implicitly, in the I/O state) the globals structure that
happened to be in the I/O state when it was invoked.
Provide a separate predicate for generating a dummy globals based only
on the default values of options. This allows by mercury_compile.m
to stop abusing a more general-purpose predicate from handle_options.m,
which we no longer export.
Remove the mutable and access predicate moved to globals.m.
compiler/options.m:
Document the fact that two options, smart_recompilation and
generate_item_version_numbers, should not be used without seeing
whether the functionalities they call for have been disabled.
compiler/mercury_compile_front_end.m:
compiler/mercury_compile_middle_passes.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mercury_compile_mlds_back_end.m:
compiler/mercury_compile_erl_back_end.m:
New modules carved out of the old mercury_compile.m. They each cover
exactly the areas suggested by their names.
Each of the modules is more cohesive than the old mercury_compile.m.
Their code is also arranged in a more logical order, with predicates
representing compiler passes being defined in the order of their
invocation.
Some of these modules export predicates for use by their siblings,
showing the dependencies between the groups of passes.
compiler/top_level.m:
compiler/notes/compiler_design.html:
Add the new modules.
compiler/mark_static_terms.m:
Move this module from the ml_backend package to the hlds package,
since (a) it does not depend on the MLDS in any way, and (b) it is
also needed by a compiler pass (loop invariants) in the middle passes.
compiler/hlds.m:
compiler/ml_backend.m:
compiler/notes/compiler_design.html:
Reflect mark_static_terms.m's change of package.
compiler/passes_aux.m:
Move the predicates for dumping out the hLDS here from
mercury_compile.m, since the new modules also need them.
Look up globals in the HLDS, not the I/O state.
compiler/hlds_module.m:
Store the prefix (common part) of HLDS dump file names in the HLDS
itself, so that the code moved to passes_aux.m can figure out the
file name for a HLDS dump without doing system calls.
Give the field names of some structures prefixes to avoid ambiguity.
compiler/mercury_compile.m:
Remove the code moved to the other modules. This module now looks
after only option handling (such as deciding whether to generate .int3
files, .int files, .opt files etc), and the compilation passes
up to and including the creation of the first version of the HLDS.
Everything after that is subcontracted to the new modules.
Simplify and make explicit the flow of globals information.
When invoking predicates that could disable smart recompilation,
check whether they have done so, and if yes, update the globals
accordingly.
When compiling via gcc, we need to link into the executable
the object files of any separate C files we generate for C code
foreign_procs, which we cannot translate into gcc's internal
structures without becoming a C compiler as well as a Mercury compiler.
Instead of adding such files to the accumulating option for extra
object files in the globals structure, we return their names using
the already existing mechanism we have always used to link the object
files of fact tables into the executable.
Give several predicates more descriptive names. Put predicates
in a more logical order.
compiler/make.m:
compiler/make.dependencies.m:
compiler/make.module_target.m:
compiler/make.module_dep_file.m:
compiler/make.program_target.m:
compiler/make.util.m:
Require callers to supply globals structures explicitly, not via the
I/O state. Afterward pass them around explicitly, passing modified
versions to mercury_compile.m when invoking it with module- and/or
task-specific options.
Due the extensive use of partial application for higher order code
in these modules, passing around the globals structures explicitly
is quite tricky here. There may be cases where a predicate uses
an old globals structure it got from a closure instead of the updated
module- and/or task-specific globals it should be using, or vice versa.
However, it is just as likely that, this diff fixes old problems
by preventing the implicit flow of updated-only-for-one-invocation
globals structures back to the original invoking context.
Although I have tried to be careful about this, it is also possible
that in some places, the code is using an updated-for-an-invocation
globals structure in some but not all of the places where it
SHOULD be used.
compiler/c_util.m:
compiler/compile_target_code.m:
compiler/compiler_util.m:
compiler/error_util.m:
compiler/file_names.m:
compiler/file_util.m:
compiler/ilasm.m:
compiler/ml_optimize.m:
compiler/mlds_to_managed.m:
compiler/module_cmds.m:
compiler/modules.m:
compiler/options_file.m:
compiler/pd_debug.m:
compiler/prog_io.m:
compiler/transform_llds.m:
compiler/write_deps_file.m:
Require callers to supply globals structures explicitly, not via the
I/O state.
In some cases, the explicit globals structure argument allows
a predicate to dispense with the I/O states previously passed to it.
In some modules, rename some predicates, types and/or function symbols
to avoid ambiguity.
compiler/read_modules.m:
Require callers to supply globals structures explicitly, not via the
I/O state.
Record when smart recompilation and the generation of item version
numbers should be disabled.
compiler/opt_debug.m:
compiler/process_util.m:
Require callers to supply the needed options explicitly, not via the
globals in the I/O state.
compiler/analysis.m:
compiler/analysis.file.m:
compiler/mmc_analysis.m:
Make the analysis framework's methods take their global structures
as explicit arguments, not as implicit data stored in the I/O state.
Stop using `with_type` and `with_inst` declarations unnecessarily.
Rename some predicates to avoid ambiguity.
compiler/hlds_out.m:
compiler/llds_out.m:
compiler/mercury_to_mercury.m:
compiler/mlds_to_c.m:
compiler/mlds_to_java.m:
compiler/optimize.m:
Make these modules stop accessing the globals from the I/O state.
Do this by requiring the callers of their top predicates to explicitly
supply a globals structure. To compensate for the cost of having to
pass around a representation of the options, look up the values of the
options of interest just once, to make further access much faster.
(In the case of mlds_to_c.m, the code already did much of this,
but it still had a few accesses to globals in the I/O state that
this diff eliminates.)
If the module exports a predicate that needs these pre-looked-up
options, then export the type of this data structure and its
initialization function.
compiler/frameopt.m:
Since this module needs only one option from the globals, pass that
option instead of the globals.
compiler/accumulator.m:
compiler/add_clause.m:
compiler/closure_analysis.m:
compiler/complexity.m:
compiler/deforest.m:
compiler/delay_construct.m:
compiler/elds_to_erlang.m:
compiler/exception_analysis.m:
compiler/fact_table.m:
compiler/intermod.m:
compiler/mode_constraints.m:
compiler/mode_errors.m:
compiler/pd_util.m:
compiler/post_term_analysis.m:
compiler/recompilation.usage.m:
compiler/size_prof.usage.m:
compiler/structure_reuse.analysis.m:
compiler/structure_reuse.direct.choose_reuse.m:
compiler/structure_reuse.direct.m:
compiler/structure_sharing.analysis.m:
compiler/tabling_analysis.m:
compiler/term_constr_errors.m:
compiler/term_constr_fixpoint.m:
compiler/term_constr_initial.m:
compiler/term_constr_main.m:
compiler/term_constr_util.m:
compiler/trailing_analysis.m:
compiler/trans_opt.m:
compiler/typecheck_info.m:
Look up globals information from the HLDS, not the I/O state.
Conform to the changes above.
compiler/gcc.m:
compiler/maybe_mlds_to_gcc.pp:
compiler/mlds_to_gcc.m:
Look up globals information from the HLDS, not the I/O state.
Conform to the changes above.
Convert these modules to our current programming style.
compiler/termination.m:
Look up globals information from the HLDS, not the I/O state.
Conform to the changes above.
Report some warnings with error_specs, instead of immediately
printing them out.
compiler/export.m:
compiler/il_peephole.m:
compiler/layout_out.m:
compiler/rtti_out.m:
compiler/liveness.m:
compiler/make_hlds.m:
compiler/make_hlds_passes.m:
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/recompilation.check.m:
compiler/stack_opt.m:
compiler/superhomogeneous.m:
compiler/tupling..m:
compiler/unneeded_code.m:
compiler/unused_args.m:
compiler/unused_import.m:
compiler/xml_documentation.m:
Conform to the changes above.
compiler/equiv_type_hlds.m:
Give the field names of a structure prefixes to avoid ambiguity.
Stop using `with_type` and `with_inst` declarations unnecessarily.
compiler/loop_inv.m:
compiler/pd_info.m:
compiler/stack_layout.m:
Give the field names of some structures prefixes to avoid ambiguity.
compiler/add_pragma.m:
Add notes.
compiler/string.m:
NEWS:
Add a det version of remove_suffix, for use by new code above.
Branches: main
Make interrupting parallel `mmc --make' more robust.
compiler/make.util.m:
When the parent process receives a signal, send SIGINT to child
processes.
When any process receives a signal, set the abort flag in the job
control structure. All the processes will then see the abort flag the
next time they look for a task to work on.
compiler/process_util.m:
Add a predicate to send a signal.
Branches: main
Print common `mmc --make' messages with a single call to io.write_string, to
avoid interleaved messages when parallel make is used.
When cleaning up after receiving a signal, only print messages about the files
being removed if `--very-verbose' is set.
compiler/make.module_dep_file.m:
compiler/make.module_target.m:
compiler/make.util.m:
compiler/process_util.m:
As above.
Branches: main
Fix a performance problem with mmc --make --jobs <n>. It would fork a new
process for each target, whether or not that target was already up-to-date.
For a large program which is mostly up-to-date, this could be very costly.
The main reason it was implemented so was to avoid interprocess communication
which might be non-portable (the only communication was via a sub-process's
exit code).
This patch makes use of IPC to allow the master process to fork off only N-1
worker processes, itself being the last worker. The workers communicate via
shared memory as to which tasks still need doing, and which are completed.
A worker process therefore may work on as many tasks as required before
terminating.
Parallel mmc --make is currently disabled in .par grades. It should be
fairly simple to restore.
configure.in:
runtime/mercury_conf.h.in:
Check sys/mman.h is available for mmap().
Mmake.common.in:
compiler/Mmakefile:
Link with thread libraries for POSIX mutexes.
compiler/make.util.m:
Reimplement process-based concurrent fold predicate as above.
Fall back to non-concurrent fold if the IPC mechanisms are
unavailable.
Delete old thread-based concurrent fold implementation.
compiler/process_util.m:
Add wait_pid to wait on a particular child process.
compiler/Mercury.options:
Set --no-ansi-c on make.util.m.
Estimated hours taken: 20
Branches: main
Add a new compiler option. --inform-ite-instead-of-switch. If this is enabled,
the compiler will generate informational messages about if-then-elses that
it thinks should be converted to switches for the sake of program reliability.
Act on the output generated by this option.
compiler/simplify.m:
Implement the new option.
Fix an old bug that could cause us to generate warnings about code
that was OK in one duplicated copy but not in another (where a switch
arm's code is duplicated due to the case being selected for more than
one cons_id).
compiler/options.m:
Add the new option.
Add a way to test for the bug fix in simplify.
doc/user_guide.texi:
Document the new option.
NEWS:
Mention the new option.
library/*.m:
mdbcomp/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
Convert if-then-elses to switches at most of the sites suggested by the
new option. At the remaining sites, switching to switches would have
nontrivial downsides. This typically happens with the switched-on type
has many functors, and we treat one or two specially (e.g. cons/2 in
the cons_id type).
Perform misc cleanups in the vicinity of the if-then-else to switch
conversions.
In a few cases, improve the error messages generated.
compiler/accumulator.m:
compiler/hlds_goal.m:
(Rename and) move insts for particular kinds of goal from
accumulator.m to hlds_goal.m, to allow them to be used in other
modules. Using these insts allowed us to eliminate some if-then-elses
entirely.
compiler/exprn_aux.m:
Instead of fixing some if-then-elses, delete the predicates containing
them, since they aren't used, and (as pointed out by the new option)
would need considerable other fixing if they were ever needed again.
compiler/lp_rational.m:
Add prefixes to the names of the function symbols on some types,
since without those prefixes, it was hard to figure out what type
the switch corresponding to an old if-then-else was switching on.
tests/invalid/reserve_tag.err_exp:
Expect a new, improved error message.
Branches: main
Make parallel mmc --make work using processes as well as threads. This means
the compiler doesn't need to be built in a .par grade for the --jobs option
to have an effect.
compiler/make.util.m:
Generalise the existing parallel fold code to work with threads and
processes.
compiler/process_util.m:
Add a predicate to start running a child process without waiting for
the child to finish.
Add a predicate to wait for a child process to finish.
doc/user_guide.text:
Update the documentation.
Estimated hours taken: 4
Branches: main
Fix an inconsistency between the compiler's handling of foreign_import_module
pragmas (which was itself inconsistent between backends) and what is documented
about that pragma in the reference manual.
According to the reference manual if foreign code (in either a foreign_proc or
foreign_code pragma) wants to refer to pragma foreign_exported procedures from
the same module then there needs to be a foreign_import_module in the module
for itself.
The high-level C backend ignores this entirely and modules always effectively
implicitly foreign import themselves. The situation with the low-level C
backend varies depending on whether a module has any children or not; if it
does then it does not implicitly foreign import itself otherwise it does.
This diff changes the language to require that modules always implicitly
foreign import themselves and adds a workaround to the low-level C backend
to make sure this always happens. (A better fix would be to modify
the frontend of the compiler to handle the implicit foreign imports
for both backends but the lack of structure in the parse tree makes this
quite awkward at the moment.)
Fix a bunch of comments that were out-of-date.
doc/reference_manual.texi:
Change the description of behaviour of
`:- pragma foreign_import_module' so that it matches what the
implementation actually does (well, at least what it actually
does most of the time.) The new behaviour removes the requirement
that modules need to foreign_import themselves. This is pretty much
what users (and implementors) have assumed anyway
compiler/mercury_compile.m:
Make sure that in LLDS grades modules always foreign import themselves
(this was the exception to "most of the time" above.)
Change an if-then-else into a switch.
tests/hard_coded/sub-modules/Makefile:
tests/hard_coded/sub-modules/sm_exp_bug.m:
tests/hard_coded/sub-modules/sm_exp_bug.child.m:
tests/hard_coded/sub-modules/sm_exp_bug.exp:
Test case for the above.
compiler/mlds.m:
Update a comment. pragma foreign_export has been implemented
for other backends.
compiler/modules.m:
Fix the formatting of the module_imports structure.
Divide some of this module more visibly into sections.
compiler/process_util.m:
Replace a pragma_export with pragma foreign_export.
compiler/add_pragma.m:
compiler/det_analysis.m:
compiler/export.m:
compiler/hlds_module.m:
compiler/make.m:
compiler/make_hlds_passes.m:
compiler/ml_code_gen.m:
compiler/ml_elim_nested.m:
compiler/mlds_to_c.m:
compiler/prog_foreign.m:
s/pragma export/pragma foreign_export/
compiler/make_hlds.m:
compiler/prog_io_pragma.m:
compiler/prog_item.m:
Minor formatting fixes.
Estimated hours taken: 3
Branches: main
Clean up in unused module imports in the Mercury system detected
by --warn-unused-imports.
analysis/*.m:
browser/*.m:
deep_profiler/*.m:
compiler/*.m:
library/*.m:
mdbcomp/*.m:
profiler/*.m:
slice/*.m:
Remove unused module imports.
Fix some minor departures from our coding standards.
analysis/Mercury.options:
browser/Mercury.options:
deep_profiler/Mercury.options:
compiler/Mercury.options:
library/Mercury.options:
mdbcomp/Mercury.options:
profiler/Mercury.options:
slice/Mercury.options:
Set --no-warn-unused-imports for those modules that are used as
packages or otherwise break --warn-unused-imports, e.g. because they
contain predicates with both foreign and Mercury clauses and some of
the imports only depend on the latter.
Estimated hours taken: 6
Branches: main
browser/*.m:
compiler/*.m:
Rename a bunch of predicates and function symbols to eliminate
ambiguities.
The only real change is factoring out some common code in the mlds
and llds code generators, replacing them with single definitions
in switch_util.m.
Estimated hours taken: 1
Branches: main
Minor style cleanups for the CTGC system. There are no changes to any
algorithms.
compiler/ctgc.*.m:
compiler/prog_ctgc.m:
compiler/structure_reuse.*.m:
compiler/structure_sharing.*.m:
Minor style cleanups.
compiler/builtin_ops.m:
compiler/check_hlds.m:
compiler/exception_analysis.m:
compiler/hlds_rtti.m:
compiler/process_util.m:
s/__/./ in a couple of spots and fix a few other formatting problems.
Estimated hours taken: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 1
Branches: main
compiler/process_util.m:
Disable forking by `mmc --make' if built in a parallel grade as
threads and fork() do not mix.
Estimated hours taken: 4
Branches: main
compiler/*.m:
Use expect/3 in place of require/2 throughout most of the
compiler.
Use unexpected/2 (or sorry/2) in place of error/1 in more
places.
Fix more dodgy assertion error messages.
s/map(prog_var, mer_type)/vartypes/ where the latter is meant.
Estimated hours taken: 8
Branches: main
Improve the error messages generated for determinism errors involving committed
choice contexts. Previously, we printed a message to the effect that e.g.
a cc pred is called in context that requires all solutions, but we didn't say
*why* the context requires all solutions. We now keep track of all the goals
to the right that could fail, since it is these goals that may reject the first
solution of a committed choice goal.
The motivation for this diff was the fact that I found that locating the
failing goal can be very difficult if the conjunction to the right is
a couple of hundred lines long. This would have been a nontrivial problem,
since (a) unifications involving values of user-defined types are committed
choice goals, and (b) we can expect uses of user-defined types to increase.
compiler/det_analysis.m:
Keep track of goals to the right of the current goal that could fail,
and include them in the error representation if required.
compiler/det_report.m:
Include the list of failing goals to the right in the representations
of determinism errors involving committed committed choice goals.
Convert the last part of this module that wasn't using error_util
to use error_util. Make most parts of this module just construct
error message specifications; print those specifications (using
error_util) in only a few places.
compiler/hlds_out.m:
Add a function for use by the new code in det_report.m.
compiler/error_util.m:
Add a function for use by the new code in det_report.m.
compiler/error_util.m:
compiler/compiler_util.m:
Error_util is still changing reasonably often, and yet it is
included in lots of modules, most of which need only a few simple
non-parse-tree-related predicates from it (e.g. unexpected).
Move those predicates to a new module, compiler_util.m. This also
eliminates some undesirable dependencies from libs to parse_tree.
compiler/libs.m:
Include compiler_util.m.
compiler/notes/compiler_design.html:
Document compiler_util.m, and fix the documentation of some other
modules.
compiler/*.m:
Import compiler_util instead of or in addition to error_util.
To make this easier, consistently use . instead of __ for module
qualifying module names.
tests/invalid/det_errors_cc.{m,err_exp}:
Add this new test case to test the error messages for cc contexts.
tests/invalid/det_errors_deet.{m,err_exp}:
Add this new test case to test the error messages for unifications
inside function symbols.
tests/invalid/Mmakefile:
Add the new test cases.
tests/invalid/det_errors.err_exp:
tests/invalid/magicbox.err_exp:
Change the expected output to conform to the change in det_report.m,
which is now more consistent.
Estimated hours taken: 4
Branches: main
compiler/*.m:
Convert a bunch of modules to four-space indentation.
In the process, fix departures from our coding standards.
In some cases, do minor other cleanups such as changing argument orders
to be friendly to state variables.
There are no algorithmic changes.
Estimated hours taken: 0.5
Branches: main
Minor cleanups for mmc --make. There are no algorithmic
changes.
compiler/make.m:
compiler/make.dependencies.m:
compiler/make.module_dep_file.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/process_util.m:
Bring these modules into line with our current coding
standard.
Estimated hours taken: 4
Branches: main
compiler/*.m:
Change a bunch of modules to import only one module per line, even
from the library.
compiler/mlds_to_il.m:
compiler/mlds_to_managed.m:
Convert these modules to our current coding style. Use state variables
where appropriate. Use predmode declarations where possible.
Estimated hours taken: 8
Branches: main
This is a cleanup diff; there are no changes in algorithms.
compiler/delay_info.m:
compiler/instmap.m:
compiler/inst_match.m:
compiler/inst_util.m:
compiler/make.module_target.m:
compiler/mode_errors.m:
compiler/modes.m:
compiler/mode_util.m:
compiler/process_util.m:
compiler/prog_io_goal.m:
compiler/prog_io.m:
compiler/prog_io_pragma.m:
compiler/prog_io_typeclass.m:
compiler/recompilation.check.m:
compiler/recompilation.m:
compiler/recompilation.usage.m:
compiler/recompilation.version.m:
compiler/unique_modes.m:
Bring these modules up to date with our current style guidelines.
Switch to predmode syntax and state variable notation where
appropriate. Switch argument orders where this makes it possible
to use state variable notation. Use the svmap and svset modules
where appropriate. Fix inconsistent indentation; in some places,
fix inconsistent placement of comments.
compiler/passes_aux.m:
compiler/modecheck_unify.m:
compiler/mercury_compile.m:
compiler/post_typecheck.m:
compiler/prog_io_dcg.m:
compiler/mode_ordering.m:
compiler/inst_graph.m:
compiler/polymorphism.m:
compiler/prog_io_util.m:
compiler/mode_debug.m:
compiler/mode_robdd.check.m:
compiler/transform.m:
Minor changes to conform to the changed argument orders of some
predicates in the cleaned up modules. Also, some minor cleanups.
Estimated hours taken: 12
Branches: main
Remove almost all dependencies by the modules of parse_tree.m on the modules
of hlds.m. The only such dependencies remaining now are on type_util.m.
compiler/hlds_data.m:
compiler/prog_data.m:
Move the cons_id type from hlds_data to prog_data, since several parts
of the parse tree data structure depend on it (particularly insts).
Remove the need to import HLDS modules in prog_data.m by making the
cons_ids that refer to procedure ids refer to them via a new type
that contains shrouded pred_ids and proc_ids. Since pred_ids and
proc_ids are abstract types in hlds_data, add predicates to hlds_data
to shroud and unshroud them.
Also move some other types, e.g. mode_id and class_id, from hlds_data
to prog_data.
compiler/hlds_data.m:
compiler/prog_util.m:
Move predicates for manipulating cons_ids from hlds_data to prog_util.
compiler/inst.m:
compiler/prog_data.m:
Move the contents of inst.m to prog_data.m, since that is where it
belongs, and since doing so eliminates a circular dependency.
The separation doesn't serve any purpose any more, since we don't
need to import hlds_data.m anymore to get access to the cons_id type.
compiler/mode_util.m:
compiler/prog_mode.m:
compiler/parse_tree.m:
Move the predicates in mode_util that don't depend on the HLDS to a new
module prog_mode, which is part of parse_tree.m.
compiler/notes/compiler_design.m:
Mention prog_mode.m, and delete the mention of inst.m.
compiler/mercury_to_mercury.m:
compiler/hlds_out.m:
Move the predicates that depend on HLDS out of mercury_to_mercury.m
to hlds_out.m. Export from mercury_to_mercury.m the predicates needed
by the moved predicates.
compiler/hlds_out.m:
compiler/prog_out.m:
Move predicates for printing parts of the parse tree out of hlds_out.m
to prog_out.m, since mercury_to_mercury.m needs to use them.
compiler/purity.m:
compiler/prog_out.m:
Move predicates for printing purities from purity.m, which is part
of check_hlds.m, to prog_out.m, since mercury_to_mercury.m needs to use
them.
compiler/passes_aux.m:
compiler/prog_out.m:
Move some utility predicates (e.g. for printing progress messages) from
passes_aux.m to prog_out.m, since some predicates in submodules of
parse_tree.m need to use them.
compiler/foreign.m:
compiler/prog_data.m:
Move some types from foreign.m to prog_data.m to allow the elimination
of some dependencies on foreign.m from submodules of parse_tree.m.
compiler/*.m:
Conform to the changes above, mostly by updating lists of imported
modules and module qualifications. In some cases, also do some local
cleanups such as converting predicate declarations to predmode syntax
and fixing white space.
Estimated hours taken: 50
Branches: main
Remove Unix dependencies in the compiler.
Avoid calling passes_aux.invoke_shell_command, which
requires the presence of a Unix shell.
The implementation of fact tables still has dependencies
on Unix utilities (e.g. sort).
aclocal.m4:
Don't pass Unix style paths to MSVC.
configure.in:
Use `cygpath -m' rather than `cygpath -w'.
`cygpath -m' uses '/' as the directory separator,
so it doesn't cause quoting problems in shell
scripts.
Apply $CYGPATH to $PREFIX, $LIBDIR, $CONFIG_PREFIX
and $CONFIG_LIBDIR.
Don't pass `-lm' when linking with MSVC.
configure.in:
compiler/options.m:
scripts/Mercury.config.in:
Add extra configuration options to deal with differences
between linking with gcc and MSVC:
--linker-opt-separator
--linker-link-lib-flag
--linker-link-lib-suffix
--shlib-linker-link-lib-flag
--shlib-linker-link-lib-suffix
--linker-path-flag
NEWS:
doc/user_guide.texi:
compiler/options.m:
compiler/compile_target_code.m:
compiler/make.program_target.m:
Instead of substituting in an arbitrary shell script when
processing `--pre-link-command' and `--extra-init-command',
require that these options specify a command which will
be passed the name of the source file containing the main
module as the first argument, with the source files containing
the remaining modules following. This is simpler and avoids
dependencies on a shell.
Fix quote_arg to handle Windows paths better.
compiler/handle_options.m:
Don't attempt to use symlinks if they're not available.
compiler/compile_target_code.m:
Be more careful about quoting.
Don't call invoke_shell_command where invoke_system_command
would do.
Allow linking using MSVC.
compiler/modules.m:
Remove make_directory, which is now implemented by dir.m.
Use io.make_symlink rather than shell scripts.
Implement mercury_update_interface in Mercury.
compiler/llds_out.m:
compiler/make.program_target.m:
Use dir.make_directory, not modules.make_directory,
which has been removed.
compiler/make.module_target.m:
Invoke mercury_compiler directly, not through the
mmc script to avoid shell dependencies.
If we can't fork() child `mmc --make' processes,
pass the arguments to the child process using a
file to avoid overflowing system limits on Windows.
compiler/mercury_compile.m:
compiler/options_file.m:
Read argument files.
Handle backslash-newline in options files correctly.
compiler/passes_aux.m:
invoke_system_command shouldn't set the exit status --
the caller may be able to try something else.
compiler/process_util.m:
Export can_fork for use by make.module_target.m.
Remove hacks to work around bugs in the implementation
of zero-arity foreign procs.
compiler/prog_io.m:
Handle bizarre file names without aborting.
library/Mmakefile:
library/print_extra_inits:
Move code to find extra initialization functions into
print_extra_inits, due to the change to the handling
of the --extra-init-command option described above.
scripts/mmc.in:
Set the MERCURY_COMPILER environment variable if it is
not already set, so that the mercury_compile executable
knows where to find itself.
scripts/mercury.bat.in:
Make this actually work.
tools/bootcheck:
Set ANALYSIS_LIB_NAME.
Apply cygpath (-m not -w) to $root.
Link print_extra_inits into the stage2 and stage3
library directories.
util/mkinit.c:
Handle '\\' in path names.
Estimated hours taken: 2
Branches: main
compiler/*.m:
Import only one compiler module per line. Sort the blocks of imports.
This makes it easier to merge in changes.
In a couple of places, remove unnecessary imports.
Estimated hours taken: 0.1
Branches: main
compiler/process_util.m:
Fix an ISO C conformance error: C global variables need to be
declared as `extern' in the pragma foreign_decl, to avoid
multiple definition errors on some systems (e.g. with tcc)
if the foreign_decls get duplicated.
Estimated hours taken: 20
Branches: main
Various bug fixes for the `il' grade.
These get us closer to bootstrapping on .NET.
Mmake.workspace:
Set MERC_C_INCL_DIR and MERC_DLL_DIR, since these are needed
when building in grade `il'.
library/Mmakefile:
Fix the dependencies for `mercury.dll' to avoid relinking it
every time `mmake' gets invoked.
library/io.m:
- Implement io__rename_file in C#.
- Change io__file_modification_time so that on .NET it returns
an error rather than throwing an exception.
- Fix some bugs in the MC++ code for mercury_getchar():
- add a missing "break" statement
- update the line count correctly when reading a character
after it has been put back by io__putback_char.
- compute line numbers correctly even for text files formatted
differently than the environment expects, e.g. those that use
Unix-style bare LF rather than Windows-style CR-LF.
trace/Mmakefile:
Ensure that in `il' grade we don't build anything in this directory.
compiler/Mmakefile:
Conditionalize some dependencies that were bogus for the `il' grade.
Add a work-around for the lack of Mmake support for
`--transitive-intermodule-optimization'.
compiler/bytecode_data.m:
Provide Mercury clauses (that just call sorry/1) as an alternative
to C foreign_proc code for `float_to_float64_bytes'.
compiler/process_util.m:
Fix a mode error and a missing import that only showed up in `il'
grade, since they occured in Mercury clauses which are only used
on back-ends which don't support the C interface.
Estimated hours taken: 0.5
Branches: main, release
compiler/process_util.m:
Avoid possible misaligned memory accesses by using
`:- pragma foreign_type' for the signal_action type
instead of c_pointer. It's now up to the compiler
and runtime to get the alignment correct.
Estimated hours taken: 1.5
Branches: main, release
Fix bugs in the handling of signals with `mmc --make'.
compiler/process_util.m:
Reset the signal handlers in the child to the defaults
so that SIGTERM is not ignored.
Don't infinitely loop if the child ignores SIGTERM.
runtime/mercury_signal.{c,h}:
Add a function MR_init_signal_action() which initializes a
MR_signal_action suitable for passing to MR_set_signal_action().
runtime/mercury_std.h:
Fix a #include in the wrong place which caused MR_is_eintr
to always fail.
Estimated hours taken: 1
Branches: main
Only refer to EINTR if it is defined.
runtime/mercury_std.h:
Add a macro MR_is_eintr which tests whether its
argument is EINTR, or returns false if EINTR
not undefined.
trace/mercury_trace_internal.c:
compiler/process_util.m:
Use MR_is_eintr.
Estimated hours taken: 12
Branches: main
Until now, programmers could add `tabled_for_io' annotations to foreign_procs
that do I/O, which asks the compiler to make those foreign_procs idempotent,
i.e. ensures that they are performed at most once even in the presence of a
retry operation in the debugger. This change adds a compiler option,
--trace-table-io-require, which generates an error if a foreign_proc that does
I/O does not have this annotation. Specifying this option thus ensures
that all I/O done by the program is idempotent.
In the future, we may want to have this option turned on in all debugging
grades. Until we decide about, the new option is not yet documented.
compiler/options.m:
Add the new option --trace-table-io-require.
compiler/handle_options.m:
Make --trace-table-io-require imply --trace-table-io.
compiler/table_gen.m:
If --trace-table-io-require is enabled, require all I/O primitives
to have the tabled_for_io annotation.
compiler/mercury_compile.m:
Pass I/O states to table_gen.m, since it can now generate error
messages.
trace/mercury_trace_util.h:
trace/mercury_trace_vars.c:
When calling Mercury code from the trace directory, disable I/O
tabling, since any I/O actions executed by Mercury code in the browser
directory (or by library code called from there) should not be tabled,
not being part of the user program.
Due to the depth of nesting, make mercury_trace_vars.c use four-space
indentation.
browser/collect_lib.m:
browser/declarative_debugger.m:
browser/declarative_execution.m:
browser/dl.m:
browser/io_action.m:
browser/mdb.m:
browser/name_mangle.m:
browser/util.m:
compiler/gcc.m:
compiler/mercury_compile.m:
compiler/passes_aux.m:
compiler/process_util.m:
compiler/stack_layout.m:
library/io.m:
library/time.m:
tests/debugger/declarative/tabled_read_decl.m:
Add a whole lot of tabled_for_io annotations, to enable the compiler to
bootstrap with --trace-table-io-require enabled.
In many cases, this required turning old-style pragma c_code into
pragma foreign_proc. While doing that, I standardized the layouts
of pragma foreign_procs.
browser/util.m:
Turn an impure semidet predicate into a pure det predicate with I/O
states, to allow it to be tabled. Make it return a Mercury bool
to indicate success or failure.
library/bool.m:
Add functions that allow C code to get their hands on the constants
`yes' and `no', for communication with Mercury code.
library/table_builtin.m:
Add debugging code to the main primitive of I/O tabling. This is
controlled both by the macro for retry debugging and a boolean global.
library/mercury_trace_base.[ch]:
Add the boolean global variable to switch the new debugging code in
table_builtin.m on and off.
library/mercury_trace_internal.c:
When starting I/O tabling with retry debug enabled, turn on the switch.
tests/debugger/queens.exp3:
New expected output file that applies when the library is compiled with
--trace-table-io-require.
The main aim of this change is to make the overall, high-level structure
of the compiler clearer, and to encourage better encapsulation of the
major components.
compiler/libs.m:
compiler/backend_libs.m:
compiler/parse_tree.m:
compiler/hlds.m:
compiler/check_hlds.m:
compiler/transform_hlds.m:
compiler/bytecode_backend.m:
compiler/aditi_backend.m:
compiler/ml_backend.m:
compiler/ll_backend.m:
compiler/top_level.m:
New files. One module for each of the major components of the
Mercury compiler. These modules contain (as separate sub-modules)
all the other modules in the Mercury compiler, except gcc.m and
mlds_to_gcc.m.
Mmakefile:
compiler/Mmakefile:
Handle the fact that the top-level module is now `top_level',
not `mercury_compile' (since `mercury_compile' is a sub-module
of `top_level').
compiler/Mmakefile:
Update settings of *FLAGS-<modulename> to use the appropriate
nested module names.
compiler/recompilation_check.m:
compiler/recompilation_version.m:
compiler/recompilation_usage.m:
compiler/recompilation.check.m:
compiler/recompilation.version.m:
compiler/recompilation.version.m:
Convert the `recompilation_*' modules into sub-modules of the
`recompilation' module.
compiler/*.m:
compiler/*.pp:
Module-qualify the module names in `:- module', `:- import_module',
and `:- use_module' declarations.
compiler/base_type_info.m:
compiler/base_type_layout.m:
Deleted these unused empty modules.
compiler/prog_data.m:
compiler/globals.m:
Move the `foreign_language' type from prog_data to globals.
compiler/mlds.m:
compiler/ml_util.m:
compiler/mlds_to_il.m:
Import `globals', for `foreign_language'.
Mmake.common.in:
trace/Mmakefile:
runtime/Mmakefile:
Rename the %.check.c targets as %.check_hdr.c,
to avoid conflicts with compiler/recompilation.check.c.
Estimated hours taken: 1.5
Branches: main
Rearrange some code after the `--make' change. This was not done
as part of that change for ease of reviewing.
compiler/mercury_compile.m:
compiler/compile_target_code.m:
compiler/make.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
Move code to compile the generated code into compile_target_code.m.
compiler/make.util.m:
compiler/passes_aux.m:
compiler/process_util.m:
Move process and signal handling functionality into process_util.m.
compiler/Mmakefile:
Compile process_util.c with `--no-ansi' so that the declarations
of `struct sigaction' and `kill' are available on Linux.
compiler/notes/compiler_design.html:
Document compile_target_code.m and process_util.m.
Move timestamp.m into the "Miscellaneous" section (it's
used by make as well as smart recompilation).
Fix the documentation of options_file.m.