Commit Graph

35 Commits

Author SHA1 Message Date
Zoltan Somogyi
05ef8e01fb Rename the .ll_debug grade component to .c_debug.
Rename mmc and mgnuc options that set this grade component to --c-debug-grade.
Let the options named --c-debug of both mmc and mgnuc enable C level debugging
of only the module being compiled.

runtime/mercury_grade.h:
    Rename the .ll_debug grade component to .c_debug. Also rename the C macro
    that controls the presence or absence of this grade component
    from MR_LL_DEBUG to MR_C_DEBUG_GRADE.

runtime/mercury_conf_param.h:
runtime/mercury_debug.c:
runtime/mercury_debug.h:
runtime/mercury_engine.c:
runtime/mercury_label.c:
runtime/mercury_memory_zones.c:
runtime/mercury_memory_zones.h:
runtime/mercury_overflow.c:
runtime/mercury_std.h:
runtime/mercury_wrapper.c:
    Rename the MR_LOWLEVEL_DEBUG macro to MR_DEBUG_THE_RUNTIME.
    Previously, the name of this macro wrongly implied that it had
    something to do with the old .ll_debug grade component, even though

    - the MR_LOWLEVEL_DEBUG macro was designed to debug LLDS grades,
      since only these existed when it was created, while

    - the .ll_debug grade component (now .c_debug) is useful only for
      MLDS grades targeting C.

compiler/options.m:
    Rename the old confusingly named low_level_debug option to c_debug_grade.
    Move it to the list of grade options, and fix its documentation, which
    was completely wrong:

    - code in compile_target_code.m treated it as being a synonym of
      the .ll_debug (now .c_debug) grade component, while
    - its (commented out) documentation here in options.m said it called for
      the enabling of what is now MR_DEBUG_THE_RUNTIME.

compiler/compile_target_code.m:
    Conform to the rename just above.

    Define MR_C_DEBUG_GRADE instead of MR_LL_DEBUG if c_debug_grade is enabled.

    Pass -g to the C compiler if either c_debug_grade or target_debug
    is enabled.

    Add an XXX about a missing safety check for an obsolete experimental
    feature.

compiler/compute_grade.m:
    When given a grade with a .c_debug grade component, set only the
    c_debug_grade option; don't set the target_debug option, which is NOT
    a grade option. The change to compile_target_code.m above handles the
    only situation in which this implication was formerly required.

scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
    Look for and process the .c_debug grade component instead of .ll_debug.
    Use a sh variable named c_debug_grade to record its absence/presence.

    Look for and process the --c-debug-grade grade-component option,
    setting the same sh variable, c_debug_grade. (All grade components
    can be set piecemeal using sh options to the scripts using these
    subroutines.) This replaces the old, confusingly named option
    --low-level-debug.

scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
    Consistently use the sh variable c_debug to record the presence of
    the (non-grade) --c-debug option to mgnuc, and the sh variable
    c_debug_grade to record the presence of the .c_debug grade component.

    Stop looking for and handling the --low-level-debug option, which
    mgnuc used to document, even though this duplicated the same documentation
    in init_grade_options.sh-subr, which mgnuc includes. The difference was
    that init_grade_options.sh-subr meant it to represent the old .ll_debug
    MLDS grade component, while mgnuc treated it as specifying what is now
    MR_DEBUG_THE_RUNTIME for LLDS grades. It didn't help that two sh variables
    with quite different semantics had names that differed only in an
    underscore: LLDEBUG_OPTS vs LL_DEBUG_OPTS.

scripts/Mmakefile:
    Add a missing dependency to force the rebuild of mgnuc after each update
    of its sh subroutine mgnuc_file_ops.sh-subr.

doc/user_guide.texi:
    Document the --c-debug-grade option of mmc. This option was not publicly
    documented under its original misleading name (--low-level-debug), but
    its documentation is now possible without contorted dancing around the
    name.

    Clarify the documentation of mgnuc's --c-debug option.

README.sanitizers:
configure.ac:
    Conform to the rename of the grade component.

grade_lib/grade_spec.m:
grade_lib/grade_string.m:
grade_lib/grade_structure.m:
grade_lib/try_all_grade_structs.m:
    Conform to the rename of the grade component .ll_debug to .c_debug.

    Don't allow the .c_debug grade component in LLDS grades.

    In grade_string.m, add some obvious implications of some grade components.

