configure.ac:
Require the installed compiler to support that option.
STANDARD_MCFLAGS:
Specify that option.
compiler/canonicalize_interface.m:
compiler/comp_unit_interface.m:
compiler/inst_user.m:
compiler/parse_module.m:
compiler/switch_util.m:
compiler/type_ctor_info.m:
deep_profiler/mdprof_dump.m:
library/digraph.m:
slice/mcov.m:
Delete unused equivalence types that were picked up by the option.
They do not currently work in-situ because the launcher scripts we generate do
not set MONO_PATH appropriately. Use the new --mono-path-directory option to
remedy this.
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
grade_lib/GRADE_LIB_FLAGS.in:
mfilterjava/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
As above.
mdbcomp/read_trace_counts.m:
Delete the mercury_trace_counts_list predicate, whose last
(and probably only) caller was deleted in 2006. Rename the types
and function symbols originally named after it.
Rename the read_trace_counts_source predicate to just
read_trace_counts_file, because the argument that specified
where it should get trace counts from (a single file, or a
list of files) was also deleted about two decaded ago.
The predicate originally named read_trace_counts, which this diff
renames to read_trace_counts_base, differed from the predicate
now named read_trace_counts_file only in the level of detail
they returned to their callers about any errors they found.
As it happens, the only call to read_trace_counts_base is from
read_trace_counts_file, because no callers need the extra info
about errors (which they can report, but cannot do anything about).
Therefore keep read_trace_counts_base private, and the mark it
for future merging with read_trace_counts_file.
mdbcomp/trace_counts.m:
Use an inst to encode an invariant in types for read_trace_counts.m.
compiler/tupling.m:
mdbcomp/slice_and_dice.m:
slice/mtc_diff.m:
Conform to the changes above.
mdbcomp/read_trace_counts.m:
mdbcomp/write_trace_counts.m:
Carve these two modules out of trace_counts.m.
Put the lowest-level building block, the read_trace_counts predicate,
last in read_trace_counts.m.
Stop exporting write_proc_label from write_trace_counts.m.
mdbcomp/trace_counts.m:
Delete the moved code, and export the trace_count_file_id function
to both new modules.
mdbcomp/mdbcomp.m:
Include the new modules.
deep_profiler/Mmakefile:
slice/Mmakefile:
Copy the new modules to these directories.
deep_profiler/.gitignore:
slice/.gitignore:
Ignore the newly-copied source files.
compiler/tupling.m:
mdbcomp/slice_and_dice.m:
slice/mcov.m:
slice/mtc_diff.m:
slice/mtc_union.m:
Update the set of imports needed.
mdbcomp/feedback.feedback_info.m:
mdbcomp/feedback.m:
Move all the contents of feedback.m other than include_module items
into the new module feedback_info.m, leaving feedback.m a package.
mdbcomp/feedback.automatic_parallelism.m:
Group the types exported by this module into groups of related types.
Delete a totally unused type.
deep_profiler/Mmakefile:
slice/Mmakefile:
Copy the new module.
compiler/check_options.m:
compiler/globals.m:
compiler/handle_options.m:
compiler/introduce_parallelism.m:
deep_profiler/autopar_reports.m:
deep_profiler/autopar_search_callgraph.m:
deep_profiler/mdprof_create_feedback.m:
deep_profiler/mdprof_report_feedback.m:
Import the new module.
compiler/options.m:
doc/user_guide.texi:
NEWS.md:
Add, document and announce the new option. It is off by default,
but of course I tested its behavior when turned on. Most of this
diff deals with the consequences.
compiler/item_util.m:
Add code to generate the new warnings if requested.
compiler/convert_parse_tree.m:
Request the new warning if the new option is set when processing
source files..
compiler/handle_options.m:
Disable all style warnings, including the new one, when generating
.int* files or .*opt files.
compiler/mercury_compile_main.m:
Fix an unrelated bug I noticed while working on this diff:
report the "unfindability" of a given file at most once.
browser/dl.m:
browser/io_action.m:
compiler/mercury_compile_augment.m:
compiler/mercury_compile_llds_back_end.m:
compiler/unused_args.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/dump.m:
deep_profiler/html_format.m:
deep_profiler/mdprof_create_feedback.m:
deep_profiler/profile.m:
deep_profiler/read_profile.m:
deep_profiler/recursion_patterns.m:
deep_profiler/var_use_analysis.m:
library/array2d.m:
library/bit_buffer.read.m:
library/construct.m:
library/edit_distance.m:
library/library.m:
library/mercury_term_lexer.m:
library/one_or_more_map.m:
library/private_builtin.m:
library/set_bbbtree.m:
library/string.parse_runtime.m:
library/thread.future.m:
library/univ.m:
library/version_array.m:
library/version_bitmap.m:
mdbcomp/program_representation.m:
profiler/call_graph.m:
profiler/demangle.m:
profiler/output.m:
profiler/process_file.m:
profiler/propagate.m:
slice/mdice.m:
slice/mslice.m:
Fix unsorted import blocks pointed out by the new option.
tests/invalid/ambiguous_overloading_error.err_exp:
tests/invalid/bad_tscp.err_exp:
tests/invalid/bug10.err_exp:
tests/invalid/gh72_errors.err_exp:
tests/invalid/ho_default_func_2.err_exp:
tests/invalid/require_scopes.err_exp:
tests/invalid/type_error_use_module.err_exp:
tests/invalid/types.err_exp:
tests/invalid_nodepend/errors_2.err_exp:
tests/invalid_nodepend/funcs_as_preds.err_exp:
tests/warnings/ambiguous_overloading.err_exp:
tests/warnings/save.err_exp:
tests/warnings/singleton_test.err_exp:
tests/warnings/unused_interface_import.err_exp:
Update the expected outputs of these test cases to expect the new warning
for unsorted import blocks in their source files.
tests/invalid/Mercury.options:
tests/invalid_nodepend/Mercury.options:
tests/warnings/Mercury.options:
Execute those test cases with the warning enabled.
tests/invalid_nodepend/require_tailrec_invalid.m:
tests/invalid_nodepend/specified.m:
tests/recompilation/pragma_type_spec_r.m.1:
tests/recompilation/type_qual_re.m.1:
tests/recompilation/type_qual_re_2.m.1:
tests/recompilation/type_spec_unname_var_r.m.1:
tests/recompilation/type_spec_unname_var_r_2.m.1:
tests/recompilation/type_spec_unname_var_r_2.m.2:
tests/recompilation/unchanged_pred_nr.m.1:
tests/recompilation/with_type_re.m.1:
Sort the import blocks in these test cases, and where relevant,
import only one module per line.
tests/recompilation/with_type_re.err_exp.2:
Expect updated line numbers after splitting a line that imported
two modules.
tests/warnings/unsorted_import_blocks.{m,err_exp}:
New test case to exercise one nontrivial part of the sortedness check,
numerical non-sortedness. (The other affected test cases already exercise
all the other parts.)
tests/warnings/Mmakefile:
Enable the new test case.
LICENSE:
compiler/handle_options.m:
doc/*.texi:
profiler/mercury_profile.m:
slice/mtc_diff.m:
slice/mtc_union.m:
trace/mercury_trace_internal.c:
As above.
slice/mcov.m:
slice/mslice.m:
slice/mdice.m:
Adjust years printed copyright notice to cover the
entire program, not just the top-level module.
slice/Mmakefile:
deep_profiler/Mmakefile:
As above. This avoids having to rebuild the interface and target
language files of the modules copied to these directories from
the mdbcomp directory after the creation of each executable.
browser/MDB_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
grade_lib/GRADE_LIB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Stop specifying --no-warn-inferred-erroneous as the default for
every module in these directories, most of which did not even need it
(the result of blind copying in the absence of STANDARD_MCFLAGS).
browser/Mercury.options:
library/Mercury.options:
Specify --no-warn-inferred-erroneous for the modules that
actually do need it.
STANDARD_MCFLAGS:
Put the mmc options that are common to either
- all of the dir/DIR_FLAGS.in files, or
- all but one of them,
into this new file.
(MFILTERJAVAC_FLAGS did not specify --warn-suspicious-foreign-code;
after this diff, it does.)
configure.ac:
Enable replacing @STANDARD_MCFLAGS@ with the new file's contents.
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
grade_lib/GRADE_LIB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Include STANDARD_MCFLAGS instead of listing each option in it
individually, making future global changes to options easier.
Put .mh files into a Mercury/mhs subdirectory when --use-subdirs
or --use-grade-subdirs is used.
compiler/file_names.m:
Replace ext_cur_mh with ext_cur_ngs_max_cur_mh, in the new category
ext_cur_ngs_max_cur. The new category is similar to that for .mih
files, except that .mh files are never placed in grade-specific
subdirectories.
compiler/handle_options.m:
Add Mercury/mhs subdirs to list of C include directories
when --use-subdirs or --use-grade-subdirs is in effect.
compiler/write_deps_file.m:
Add $(mhs_subdir) prefix before %.mh patterns.
Create a Mercury/mhs -> .. symlink when installing.
This is required by mmc --make and mmake --use-subdirs.
Conform to the changes above.
compiler/export.m:
compiler/make.file_names.m:
compiler/make.program_target.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mlds_to_c_file.m:
Conform to the changes above.
scripts/Mmake.vars.in:
Define the variable mhs_subdir.
scripts/Mmake.rules:
Add -I option to find .mh files when --use-subdirs is used.
browser/.mgnuc_copts:
browser/MDB_FLAGS.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/DEEP_FLAGS.in:
extras/EXTRAS_FLAGS.in:
grade_lib/.mgnuc_copts:
grade_lib/GRADE_LIB_FLAGS.in:
library/.mgnuc_copts:
mdbcomp/.mgnuc_copts:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/.mgnuc_copts:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/.mgnuc_copts:
profiler/PROF_FLAGS.in:
slice/.mgnuc_copts:
slice/SLICE_FLAGS.in:
ssdb/.mgnuc_copts:
ssdb/SSDB_FLAGS.in:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
trace/.mgnuc_copts:
tools/lmc.in:
Add -I options to find .mh files when the workspace is built
with mmake --use-subdirs.
samples/c_interface/standalone_c/Makefile:
Add option to let the C compiler find the .mh file.
NEWS.md:
Announce change.
Delete trailing whitespace.
... instead of building a bunch of .c files.
Our tradition of adding an "s" at the end of a suffix to mean "all of the
files with the original suffix" had a problem when we added C# as a target
language. Until then, just as "os" stood for ".o files" when it occurred
as either a mmake target, mmc --make target, or mmake variable name component.
"cs" likewise stood for ".c files", but was now also needed to mean ".cs file".
We coped by keeping "cs" meaning ".c files", and adding "csharp" as a target
name synonym to mean ".cs file".
This diff keeps that synonym, but it changes
- the name needed to refer to ".c files" from "cs" to "all_cs"
- the name needed to refer to ".o files" from "os" to "all_os"
- the name needed to refer to ".pic_o files" from "pic_os" to "all_pic_os"
- the name needed to refer to ".cs files" from "css" to "all_css"
- the name needed to refer to ".java files" from "javas" to "all_javas"
- the name needed to refer to ".opt files" from "opts" to "all_opts"
- the name needed to refer to ".trans_opt files"
from "trans_opts" to "all_trans_opts"
It would be nice if we could apply this same change to all other similar
target names and mmake variable name suffixes, such as "ints" and "int3s",
but some of those names are already in use to mean semantically different
things. All of the names above that used to have the form "<ext>s" and
now have the form "all_<ext>s" stood for all the files with extension
".<ext>" that are prerequisites for building a linked target, i.e.
an executable or a library. But the mmake variable name suffixes
".all_mihs", ".all_mhs" and ".all_int0s" each stand for something subtly
different: the names of files that *may or may not exist", but which,
if they do exist, should be deleted by a clean or realclean target.
To make this breaking change easier to handle by users, this diff does
not simply redefine the meaning of ".all_int0s". (It does change the meaning
of the "cs" target, but the fact this will happen at some time has been
announced ages ago.) Instead, it defines three new mmake var suffixes,
".mihs_to_clean", ".mhs_to_clean" and ".int0s_to_clean", which are
synonyms for ".all_mihs", ".all_mhs" and ".all_int0s" respectively,
and announces that ".all_mihs", ".all_mhs" and ".all_int0s" are being
deprecated, and will have the above change of semantics applied to them
in the future.
NEWS.md:
Announce the breaking change.
compiler/make.top_level.m:
Stop treating the target "cs" as meaning "build all the .c files
for this program".
The code of classify_target_2 has long been semidet, but only in a way
that was not apparent to the compiler. Change the code to allow the
compiler to see its semidet nature while keeping the algorithm the same,
except for the change in the paragraph above.
This includes keeping e.g. "ints" as meaning "build all the .int/.int2
files needed by this program".
compiler/write_deps_file.m:
Stop generating mmake variables with suffixes ".cs", ".os", ".pic_os",
".javas" and ".css". The mmake variables with suffixes ".all_cs",
".all_os", ".all_pic_os", ".all_javas" and ".all_css" already existed.
All had the same value as the mmake variable without the "all",
with one exception: ".cs". However, in this case, the old (and still
current) value of ".all_cs" is what the value of ".cs" *should* have been.
Simplify some code.
The following changes in compiler/*.m are only cosmetic, but they helped me
rule out possible sources of problems with incomplete versions of this diff.
compiler/file_names.m:
Add a version of a fact_table_file_name_return_dirs which does not
return directories, since most of its callers don't need that info.
compiler/make.program_target.m:
Clarify code by making variable names more descriptive,
compiler/make.file_names.m:
compiler/make.module_target.m:
Conform to the changes above,
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
grade_lib/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
Rename os to all_os, cs to all_cs, css to all_css, javas to all_javas,
and opts to all_opts. (There were no occurrences of trans_opts to rename.)
Replace [s as sh command names in actions.
scripts/Mmake.vars.in:
Specify the names of mmake variables holding the names of sets of files
with a given extension directly, since for some of them, adding an "s"
at the end of the name of the extension does not generate the name
of the corresponding mmake variable anymore.
scripts/Mmake.rules:
Use the directly specified mmake variable names from Mmake.vars.in
in the rule for installing lbraries. Temporarily add some debugging
output to make suree that the updated nested mmake variable references
work as intended.
tools/bootcheck:
Specify the names of mmake targets for making all the files in a program
with a given extension directly, since adding an "s" at the end of the
name of the extension does not generate the name of the corresponding
mmake target anymore.
Print timestamps around the action of checking namespace cleanliness,
to allow the time taken by that action to be measured. (I kept track
of bootchecks as they happened while working on this diff, and found
this time to be nontrivial.)
slice/mdice.m:
slice/mslice.m:
Add the suffix "_width", to the names of the option used to control column
widths in the output.
Adjust the usage message.
docs/user_guide.texi:
Conform to the above change.
slice/mdice.m:
slice/mslice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
Fix spots where errors were not being printed to standard error
and the exit status was not being set to a non-zero value.\
Rename some predicates.
slice/mtc_diff.m:
Fix a typo in the short usage message.
Improve the usage and version messages for the programs in the
slice directory by:
- adding --help and --version options for programs that did
not already have them (Mantis issue #208);
- making version and usage message consistent in form with other
programs in the system;
- on a usage error, writing the short usage message to the standard
error stream and setting a non-zero exit status.
This also prepares the way for creating manual pages for the programs in the
slice directory.
slice/mcov.m:
slice/mslice.m:
slice/mdice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
As above.
library/library.m:
Add finer-grained functions for returning configuration information.
Implement the existing version/2 predicate using these new functions.
compiler/handle_options.m:
profiler/mercury_profile.m:
slice/mcov.m:
Use the new functions.
NEWS.md:
Announce the new functions.
Add a new configure option, ---with-pkgversion, that allows those packaging
Mercury to include additional version information specific to their package in
the output of mmc --version etc.
Omit version and copyright information from the short usage messages for mmc, mprof
and mcov. The result is less cluttered and more direct.
Omit version information from the long usage (i.e. --help) message for the
above programs. This is to save space on the first line of the output and also
brings the man pages for mmc, mprof and mcov into line with the other man
pages, which do *not* have version information in their NAME section.
configure.ac:
Add the new --with-pkgversion option.
runtime/mercury_conf.h.in:
runtime/mercury_dotnet.cs.in:
java/runtime/Constants.java.in:
Define a constant for the package version.
library/library.m:
Add the function package_version/0, which returns the package
version string.
compiler/handle_options.m:
profiler/mercury_profile.m:
slice/mcov.m:
Include a non-empty package version in the output of --version.
Make the above changes to the short and long usage messages.
Add an XXX about mprof's short usage message.
The first line of usage and version messages have long been concluded with "on
<ARCH>" component, where <ARCH> is the value of FULLARCH baked into the
standard library. Omit this component, it doesn't convey any useful information
and we need to make some space on the first line for the optional package
version that will be added in an upcoming change.
compiler/handle_options.m:
profiler/mercury_profile.m:
slice/mcov.m:
As above.
Hoist code that prints copyright notices out into separate predicates,
so that they can be updated in a single spot.
Use io.format more when generating usage messages.
compiler/handle_options.m:
As above.
Rename usage/2 -> short_usage/2 for consistency with elsewhere.
Add an XXX about a comment that looks to be out-of-date.
compiler/mercury_compile_main.m:
Conform to the above change.
profiler/mercury_profile.m:
As above.
profiler/options.m:
Delete a stray newline.
slice/mcov.m:
As above.
This is a generalisation of the write_tabbed_lines predicate that mmc
and mcov use to print their usage messages. (In a later change other
programs in the Mercury system will be changed to use it as well.)
library/io.m:
Add the new predicates.
compiler/options.m:
slice/mcov.m:
Use write_prefixed_lines in place of write_tabbed lines
and delete the latter.
NEWS.md:
Announce the addition.
configure.ac:
Require the installed compiler to support --allow-insts-as-modes
(and therefore its negation).
*/*_FLAGS.in:
Add -no-allow-ho-insts-as-modes as a default option.
compiler/bytecode_data.m:
compiler/deforest.m:
compiler/inst_graph.m:
compiler/introduce_parallelism.m:
compiler/mode_constraint_robdd.m:
compiler/mode_constraints.m:
compiler/mode_robdd.equiv_vars.m:
compiler/mode_robdd.implications.m:
compiler/mode_robdd.tfeirn.m:
compiler/parse_util.m:
compiler/recompilation.version.m:
compiler/set_of_var.m:
compiler/term_constr_fixpoint.m:
deep_profiler/array_util.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/dump.m:
deep_profiler/interface.m:
deep_profiler/program_representation_utils.m:
mdbcomp/program_representation.m:
Add in() wrappers around higher order insts used as modes.
Use simply "in" as the mode of functions with the default mode
and determinism.
Fix a few style issues.
as the default for the Mercury system.
configure.ac:
Require the installed compiler to support this option.
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
grade_lib/GRADE_LIB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Specify this option as the default in their directories.
deep_profiler/analysis_utils.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/autopar_reports.m:
deep_profiler/autopar_search_callgraph.m:
deep_profiler/autopar_search_goals.m:
deep_profiler/callgraph.m:
deep_profiler/canonical.m:
deep_profiler/cliques.m:
deep_profiler/coverage.m:
deep_profiler/dump.m:
deep_profiler/mdprof_cgi.m:
deep_profiler/mdprof_create_feedback.m:
deep_profiler/mdprof_dump.m:
deep_profiler/mdprof_procrep.m:
deep_profiler/mdprof_report_feedback.m:
deep_profiler/mdprof_test.m:
deep_profiler/profile.m:
deep_profiler/read_profile.m:
deep_profiler/recursion_patterns.m:
deep_profiler/startup.m:
deep_profiler/var_use_analysis.m:
Replace implicit streams with explicit streams.
In some places, simplify some code, often using constructs such as
string.format that either did not exist or were too expensive to use
when the original code was written.
Consistenly use the spelling StdErr over Stderr.
In mdbprof_dump.m, put filename and reason-for-failing-to-open-that-file
in the right order in an error message.
deep_profiler/DEEP_FLAGS.in:
Turn on --warn-implicit-stream-calls for the entire deep_profiler
directory.
mdbcomp/program_representation.m:
mdbcomp/trace_counts.m:
Replace implicit streams with explicit streams. These are the two mdbcomp
modules that (a) used to use implicit streams, and (2) are used by the
deep profiler.
mdbcomp/Mercury.options:
Turn on --warn-implicit-stream-calls for these two modules.
slice/mcov.m:
slice/mtc_union.m:
Conform to the changes in mdbcomp.
... using an approach proposed by Peter, with an extra twist from Julien.
Instead of having two modules, getopt.m and getopt_io.m, with the former
defining predicates that do not take an I/O state pair, and the latter
defining predicates that do take an I/O state pair, put both kinds of
predicates into a single module. The versions with an I/O state pair
have an "_io" suffix added to their names for disambiguation.
Both versions are a veneer on top of a common infrastructure,
which relies on a simple type class to implement the operation
"give the contents of the file with this name". The predicate versions
with I/O state pairs have a normal implementation of this typeclass,
while the predicate versions that do not have I/O state pairs
have an implementation that always returns an error indication.
The above change just about doubles the number of exported predicates.
We already had two versions of most exported predicates that differed
in whether we returned errors in the form of a string, or in the form
of a structured representation, with names of the latter having
an "_se" suffix. Since we agreed that the structured representation
is the form we want to encourage, this diff deletes the string versions,
and deletes the "_se" suffix from the predicate names that used to have them.
(It still remains at the end of the name of a type.) This "undoubling"
should offset the effect of the doubling in the previous paragraph.
Eventually, we want to have just one module, getopt.m, containing
the updated code described above, but for now, we put the same code
into both getopt_io.m and getopt.m to prevent too big a shock to
people with existing code that uses getopt_io.m.
library/getopt.m:
library/getopt_io.m:
Make the changes described above.
library/Mmakefile:
Instead of building both getopt_io.m and getopt.m from getopt_template,
build getopt.m from getopt_io.m.
tools/bootcheck:
Delete references to getopt_template.
compiler/typecheck_errors.m:
When a type error involves one of the getopt/getopt_io predicates
whose interfaces are changed by this diff, tell the user about
how these changes could have caused the error, and thus what the
probable fix is.
compiler/handle_options.m:
browser/parse.m:
deep_profiler/mdprof_cgi.m:
deep_profiler/mdprof_create_feedback.m:
deep_profiler/mdprof_dump.m:
deep_profiler/mdprof_procrep.m:
deep_profiler/mdprof_report_feedback.m:
deep_profiler/mdprof_test.m:
profiler/mercury_profile.m:
slice/mcov.m:
slice/mdice.m:
slice/mslice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
tests/hard_coded/space.m:
Use the updated getopt interface.
compiler/compile_target_code.m:
compiler/compute_grade.m:
compiler/deforest.m:
compiler/det_report.m:
compiler/format_call.m:
compiler/globals.m:
compiler/goal_expr_to_goal.m:
compiler/make.build.m:
compiler/make.m:
compiler/make.module_dep_file.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/mercury_compile_main.m:
compiler/ml_top_gen.m:
compiler/module_cmds.m:
compiler/op_mode.m:
compiler/optimization_options.m:
compiler/options.m:
compiler/write_module_interface_files.m:
tools/make_optimization_options_middle:
tools/make_optimization_options_start:
Replace references to getopt_io.m with references to getopt.m.
tests/invalid/getopt_io_old.{m,err_exp}:
tests/invalid/getopt_old.{m,err_exp}:
tests/invalid/getopt_old_se.{m, err_exp}:
New test cases for the extra help
tests/invalid/Mmakefile:
Enable the new test cases.
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.
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.
library/LIB_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Specify --warn-inconsistent-pred-order-clauses as a default flag
in these directories as well.
library/string.m:
Reorder code to make this module compile cleanly with
--warn-inconsistent-pred-order-clauses.
Don't export base_string_to_int_underscore to lexer.m, since
lexer.m does not use it anymore, and neither does anything else.
(The export was not publicly documented.)
library/benchmarking.m:
library/bitmap.m:
library/builtin.m:
library/map.m:
library/profiling_builtin.m:
library/rbtree.m:
library/table_builtin.m:
library/uint.m:
profiler/globals.m:
profiler/options.m:
profiler/prof_info.m:
slice/mdice.m:
slice/mslice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
ssdb/ssdb.m:
Reorder code to make these modules compile cleanly with
--warn-inconsistent-pred-order-clauses.
library/Mercury.options:
Specify --no-warn-inconsistent-pred-order-clauses for the modules
that would still get warnings without this option.
tools/bootcheck:
Build the deep_profiler and mfilterjavac directories in stage 2.
Build the slice, profiler, deep_profiler and mfilterjavac directories
in stage 3. (We already used to build slice and profiler in stage 2.)
Compare target language files in the stage 2 and stage 3 versions
of the slice, profiler, deep_profiler and mfilterjavac directories,
to make bootcheck a tougher test. This requires copying these directories
to stage 3, instead of just linking them.
Don't make dependencies in a directory if we had already done them
earlier.
mfilterjavac/Mmakefile:
Add targets for building C# and Java files.
slice/Mmakefile:
Include the modules of the mcov and mtc_diff programs in the
existing targets for building C, C# and Java files.
deep_profiler/Mmakefile:
profiler/Mmakefile:
These makefiles already had targets for building C# and Java files.
Fix grammar and/or indentation.
compiler/Mmakefile:
Fix grammar and/or indentation.
configure.ac:
Require the installed compiler to have the recent bug fix to
contiguity warnings, since without that bug fix, we get warnings
for code that is actually perfectly ok.
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Specify both --warn-non-contiguous-clauses and
--warn-non-contiguous-foreign-procs as the default in each directory.
library/Mercury.options:
Disable the warnings for exception.m and io.m, which are have not
been cleaned up yet wrt these warnings.
Enable the recently added --warn-suspicious-foreign-code warning by default for
the Mercury system.
configure.ac:
Check that --warn-suspicious-foreign-code is supported by the bootstrap
compiler
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
profiler/PROF_FLAGS.in:
Enable the option.
configure.ac:
Require that the installed compiler support this option (which I added
about two weeks ago).
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Specify this option by default for every directory that contains
Mercury code.