Commit Graph

1687 Commits

Author SHA1 Message Date
Zoltan Somogyi
47fd3440d9 Move a section to its chronological position. 2025-08-31 13:38:26 +02:00
Julien Fischer
dfa8d2411c Fix a texinfo error.
docs/mercury_user_guide.texi:
   Replace an invalid item marker.
2025-08-31 00:57:39 +10:00
Zoltan Somogyi
f0ad6bb5c6 Fix typos. 2025-08-30 12:47:51 +02:00
Zoltan Somogyi
b8d5ea9d6c Finish first draft of intermodule opt section. 2025-08-29 19:34:50 +02:00
Peter Wang
9f66809257 Fix texinfo syntax. 2025-08-20 10:50:33 +10:00
Zoltan Somogyi
089be6d2d8 Address review comments. 2025-08-19 19:50:37 +02:00
Zoltan Somogyi
7834e905c8 Address review comments. 2025-08-18 18:38:28 +02:00
Zoltan Somogyi
95f3c64561 s/main-module/main_module/ 2025-08-16 00:32:09 +02:00
Zoltan Somogyi
ec0d8ca957 Fill in a large part of "compilation detail".
Minor improvements to the preceding chapters.
2025-08-16 00:30:10 +02:00
Zoltan Somogyi
42d93dbe2f Document the .par grade modifier.
Make minor improvements elsewhere in the user guide.
2025-08-15 16:07:43 +02:00
Zoltan Somogyi
33e3a3bf7b Don't install pdfs by default. 2025-08-11 22:42:00 +02:00
Zoltan Somogyi
c7f7bdebe3 Update the library manual's introduction. 2025-08-11 08:01:26 +02:00
Zoltan Somogyi
79f1b9473d Fix typos. 2025-08-11 07:59:38 +02:00
Zoltan Somogyi
ae28a625cc Use consistent file-names in the doc directory.
Previously, we used to build e.g. mercury_ref.info from reference_manual.texi.
We now use these base files names consistently, with all relevant extensions:

    mercury_reference_manual
    mercury_user_guide
    mercury_library_manual
    mercury_transition_guide
    mercury_faq

doc/mercury_reference_manual.texi:
doc/mercury_user_guide.texi:
doc/mercury_library_manual.texi:
doc/mercury_transition_guide.texi:
doc/mercury_faq.texi:
    Rename the original .texi files to the new names.

    Rename any pointers between manuals.

doc/update_opts:
    Delete this unused file, since there is no point in updating it
    to use the new file names.

doc/Mmakefile:
    Rename files in variable definitions, target lists, source lists, actions,
    and comments.

    Replace blocks of file-name-specific rules with a single generic rule
    where the uniformity of names makes this possible.

    Start builtin pdf files by default, since the motivation for this change
    is fixing an inconsistency between .html and .pdf versions of the same
    manual.

    Change the naming scheme of intermediate files to fit into the new pattern.

    Delete the new_opts target, which we do not need anymore.

    Delete references to library_toc and library_1, which we stopped building
    in 2003.

doc/mercury.html.in:
doc/mercury.info.in:
    Conform to the renames.
2025-08-11 07:48:11 +02:00
Zoltan Somogyi
15e7bbebe3 Document .target_debug and .pregen. 2025-08-10 14:09:18 +02:00
Zoltan Somogyi
32006a1c7c Rename and generalize .c_debug to .target_debug.
runtime/mercury_grade.h:
    Rename the grade modifier, and the C macro that represents it.

compiler/options.m:
    Rename the --c-debug-grade option to --target-debug-grade.

compiler/compute_grade.m:
    Rename the grade modifier, and the option that represents it.

    Restrict the .target_debut grade modifier to MLDS grades.

compiler/handle_options.m:
    Implement --target-debug-grade by having it imply --target-debug.

compiler/compile_target_code.m:
compiler/link_target_code.m:
    Pay attention to either --target-debug-grade (for purposes related
    to the grade itself) and to --target-debug (for all other purposes).

scripts/canonical_grade.in:
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
    Parse target_debug grade modifiers and --target-debug-grade options
    instead of c_debug grade modifiers and --c-debug-grade options.

    Add (normally commented-out) infrastructure to make it easier
    to debug changes.

    Restrict the .target_debut grade modifier to MLDS grades.

scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
    Rename some variables to clarify the distinction between the
    --target-debug option (which, like -g, enabled debugging of only one file)
    and the --target-debug-grade option (which enables it for the whole
    program).