grade_lib/choose_grade.m:
grade_lib/grade_lib.m:
grade_lib/test_grades.m:
grade_lib/var_value_names.m:
    Fix white space.

scripts/ml.in:
tools/lmc.in:
tools/test_mercury:
    Conform to the change in compile_target_code.m to the naming of
    Boehm gc library variants.
2022-12-29 20:33:08 +11:00
Julien Fischer
105580a765 Delete the trseg component and --trail-segments option.
Trail segments have been the default in trailing grades since Mercury 20.06.
Delete the trseg grade components and --trail-segment option since apart from
acting as synonyms for the tr component and --use-trail option repsectively,
they no longer do anything.

compiler/compute_grade.m:
compiler/handle_options.m:
compiler/options.m:
doc/user_guide.texi:
grade_lib/grade_vars.m:
scripts/parse_grade_option.sh-subr:
grade_lib/grade_string.m:
grade_lib/grade_vars.m:
   Delete the trseg grade component and --trail-segments option.

compiler/add_pragma.m:
   Update the wording of an error message.

NEWS:
   Announce the above.

extras/trail/Mercury.options:
extras/trailed_update/Mmakefile:
extras/references/Mercury.options:
tests/invalid/test_feature_set.err_exp:
    Conform to the above changes
2022-04-05 17:02:40 +10:00
Zoltan Somogyi
d2aa2d78e8 Delete references to Erlang in grade_lib. 2020-10-28 13:38:11 +11:00
Zoltan Somogyi
3e894a7a9d Remove the hl grade component.
As we discussed, it has fallen into disuse. Its main purpose was to
pave the way for the .net backend and later for the java and csharp grades.
Now that the .net backend is ancient history and the java and csharp grades
are established, that purpose is gone, and for every other purpose,
hlc is better because it is simpler and faster.

compiler/options.m:
    Delete the --high-level-data option. It is no longer needed,
    bacause the data representation scheme is now a direct function
    of the target language.

doc/user_guide.texi:
    Delete references to the --high-level-data option.

NEWS:
    Mention that --high-level-data is no longer supported.

compiler/compute_grade.m:
    Delete references to the hl grade component, and conform
    to the deletion of the --high-level-data option.

compiler/compile_target_code.m:
    Give some predicates more meaningful names, and conform to the
    deletion of the --high-level-data option.

compiler/const_struct.m:
compiler/du_type_layout.m:
compiler/globals.m:
compiler/handle_options.m:
compiler/lco.m:
compiler/mercury_compile_main.m:
compiler/ml_gen_info.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen_construct.m:
compiler/mlds_to_c_data.m:
compiler/mlds_to_c_func.m:
compiler/mlds_to_c_type.m:
compiler/mlds_to_c_util.m:
    Conform to the deletion of the --high-level-data option.

grade_lib/grade_spec.m:
grade_lib/grade_vars.m:
    Delete the datarep solver variable, since the data representation
    is now a direct function of the target language.

    Delete the requirements involving the deleted solver variable.

grade_lib/grade_structure.m:
    Delete the datarep component of the representation of MLDS C grades,
    since its value would now be fixed.

grade_lib/grade_solver.m:
grade_lib/grade_string.m:
grade_lib/try_all_grade_structs.m:
grade_lib/var_value_names.m:
    Conform to the changes above.

grade_lib/Mmakefile:
    Link the grade library's test programs statically, like we do
    the executables in the other directories.

library/io.m:
library/robdd.m:
library/rtti_implementation.m:
runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
runtime/mercury_hlc_types.h:
    Remove references to MR_HIGHLEVEL_DATA, as well as any code
    that was guarded by #ifdef MR_HIGHLEVEL_DATA.

scripts/Mmake.vars.in:
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
scripts/mmake.in:
scripts/mmc.in:
scripts/mtc:
scripts/parse_grade_options.sh-subr:
scripts/parse_ml_options.sh-subr.in:
    Remove references to --high-level-data options.

    In canonical_grade.sh-subr, compute the base grade more directly.

    Remove a few left-over references to the assembler backend.

    Add or fix vim modelines where relevant.

    Fix inconsistent indentation.

    Add missing ;;s in case statements.

    Switch to using ${var} references instead of just $var.

