Commit Graph

25 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
Peter Wang
e017d0eb7a Delete Erlang from test_grades.
grade_lib/test_grades.m:
    As above.
2020-10-30 13:21:23 +11:00
Zoltan Somogyi
d2aa2d78e8 Delete references to Erlang in grade_lib. 2020-10-28 13:38:11 +11:00
Zoltan Somogyi
999d51f92f Use the same default options for grade_lib as for other dirs.
grade_lib/GRADE_LIB_FLAGS.in:
    A new file with default options for the grade_lib directory.

configure.ac:
    Create GRADE_LIB_FLAGS from GRADE_LIB_FLAGS.in.

grade_lib/Mmakefile:
    Make building GRADE_LIB_FLAGS possible.

    Require building GRADE_LIB_FLAGS before any Mercury module is compiled.

    Use GRADE_LIB_FLAGS as a source of default flags.

    Use a directory-specific params file if it exists.

grade_lib/choose_grade.m:
grade_lib/grade_setup.m:
grade_lib/grade_structure.m:
grade_lib/grade_vars.m:
grade_lib/test_grades.m:
grade_lib/try_all_grade_structs.m:
    Fix issues revealed by the flags in GRADE_LIB_FLAGS.

mdbcomp/MDBCOMP_FLAGS.in:
browser/Mmakefile:
    Fix aesthetics.
2019-08-27 15:02:50 +10: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
Zoltan Somogyi
3daab514a3 Make most of the changes discussed on m-rev. 2016-04-24 23:34:07 +10:00
Zoltan Somogyi
587d593d7f Document the modules of the grade library. 2016-04-01 20:41:09 +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
7007a71981 Print both user-visible and link-check versions of grades. 2016-03-25 21:12:06 +11:00
Zoltan Somogyi
a9acf2cf65 Handle the _ubf link-check grade component. 2016-03-18 04:38:09 +11:00
Zoltan Somogyi
ddcb88c342 Add code to test solving for installed grades. 2016-03-02 18:17:27 +11:00
Zoltan Somogyi
9d3de9e914 Add code to parse names of installed grades. 2016-03-01 10:34:17 +11:00
Zoltan Somogyi
54edda013f Add prelim support for choosing among installed grades. 2016-02-28 17:11:59 +11:00
Zoltan Somogyi
76696fa3ac Fix typo. 2016-02-27 08:50:39 +11:00
Zoltan Somogyi
ce475401ff Count applications of tests on requirements. 2016-02-27 06:00:53 +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
6c8b48cba4 Make some code more orthogonal. 2016-02-22 23:26:56 +11:00
Zoltan Somogyi
4ed1c9cbff Handle ssdebug grades. 2016-02-21 13:00:42 +11:00
Zoltan Somogyi
37acd29efb Add prelim support for diagnosing solver failures. 2016-02-19 07:35:04 +11:00
Zoltan Somogyi
10709619d7 Count label steps and passes. 2016-02-18 00:54:09 +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
Zoltan Somogyi
17e55f4579 Use enums, not strings, for solver vars and values.
grade_lib/grade_state.m:
    This new module contains the representation of the state solver.
    It is imported by both grade_setup.m (which initializes that state) and
    grade_solver.m (which uses and updates that state).

    Make this state refer to solver vars and their values using the values
    of two enum types, not strings. This makes it much harder to accidentally
    use the wrong name for a solver var or value.

grade_lib/grade_spec.m:
    When specifying the set of solver variables and requirements, use
    types designed for that purpose, instead of parts of the solver state
    with the fields filled in with dummies.

grade_lib/choose_grade.m:
grade_lib/grade_setup.m:
grade_lib/grade_solver.m:
grade_lib/test_grades.m:
    Conform to the changes above.
2016-02-14 06:01:22 +11:00
Zoltan Somogyi
e87e0a9eeb Add a mechanism to test the grade library.
grade_lib/test_grades.m:
    This program can repeatedly invoke the library with all possible
    combinations of selected sets of settings, and print the result.

grade_lib/Mmakefile:
    Add the new executable as a Mercury main module.

grade_lib/grade_setup.m:
    Make the library easier to use by packaging all components of the solver
    state into a single data structure.

grade_lib/grade_solver.m:
    Conform to the change in grade_setup.m.

    Provide a mechanism to put a prefix before each line when printing things
    out.

grade_lib/choose_grade.m:
    Conform to the change in grade_setup.m.

grade_lib/grade_spec.m:
    Avoid using the same name ("none") as a solver var value for more than one
    solver var.
2016-02-12 21:36:02 +11:00