mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
This option lets the user provide a file containing information to
remove some edges from the trans-opt dependency graph, i.e. the graph
used to determine which .trans_opt files to read when making a module's
own .trans_opt file.
The reason to remove edges from the graph is to break dependency cycles.
.trans_opt files for modules within an SCC have to be made one after
another, instead of in parallel. For example, the standard library
contains one large SCC due to circular imports, so making .trans_opt
files turns out to be a bottleneck when building the standard library
(on a machine with sufficient parallelism available).
Furthermore, the user had no control over which modules in an SCC
could read the .trans_opt files of other modules in the same SCC.
If a and b happened to import each other, the compiler would always
break the cycle by allowing a to read b.trans_opt, but not allow b to
read a.trans_opt, simply based on module names. The new option lets the
user break the cycle in a way that may improve analysis results.
compiler/options.m:
Add the --trans-opt-deps-spec option.
compiler/generate_dep_d_files.m:
If the option --trans-opt-deps-spec FILE is used, use the
information given in the file to remove some edges from the
trans-opt dependency graph.
If --generate-module-order is passed, also output the module order
computed from the trans-opt dependency graph to a file.
Users may find this a useful starting point when writing their own
spec file.
compiler/write_deps_file.m:
Add a field to intermod_deps to hold the (user-adjusted)
trans-opt dependencies.
Add a type, maybe_include_trans_opt_rule, to indicate whether or not
to include a trans_opt_deps rule in a mmake dependency file.
Separate the case when a trans_opt_deps rule is to be written,
indicating where the dependencies come from.
When automatically rewriting a .d file after producing target code,
etc., write the trans_opt_deps rule with the same list of dependencies
as the old .d file.
compiler/mercury_compile_make_hlds.m:
Conform to maybe_include_trans_opt_rule change.
Rename some variables for clarity.
This directory contains the source for The Mercury user's guide The Mercury language reference manual The Mercury library reference manual The Prolog to Mercury transition guide The Mercury frequently asked questions list The master copy of each document is stored in texinfo format, from which the info, dvi and html versions are derived automatically. You can create postscript versions from either the dvi or html versions. Due to the large spacing in texinfo-generated dvi files, the postscript file generated from the html (manually via a browser such as xmosaic) will be considerably shorter than the one derived from the dvi file. The source for the Mercury library reference manual is generated automatically from the library source files themselves.