tests/invalid/Mercury.options:
    Make the test_feature_set test case run in grade java instead of hl.gc.

tests/invalid/test_feature_set.err_exp:
    Update the expected out for the grade change.
2020-04-11 19:30:58 +10:00
Julien Fischer
f60caca91c Use trail segments by default in trailing grades.
Until now, we have supported two variants of trailing grades, those that use a
fixed-size trail (.tr) and those that use trail segments (.trseg).  This change
removes support for fixed sized trails, and renames the .trseg grade component
to .tr. The .trseg grade now acts a synonym for .tr; it is deprecated, since we
intend to eventually delete it.  Until then, the behavior of the old .tr grade
component should be available, though to developers only, by compiling the
whole system with EXTRA_CFLAGS = -DMR_USE_FIXED_SIZE_TRAIL.

runtime/mercury_conf_param.h:
    Delete the MR_TRAIL_SEGMENTS macro. Its effect is now implied by
    MR_USE_TRAIL, unless a new macro, MR_USE_FIXED_SIZE_TRAIL, is defined.
    Developers can use this new macro to disable trail segments, should the
    need for doing that arise.

runtime/mercury_grade.h:
    Add a new macro that defines a binary compatibility version number for
    trailing; use that in the grade part for trailing.

    Use "_trfix" or "_trseg" as the prefix of the trailing part of the
    MR_GRADE_VAR depending on if MR_USE_FIXED_SIZE_TRAIL is defined or
    not.

runtime/mercury_trail.[ch]:
runtime/mercury_context.h:
    Enable trail segments by default, only disabling them if
    MR_USE_FIXED_SIZE_TRAIL is enabled.

runtime/mercury_wrapper.c:
trace/mercury_trace_cmd_developer.c:
    Conform to the above changes.

compiler/compile_target_code.m:
    Do not pass options for trail segments to the C compiler.

compiler/compute_grade.m:
    Treat trseg as a synonym for tr.

compiler/options.m:
    Deprecate --trail-segments.

grade_lib/grade_spec.m:
grade_lib/grade_string.m:
grade_lib/grade_structure.m:
grade_lib/grade_vars.m:
grade_lib/try_all_grade_structs.m:
grade_lib/var_value_names.m:
    Remove the trseg component.

scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
    Remove support for the --trail-segments option.

doc/user_guide.texi:
    Update the documentation for the --trail-segments.

    Comment out the documentation of the --trail-size and --trail-size-kwords
    runtime options; they are no longer useful to non-developers.

NEWS:
    Announce this change.