configure.ac:
    Make it easier to debug grade-related changes by recording
    both autoconfigured and user-supplied grades that the rejected by
    the canonical_grade script.

    Conform to the changes above.

README.sanitizers:
doc/user_guide.texi:
grade_lib/grade_spec.m:
grade_lib/grade_string.m:
scripts/ml.in:
tests/warnings/help_text.err_exp:
tools/lmc.in:
tools/test_mercury:
    Conform to the changes above.

scripts/Mmake.vars.in:
    Add some XXXs about style.
2025-08-09 21:48:23 +02:00
Zoltan Somogyi
2489e2bd40 Avoid modeline comments in .pdf files. 2025-08-09 09:34:16 +02:00
Zoltan Somogyi
6586f6025a Address review comments.
Delete a long-obsolete XXX.
2025-08-08 10:48:41 +02:00
Zoltan Somogyi
966e464945 Fill in most of the Grade modifiers section. 2025-08-07 07:14:44 +02:00
Zoltan Somogyi
27829c6f87 Add a draft of most of the grades chapter. 2025-08-04 12:40:31 +02:00
Zoltan Somogyi
cabcea421d Address a review comment. 2025-08-03 15:08:06 +02:00
Zoltan Somogyi
f0d6530cec Fix typos. 2025-08-03 12:00:44 +02:00
Zoltan Somogyi
9eb506edc2 Move some existing chapters around. 2025-07-30 03:32:41 +02:00
Zoltan Somogyi
e2b472ec06 Start on the new structure of the user guide.
doc/user_guide.texi:
    Replace the "Using mmc" section, which tried to do too much,
    with an "Intro to mmc" section, which does a more thorough job
    of explaining some basics, but does not depend on concepts that
    are introduced only in later chapters.

    Start using @code and @command in the way we discussed on m-rev,
    though for now, only in the newly-written parts of the guide.

    Add chapter markers for the agreed-on chapters. Do not move
    existing text around as we also agreed; do that separately,
    to make reviewing this diff simpler.

    Document the new capability of mdb's dump command.

    Add a vim modeline.

    Replace tabs with spaces.

    Fix too-long lines where possible.
2025-07-27 12:30:08 +02:00
Zoltan Somogyi
cc5e0f5a55 Add vim mode lines, replace tabs with spaces. 2025-07-27 11:20:47 +02:00
Peter Wang
cae8c31abd Generate ug_invocation.texi using bootstrap compiler when cross-compiling.
doc/Mmakefile:
    Generate ug_invocation.texi using the bootstrap compiler when
    cross-compiling as we may not be able to run the mercury_compile
    executable.

doc/.gitignore:
    Ignore ug_invocation.texi and ug_invocation.texi_date.
2025-07-23 17:31:02 +10:00
Zoltan Somogyi
2b0813905d Fix grammar. 2025-07-21 19:29:00 +02:00
Julien Fischer
f77bb993ca Do not use .exe extension with ug_invocation depdendencies.
doc/Mmakefile:
    As above. Add a comment explaining why this works.
2025-07-21 22:09:47 +10:00
Julien Fischer
1b73644571 Fix source distribution builds.
Mmakefile:
docs/Mmakefile:
    When building the source distribution, generate ug_invocation.texi
    using the bootstrap Mercury compiler since the building the source
    distribution does not create a mercury_compile executable.
2025-07-21 00:21:15 +10:00
Zoltan Somogyi
7ed966ebbf Keep the invocation chapter always up-to-date.
doc/user_guide.texi:
    Replace the invocation chapter part of this file with a @include
    of a new file, ug_invocation.texi, which contains the output of
    "mmc --help-texinfo".

doc/Mmakefile:
    Make user_guide.texi_pp dependent on ug_invocation.texi.
    Do not force the rebuilding of the info/pdf/etc versions
    of the user guide if, when we check whether ug_invocation.texi
    is still current, we find that it is.
2025-07-19 15:11:39 +02:00
Zoltan Somogyi
7694d0a6a2 Improve the description of @file args. 2025-07-16 17:22:41 +02:00
Julien Fischer
1174434d35 Fix spelling.
docs/user_guide.texi:
    As above.
2025-07-15 22:20:35 +10:00
Zoltan Somogyi
d8a89fc43c Document .obj files. 2025-07-15 12:35:47 +02:00
Zoltan Somogyi
03132d92bf Point out that --use-subdirs in the default with --make. 2025-07-15 12:06:34 +02:00
Zoltan Somogyi
b6acb48875 Fix typos. 2025-07-15 11:59:06 +02:00
Zoltan Somogyi
12814f45e0 Format "e.g." for texinfo.
compiler/print_help.m:
    Replace all occurrences of "e.g." in generated texinfo with
    "e.g.@:", which apparently generates better looking output.

