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.
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.
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.
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.
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.
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.
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.
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.
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.