Commit Graph

13 Commits

Author SHA1 Message Date
Peter Wang
524f4d72e2 Delete references to Erlang backend in makefiles.
Mmake.workspace:
Mmakefile:
*/Mmakefile:
tests/*/Mmakefile:
tests/valid/Mmake.valid.common:
trace/Mmakefile:
    As above.
2020-10-27 11:10:11 +11:00
Julien Fischer
741d17f821 Fix stage 2 grade_lib dir compilation in the Java grade.
grade_lib/Mmakefile:
     Override the setting of MLOBJS in non-C grade as we do in other
     directories containing executables; otherwise mmake will complain
     about the missing archives.
2020-05-21 22:26:00 +10:00
Zoltan Somogyi
58ff05ebaf Allow bootcheck in C# grade after grade_lib changes.
tools/bootcheck:
    Build grade_lib/GRADE_LIB_FLAGS before building stage 2.

    Make dependencies in grade_lib/ before building stage 3.

grade_lib/Mmakefile:
    Get the "make dependencies" step in stage 3 build GRADE_LIB_FLAGS.
2020-04-16 12:01:29 +10:00
Julien Fischer
32176430e0 Fix compilation of the grade_lib directory in the C# grade.
grade_lib/Mmakefile:
   Tell the C# compiler where the standard library assembly is.
2020-04-15 18:58:00 +10:00
Zoltan Somogyi
0c40f3b5f0 Build the grade_lib directory by default.
This should prevent bit rot in its code, such as that caused by the
move of the one_or_more type from list.m to one_or_more.m.

Mmakefile:
    Add grade_lib to the list of directories to build, to the list of
    directories in which dependencies are made, the list of directories
    in which tags files are made, and the list of directories to clean.

    Do not include the grade library in source distributions. In the
    intended use case, the grade library modules that the compiler needs
    will be present in the source distribution in the *compiler* directory.

    Add mfilterjavac to the list of directories for tags files; its former
    absence was an oversight.

    Fix inconsistent indentation.

tools/bootcheck:
    Build the grade library during stages 2 and 3. Compare its stage 2 and 3
    versions as we do for other directories.

    Put the commands that create stages 2 and 3 into recognizable blocks.

grade_lib/Mmakefile:
    Add the targets needed by either by bootcheck or by the top level
    Mmakefile.

    Document the intended usage of the grade library.

grade_lib/.mgnuc_copts:
grade_lib/.mgnuc_opts:
    Use the same .mgnu_*opts files as e.g. the profiler directory.
    The common command sequence used by bootcheck to build the
    stage 2 and 3 directories assumes their presence.

library/Mmakefile:
    Make it clear that some rules previously separated by dividing lines
    are actually related.
2020-04-14 09:35:55 +10:00
Zoltan Somogyi
b8b845a568 Fix mmakefile rules for os,cs,css,javas.
The main objective of this change is to get bootchecks in the csharp
and java grades to actually build the slice, profiler, deep_profiler
and mfilterjavac directories, which (due to the bug this diff fixes)
they weren't doing before.

However, since one side effect of this change is to eliminate
one source of annoying warnings from mmake about references to undefined
variables, a subsidiary objective is to eliminate other sources of such
warnings as well, which mostly come from the rules for making tags files.

browser/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    When creating stage 3, the bootcheck builds, in each directory,
    only the files that it wants to compare against their stage 2 versions.
    This means that it wants to build all the .c, .cs or .java files,
    which it does via the cs, css and javas mmake targets.

    The correct definitions of the rules of these targets depends on
    whether mmc --make is being used or not, so we need at least two
    sets of definitions: one for mmc --make, and for no mmc --make,
    and conditionally selecting the appropriate one. The latter definition
    has the problem that it refers to mmake variables that are intended
    to be defined in .dv files created by mmc --generate-dependencies,
    but until that has been run, those mmake variables are undefined.

    Until now, the only directories that had both the mmc --make
    and the no mmc --make definitions were the ones needed to build
    the compiler. Bootchecks in the csharp and java grades, which
    always use --make make, got errors when they tried to build
    the directories that bootcheck builds after the compiler:
    the slice, profiler, deep_prof and mfilterjavac directories.

    This diff ensures that all directories we build in bootcheck
    get all both versions of the os, cs, css, and javas targets.
    In fact, they get two subversions of the no mmc --make version:
    one for use in the presence of .dv files, and one for use in their
    absence. The latter just builds the .dv files and invokes mmake
    again. This avoids one source of warnings about undefined mmake
    variables.

    To avoid another source, make the rules for tags files and their
    proxies depends on *.m instead of mmake variables such as $(mcov.ms),
    since this makes sense even before making dependencies. The only price
    is that any untracked Mercury source files in the directory have to
    either be given some other suffix, or moved somewhere else.

    Where relevant, make the mtags invocation prefer the master versions
    of files that are copied from the mdbcomp directory to other directories,
    since this is the only writeable version.

    Make the os and cs rules consistently NOT build the _init.[co] files.
    The way we use those files in bootcheck, we never need them;
    when we need them, the right target to give is the executable anyway.

    In the slice directory, don't put mcov between mtc_union and mtc_diff.

    Eliminate unnecessary duplication, e.g. of sources in rules.

    Eliminate double negatives in conditionals.

    Fix formatting.

Mmake.common.in:
bindist/Mmakefile:
bytecode/Mmakefile:
compiler/Mmakefile:
doc/Mmakefile:
grade_lib/Mmakefile:
robdd/Mmakefile:
samples/Mmakefile:
scripts/Mmakefile:
tools/Mmakefile:
trace/Mmakefile:
util/Mmakefile:
    Add "ft=make" to vim modelines. This is redundant for the files whose
    names is Mmakefile, but it is needed for Mmake.common.
2020-04-11 20:10:38 +10: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
Zoltan Somogyi
a618ab31e1 Insist that without mmc -f, module a.b.c be in a.b.c.m.
This should fix Mantis bug #489, which shows that without this,
the compiler can mistakenly believe that a file with a name such as lexer.m
contains a module of the standard library, rather than a submodule named
test.lexer.

compiler/parse_module.m:
    Require that :- module declarations specify the expected name.
    The name may be expected because it exactly matches the filename
    (as above), or because mmc -f has recorded the actual name
    as the expectation.

    Factor report_module_has_unexpected_name out of
    check_module_has_expected_name, since it is needed on its own.
    Simplify its code.

    Simplify the code for doing checks on :- end_module declarations.

doc/reference_manual.texi:
    Document this change in the reference manual.texi.

    Replace references to "the University of Melbourne Mercury implementation"
    with just "the Melbourne Mercury implementation".

slice/Mmakefile:
    Run mmc -f *.m before making dependencies, because the modules copied
    from mdbcomp have non-fully-qualified filenames.

*/Mmakefile:
    Delete inappropriate .PHONY directives from Mercury.modules targets.

    Include Mercury.modules among the files to be deleted by clean_local
    targets.

tests/submodules/ts.tsub.m:
    Provide the full name of this module in its :- module declaration.

tests/submodules/initialise_parent.initialise_child.m:
    Fix white space.

tests/submodules/*.*.m:
    Move separate submodules to their fully qualified filenames.
2020-01-12 22:13:01 +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
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
6df05a41d6 Add support for diagnosis of indirect failures. 2016-02-20 21:05: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
Zoltan Somogyi
0fadb2879a Break grade_lib/choose_grade.m into coherent modules. 2016-02-11 19:38:21 +11:00