doc/user_guide.texi:
    Expect the changes.

library/string.m:
    Add a new version of an existing predicate to help with the above.

NEWS.md:
    Announce the new predicate.
2025-07-15 00:20:51 +02:00
Zoltan Somogyi
6c916ad9be Update the user guide's "file naming conventions" chapter.
Comment out the documentation of .lpic_o files, since we have
not supported them since 2016.

Document .int* files a bit better.

Document the role of .mh and .mih files.

Use both headings and itemize scopes to make it easier to see
where each file extension is documented.

Move index entries to just before the text they apply to.
2025-07-14 22:54:09 +02:00
Zoltan Somogyi
dc73319765 Merge oc_verb_dev and oc_verb_dbg ...
compiler/option_categories.m:
compiler/print_help.m:
compiler/options.m:
    ... name the result oc_dev_verb, and move it to the developer section.

    Also, make --implicit-parallelism and --feedback-file private.
    They are still for developers only.

doc/user_guide.texi:
tests/warnings/help_text.err_exp:
    Expect the updated help text.
2025-07-12 17:11:55 +02:00
Zoltan Somogyi
7fb78a9ea8 Add an intermodule optimization section to help text.
compiler/print_help.m:
compiler/option_categories.m:
    Add an intermodule optimization category with three subcategories:
    non-transitive intermodule optimization, transitive intermodule
    optimization, and the not-yet-public latex-model system.

compiler/options.m:
    Reclassify and reorder options accordingly.

doc/user_guide.texi:
tests/warnings/help_text.err_exp:
    Expect the new categorization.
2025-07-12 16:07:01 +02:00
Zoltan Somogyi
f71f453c6a Split oc_analysis into three subsections.
compiler/option_categories.m:
compiler/print_help.m:
compiler/options.m:
    As above.

doc/user_guide.texi:
tests/warnings/help_text.err_exp:
    Expect the subsections.
2025-07-12 00:07:43 +02:00
Zoltan Somogyi
ae820da5b1 Delete the --inline-linear-tail-rec-sccs option ...
... including the --inline-linear-tail-rec-sccs-max-extra option
that was its parameter.

This option was added as a quick-and-dirty workaround before we taught
the MLDS backend how to implement tail recursion for mutually recursive
predicates, and has not been needed since that capability has proven itself.

compiler/options.m:
    Delete both options from the option table.

tools/make_optimization_options_db:
    Delete both options from the opt_tuple.

compiler/inlining.m:
    Delete the implementation of this option.

compiler/mercury_compile_middle_passes.m:
compiler/optimization_options.m:
doc/user_guide.texi:
    Conform to the changes above.
2025-07-10 01:05:04 +02:00
Zoltan Somogyi
7c296404bb Add "Opt level N automatically sets --xyz" ...
... to the user guide entries of the affected optimization options.

compiler/print_help.m:
    Implement the above.

doc/user_guide.texi:
    Expect the additions, both from this diff, and earlier ones.

tools/make_optimization_options_middle:
compiler/optimization_options.m:
    To make the above slightly simpler to implement, add a subtype
    of the option_data type, and change the type of the predicate
    that returns the options enabled at each optimization level
    to use this subtype.

configure.ac:
    Require the installed compiler to support the fix without which
    the subtype definition would make the automatically-generated
    contents of libs.optimization_options.int2 invalid.
2025-07-08 16:38:08 +02:00
Zoltan Somogyi
51b1304b0d Record the initial values of the bool_special options ...
... which are managed by tools/make_optimization_options.

tools/make_optimization_options_middle:
    When creating compiler/optimization_options.m, put into it
    a new predicate that records, for each bool_special option
    managed by this module, its initial value.

compiler/print_help.m:
    Handle bool_special options whose initial value this new predicate
    makes known the same way we now handle plain bool options.
    The difference this makes is that bool_special options that
    default to "yes" will now have their --no-xyz form listed as
    the user-visible form of the option, not their --xyz form.

tools/make_optimization_options_db:
tools/make_optimization_options_end:
    Fix a discrepancy that made documenting the smart indexing
    unnecessarily complicated. The first such option defaulted to "no",
    but was switched to "yes" at -O0, while the others all defaulted
    to "yes". Allow these options to be documented in the same manner
    by making them *all* default to "no", and switch them all on at -O0.

compiler/optimization_options.m:
    Rebuilt with the updated make_optimization_options.