2020-02-18 13:07:24 +11:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Julien Fischer
65e71a5417 Update grade library.
grade_lib/*.m:
    Conform to the removal of the hl_nest and hlc_nest components.
2018-01-26 10:01:22 -05:00
Zoltan Somogyi
865130df0f Support only the handful of pregen grades we agreed on. 2016-04-25 01:31:29 +10:00
Zoltan Somogyi
dc11f11259 Use one 6-way solver var for use of all three gcc features. 2016-04-25 00:22:59 +10:00
Zoltan Somogyi
3daab514a3 Make most of the changes discussed on m-rev. 2016-04-24 23:34:07 +10:00
Zoltan Somogyi
701103e607 Update the rules around gc.
Record that a grade can specify accurate gc for llds grades, but
since accurate gc does not currently work for either llds or mlds grades,
put it behind the working kinds of gc. Record that "no gc" is not allowed
in minimal model grades.
2016-04-18 22:47:56 +10:00
Zoltan Somogyi
587d593d7f Document the modules of the grade library. 2016-04-01 20:41:09 +11:00
Zoltan Somogyi
3e2247125d Don't override grade component separators. 2016-04-01 06:41:56 +11:00
Zoltan Somogyi
c043699b60 Put the modules of the grade library into a package. 2016-04-01 01:36:25 +11:00
Zoltan Somogyi
2cf202fe60 Get the grade library production-ready.
grade_lib/try_all_grade_structs.m:
    A new program which checks whether all possible ways of filling out
    a grade structure are valid. It does this by generating all possible
    values of the grade_structure type, and checking, for each value,
    whether

    - converting it to a grade string,
    - converting the grade string to a grade specification,
    - solving that specification, and
    - converting the solution (if any) back to a grade structure

    yields the exact same grade structure that we started with.

    Besides testing whether the grade structure type is "tight" in the
    sense of being unable to express invalid grades, this round-trip test
    also stress-tests all the parts of the grade library except those
    that explain the inconsistencies in invalid grade specifications.

    Most of the changes to the other files are fixes to problems revealed
    by this testing.

grade_lib/Mmakefile:
    Add the new program as an executable to build.

grade_lib/grade_structure.m:
    Tighten up the grade structure type by encoding in types the
    incompatibility of minimal model tabling with trailing, thread safety
    performance profiling, and the history gc.

grade_lib/grade_spec.m:
    Loosen a restriction: minimal model tabling is compatible with no gc
    at all.

    Loosen a restriction: history gc works on the LLDS backend (in the
    absence of minimal model tabling, at least).

    The original specs reflected the proposed new defaults for gc and stack
    segments (boehm gc and yes, respectively), but the round-trip test
    requires the defaults of the current spec (no gc and no stack segments).
    Make the specification version to be used in constraint solving selectable.

grade_lib/choose_grade.m:
grade_lib/grade_setup.m:
grade_lib/grade_string.m:
grade_lib/test_grades.m:
    Conform to the changes above.
2016-03-31 21:11:43 +11:00
Zoltan Somogyi
161da8091a Encode .pregen in the grade structure. 2016-03-30 02:56:50 +11:00
Zoltan Somogyi
d552894cd0 Include version numbers in link check grade strings. 2016-03-25 21:11:45 +11:00
Zoltan Somogyi
a9acf2cf65 Handle the _ubf link-check grade component. 2016-03-18 04:38:09 +11:00
Zoltan Somogyi
6129362848 Express the "trail and minimal model don't mix" invariant in types. 2016-03-16 01:05:32 +11:00
Zoltan Somogyi
ddcb88c342 Add code to test solving for installed grades. 2016-03-02 18:17:27 +11:00
Zoltan Somogyi
ce475401ff Count applications of tests on requirements. 2016-02-27 06:00:53 +11:00
Zoltan Somogyi
57316b9aa9 Separate the LLDS and Erlang data representations. 2016-02-27 05:38:52 +11:00
Zoltan Somogyi
5ad3d64515 Improve the structure of the grade library. 2016-02-26 05:21:09 +11:00
Zoltan Somogyi
b156e6d454 Implement yesterday's m-dev decisions. 2016-02-25 12:10:31 +11:00
Zoltan Somogyi
1c0e07f8f2 Handle the remaining forms of minimal model tabling. 2016-02-23 06:53:33 +11:00
Zoltan Somogyi
fe4f77a9a5 Add a mechanism to interpret grade strings. 2016-02-23 06:10:58 +11:00
Zoltan Somogyi
6c8b48cba4 Make some code more orthogonal. 2016-02-22 23:26:56 +11:00
Zoltan Somogyi
fde6d8d29e Separate out grade_components.m. 2016-02-22 23:12:04 +11:00
Zoltan Somogyi
4ed1c9cbff Handle ssdebug grades. 2016-02-21 13:00:42 +11:00
Zoltan Somogyi
967227d34f Handle .exts. 2016-02-18 00:13:51 +11:00
Zoltan Somogyi
149cfa732a Handle the .ll_debug and .rbmm* grade components. 2016-02-17 21:51:39 +11:00
Zoltan Somogyi
deac75169b Generate grade strings via the grade structure. 2016-02-17 18:02:59 +11:00
Zoltan Somogyi
9e7a78d9ac Add a function to create grade structures. 2016-02-17 01:15:25 +11:00
Zoltan Somogyi
09dee416fd Add a structured representation of a grade. 2016-02-16 21:44:20 +11:00
Zoltan Somogyi
f831848d6b Print the grade string for each grade lib solution.
grade_lib/grade_string.m:
    New module for converting a solution from the grade library
    into a grade string.

grade_lib/grade_solver.m:
    Change the representation of a solution to a map to express the invariant
    that no solver var may be associated with more than one value.

grade_lib/grade_spec.m:
    Fix some documentation bugs.

grade_lib/test_grades.m:
    Print the grade strings on each success.
2016-02-15 23:49:05 +11:00