compiler/options.m:
    Many of the bool_special options that default to "yes" had
    help text that already assumed that this text followed
    the option name being printed as --no-xyz.

    For the others, which assumed that they followed --xyz,
    change the help text to be appropriate when following
    the --no-xyz form.

tests/warnings/help_text.err_exp:
    Expect the updated help texts.

doc/user_guide.texi:
    Expect the updated help texts, from this and earlier commits.

tests/warnings/help_opt_level.err_exp:
    Expect the added level-enabled options.
2025-07-07 13:19:35 +02:00
Zoltan Somogyi
cc37cbd2b2 Make automatic texinfo documentation of options work.
Include the now-automatically-generated texinfo as the body
of the Invocation chapter of the user's guide. The resulting
guide is still not final, but it already fixes the previous absence
of several options' documentation from the invocation chapter.

compiler/optdb_help.m:
    Provide ways to give different aligned texts to print_help.m
    when it generates plain help text than when generating texinfo.
    We need this because we want to add markup to the texinfo version.

    Provide ways to add index entries to help texts. This is needed
    only when creating texinfo output.

    Add some more kinds of help_pieces, which provide previously
    unavailable combination of what we generate for help text vs
    what we generate for texinfo.

    Either delete obsolete documentation, or replace it
    with current documentation.

compiler/print_help.m:
    Redo the handling of index entries, mainly driven by the need
    to handle both default-on and default-off boolean options
    appropriately.

    Do not generate subsection headings for fully-commented-out subsections.

    Sort the output by option, not first on option category
    and then on option.

compiler/options.m:
    Check that the texinfo we now generate from optdb records
    with --help-texinfo is at least as informative as the entry
    for the relevant option in the old invocation chapter.
    Fix cases where it wasn't.

    Add index entries as they occurred in the old invocation chapter,
    except where I think they are either inappropriate or just not needed
    (usually due to the same index entry on the previous option).

    Add cross references that existed in the old invocation chapter.

    Improve a whole bunch of help texts where I felt the need
    during all the above changes.

    In some cases, just add XXXs calling for future changes.

    In one case, add a non-abbreviated version of an option's old,
    abbreviated-only "long" name.

    Pick "directory", "filename" and "N" as the respective standard
    argument names in their domains.

    Put some options into a new order for greater readability.

doc/Mmakefile:
doc/update_opts:
    For simpliciy and easier control over quotations and errors,
    move all the work of including the output of mmc --help-texinfo
    as the invocation chapter in the user's guide from the Mmakefile
    to the update_opts script.

doc/user_guide.texi:
    Replace the invocation chapter.

    Update all dangling references to that chapter to point to
    the new section or subsection that they want to refer to.

    Add a now-ignored block that can later become a chapter on grades.

tests/warnings/help_text.err_exp:
tests/warnings/help_opt_levels.err_exp:
    Conform to the changes above.
2025-07-06 19:18:29 +02:00
Zoltan Somogyi
874cf2598c Make the documentation of smart recompilation private.
compiler/options.m:
doc/user_guide.texi:
    As above.

tests/warnings/help_text.err_exp:
    Expect the updated help text.

compiler/print_help.m:
    Fix typo.
2025-07-05 16:31:20 +02:00
Zoltan Somogyi
2ef8b3d13f Implement (mostly) mmc --help-texinfo.
compiler/print_help.m:
    Implement mmc --help-texinfo for real by generating near-final texinfo
    output when asked to.

    Move some utility operations to the end of the file.

doc/update_opts:
    A script to replace the bulk of the invocation chapter of the
    User's Guide with the output of mmc --help-texinfo.

doc/Mmakefile:
    Add a new target, intended to be invoked manually, to both
    invoke update_opts, and to show the user its effect.

compiler/options.m:
    Fix a link and some texinfo format bugs.

tests/warnings/help_text.err_exp:
    Expect the fixed link.
2025-07-03 20:25:59 +02:00
Zoltan Somogyi
be72289826 Mark references about to become dangling. 2025-07-03 17:39:43 +02:00
Zoltan Somogyi
5f3ee8b42c Delete stray references to Erlang. 2025-07-03 17:28:50 +02:00
Zoltan Somogyi
35bcd211ad Prepare the user_guide for mmc --help-texinfo. 2025-07-03 17:17:40 +02:00
Zoltan Somogyi
6eb63e3a31 Update the invocation overview section in the user's guide.
doc/user_guide.texi:
    Delete references to __ as module name separator.

    Explain the role of Mercury.options.

    Move an index entry to the description that the entry refers to.
2025-07-03 14:41:24 +02:00