Commit Graph

123 Commits

Author SHA1 Message Date
Zoltan Somogyi
104a8ebd9e Get "make cs"/"mmc --make x.cs" to build a C# file ...
... 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.)
2023-10-05 02:03:47 +11:00
Julien Fischer
3913ff93bc Address review comments.
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.
2023-10-01 20:49:20 +11:00
Julien Fischer
db67618649 Fix some error reporting in slice directory.
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.
2023-10-01 17:16:22 +11:00
Julien Fischer
3513ed602c Improve usage and version messages in the slice directory.
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.
2023-10-01 17:07:22 +11:00
Zoltan Somogyi
a0d6710407 Use "ts=4 sw=4 expandtab" as modeline ...
... in Mercury.options files.
2023-09-16 19:12:52 +10:00
Julien Fischer
de0f7e2a60 Finer-grained functions for configuration information.
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.
2023-09-10 21:38:47 +10:00
Julien Fischer
57acffa039 Support optional package version information.
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.
2023-09-09 14:23:50 +10:00
Julien Fischer
4ab7483716 Do not include the fullarch in version and usage messages.
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.
2023-09-07 10:23:50 +10:00
Julien Fischer
4afc90587c Add --version option to mprof and mcov.
profiler/mercury_profile.m:
profiler/options.m:
slice/mcov.m:
     As above.
2023-09-04 21:19:18 +10:00
Julien Fischer
9f2ebae910 Improve consistency of usage messages for mmc, mprof and mcov.
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.
2023-09-04 17:21:46 +10:00
Julien Fischer
20bdfc46c9 Make mcov's usage message consistent with mmc and mprof.
slice/mcov.m:
    As above; also fix the years in the copyright notice.
2023-09-04 16:01:29 +10:00
Julien Fischer
814b34366a Add io.write_prefixed_lines/[45].
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.
2023-09-03 22:39:51 +10:00
Zoltan Somogyi
5f47a8389b Stop using higher order insts as modes.
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.
2023-08-15 00:19:34 +02:00
Julien Fischer
d0b64c87c7 Ignore files generated by MSVC.
*/.gitignore:
   Ignore any increment linker files (.ilk) and program database (.pdb)
   file that MSVC generates.
2023-07-01 02:25:53 +10:00
Julien Fischer
19d818209f Ignore *.obj files.
*/.gitignore:
    As above.

    Fix a few other omissions.
2023-06-26 20:05:24 +10:00
Zoltan Somogyi
06f81f1cf0 Add end_module declarations ...
.. to modules which did not yet have them.
2022-01-09 10:36:15 +11:00
Zoltan Somogyi
0424c3f947 Specify --no-halt-at-warn-make-{int,opt}. 2021-12-26 03:10:01 +11:00
Zoltan Somogyi
d854949a9c Specify --warn-potentially-ambiguous-pragma ...
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.
2021-06-23 18:33:59 +10:00
Zoltan Somogyi
0d7c8a7654 Specify pred or func for all pragmas.
*/*.m:
    As above.

configure.ac:
    Require the installed compiler to support this capability.
2021-06-16 15:23:58 +10:00
Zoltan Somogyi
3c07fc2121 Use explicit streams in deep_profiler/*.m.
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.
2021-03-06 18:30:50 +11:00
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
Zoltan Somogyi
409cbcb6a3 Unify getopt.m and getopt_io.m ...
... 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.
2020-10-09 19:30:46 +11:00
Zoltan Somogyi
53ebc2dfaa Add some files to be ignored. 2020-08-11 05:43:16 +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
845ac1ecff Add some missing dependencies. 2020-04-08 02:09:32 +10:00
Julien Fischer
a1c4dd7b37 Fix stage 2 bootcheck with --use-mmc-make.
deep_profiler/Mmakefile:
slice/Mmakefile:
     Restore the .PHONY directives on the Mercury.modules target.
2020-01-18 04:22:17 +11: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
cbb7d8613b Make --warn-inconsistent-pred-order-clauses the default in most directories.
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.
2019-08-27 14:34:01 +10:00
Zoltan Somogyi
4bf9dd6ca3 Build more directories in stages 2 and 3.
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.
2019-06-25 14:22:53 +02:00
Zoltan Somogyi
1f8d8aeabf Warn about non-contiguous clauses in the Mercury system by default.
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.
2018-11-14 18:56:13 +11:00
Julien Fischer
c5ac31fdcb Enable --warn-suspicious-foreign-code.
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.
2018-10-08 09:33:24 +00:00
Zoltan Somogyi
2bfe4d402c Compile everything with --halt-at-warn-if-possible. 2018-08-02 14:45:42 +10:00
Zoltan Somogyi
014ca2144b Enable --warn-insts-with-functors-without-type.
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.
2017-11-22 01:48:36 +11:00
Julien Fischer
ba24a880fe Add targets for building stage 3 C# source files.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    Add the 'css' target for building the C# source files.
2017-10-22 06:38:07 -04:00
Julien Fischer
345bdfff55 Add targets for building the Java source files only.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/mdbcmp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    As above (required for stage 3).

    Delete residual references to the IL backend.
2017-10-21 21:36:40 -04:00
Zoltan Somogyi
22eefb3c88 Shut up determinism warnings for "sorry" fallback clauses.
Many predicates that do their jobs via foreign_procs in C have a fallback
Mercury clause for non-C backends, which usually throws an exception.
When compiled in non-C grades, these often get a warning that their
determinism declaration could have been tigther, e.g. erroneous instead of det.

*.m:
    Add no_determinism_warnings pragmas before such fallback clauses.

library/dir.m:
    As above, but also remove the unnecessary "dir." prefix on many predicate
    declarations and clause heads.
2017-08-10 18:02:42 +02:00
Zoltan Somogyi
baddfd37cd Make --warn-unused-imports the default for the Mercury system.
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:
    Add --warn-unused-imports to the list of default compiler flags
    for each directory.

compiler/ml_tailcall.m:
library/io.m:
    Delete some unused imports.
2017-01-19 10:48:04 +11:00
Zoltan Somogyi
f07145fe9a Use explicit streams in the slice directory's modules.
slice/mcov.m:
slice/mdice.m:
slice/mslice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
    As above.
2016-10-30 00:54:00 +11:00
Julien Fischer
ed2f4056b9 Minor fix for mcov usage message.
slice/mcov.m:
     Add a missing full stop.
2016-08-21 14:38:53 +10:00
Julien Fischer
e3467a0f63 Improve formatting of mcov output
slice/mcov.m:
    When printing unexecuted labels, print a space between the
    proc label and the path ports.
2016-08-12 11:46:48 +10:00
Julien Fischer
72839d4e14 Update a copyright notice.
slice/mcov.m:
    Update the copyright notice in long form usage message.
2016-08-12 11:07:59 +10:00
Julien Fischer
700a855efd Do not include mdbcomp modules in coverage reports by default.
slice/mcov.m:
    Filter trace counts from mdbcomp modules by default.  Add a
    a new developer-only option, --no-ignore-mdbcomp, that causes
    them to be included -- doing so may be useful for those working
    on the Mercury compiler itself.

    Update copyright messages.

mdbcomp/mdbcomp.m:
mdbcomp/builtin_modules.m:
    Add predicates for testing whether a module is part of the mdbcomp
    library.
2016-08-12 09:41:11 +10:00
Paul Bone
39da4409ec Add .dep_err files to .gitignore
browser/.gitignore:
compiler/.gitignore:
deep_profiler/.gitignore:
library/.gitignore:
mdbcomp/.gitignore:
mfilterjavac/.gitignore:
profiler/.gitignore:
slice/.gitignore:
ssdb/.gitignore:
    As above.
2016-05-25 15:42:53 +10:00
Zoltan Somogyi
d9d28f182a Add comments to Mmakefiles. 2016-04-25 20:03:09 +10:00
Julien Fischer
92c9a1fe4b Fix github issue #34: make uninstall leaves files behind.
Don't accidently strip the ".exe" extension from the deep profiler executables
on Windows when installing them.  (Deep profiling doesn't really work on
Windows, which is why this hasn't been noticed until now.)

compiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
     Add an uninstall target in these directories.

     Delete a stray reference to the IL backend.

deep_profiler/Mmakefile:
     Fix the issue mentioned above w.r.t the ".exe" extension.

     We install mdprof_cgi in (potentially) two locations, make
     sure we (attempt to) uninstall them both.

     Update the uninstall target to handle the other executables in
     this directory.

doc/Mmakefile:
     Make the uninstall target remove the manual pages.

Mmakefile:
     Invoke uninstall targets in directories where we previously didn't.
2016-01-28 22:06:13 +11:00
Zoltan Somogyi
e6ef693a1d Convert (C->T;E) to (if C then T else E). 2015-09-27 00:28:17 +10:00
Julien Fischer
3dd02876a5 Delete the MLDS->IL backend.
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_managed.m:
compiler/il_peephole.m:
compiler/ilasm.m:
compiler/ilds.m:
    Delete the modules making up the MLDS->IL code generator.

compiler/globals.m:
compiler/prog_data.m:
    Delete IL as a target and foreign language.

compiler/prog_io_pragma.m:
    Delete the max_stack_size/1 foreign proc attribute.  This was only
    ever required by the IL backend.

compiler/options.m
    Delete options used for the IL backend.

compiler/write_deps_file.m:
    Don't generate mmake targets for .il files etc.

compiler/*.m:
    Conform to the above changes.

compiler/notes/compiler_design.html
compiler/notes/work_in_progress.html
    Conform to the above changes.

library/*.m:
    Delete IL foreign_proc and foreign_export pragmas.

README.DotNet:
    Delete this file.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
    Conform the above changes.

configure.ac:
    Don't check that IL is a supported foreign language when performing the
    up-to-date check.

    Delete the '--enable-dotnet-grades' option.

scripts/Mmake.vars.in:
    Delete variables used for the IL backend (and in on case by the Aditi
    backend).

scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
scripts/Mmake.rules:
scripts/canonical_grade.sh-subr:
tools/bootcheck:
    Delete stuff related to the 'il' and 'ilc' grades.

doc/reference_manual.texi:
     Delete the documentation of the 'max_stack_size' option.

doc/user_guide.texi:
     Delete stuff related to the IL backend.

tests/hard_coded/csharp_test.{m,exp}:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/valid/csharp_hello.m:
	Delete these tests: they are no longer relevant.

tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_type.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/foreign_type3.m:
tests/hard_coded/intermod_foreign_type2.m:
tests/hard_coded/lp.m:
tests/hard_coded/user_compare.m:
tests/invalid/foreign_type_2.m:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/invalid/foreign_type_visibility.m:
tests/invalid/illtyped_compare.{m,err_exp}:
tests/submodules/external_unification_pred.m
tests/valid/big_foreign_type.m
tests/valid/solver_type_bug.m
tests/valid_seq/foreign_type_spec.m
tests/valid_seq/intermod_impure2.m
    Delete IL foreign_procs where necessary.

tests/hard_coded/Mmakefile
tests/invalid/Mercury.options
tests/invalid/Mmakefile
tests/submodules/Mmakefile
tests/valid/Mercury.options
tests/valid/Mmake.valid.common
tests/valid/Mmakefile
tests/valid_seq/Mmakefile
tests/valid_seq/Mercury.options
    Conform to the above changes.
2015-09-21 11:34:46 +10:00
Julien Fischer
2bb3ad6f44 Install Java archives for the executables in the Mercury system.
If the compiler and (most of) the other tools are built in the Java grade then
have the install target also install the Java archives for the executables.

compiler/Mmakefile:
deep_profiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	As above.  (The ones for the deep profiling tools are are probably
	a bit useless in practice, but the others should all work.)
2015-09-03 20:53:33 +10:00
Zoltan Somogyi
8f88d0192b Simplify how we copy .m files from mdbcomp.
deep_profiling/Mmakefile:
slice/Mmakefile:
    These two directories contain programs that are independent of the
    compiler, and may thus need to be compiled in different grades.
    They thus need copies of compiled library modules that are separate from
    the compiler's compiled versions of those same library modules.
    For Mercury standard library modules, they can get those from the
    installed Mercury system. For modules of the mdbcomp library, we
    copy them bodily to these two directories, and compile them there.

    We used to use a cumbersome technique for this copying. Use a simpler,
    more direct method for this, one that does not copy any file unnecessarily,
    thus eliminating unnecessary recompilations.

    The make mechanism that the new method uses, static pattern rules,
    either did not exist when I wrote the old rule, or I did not know
    about it.
2015-08-27 01:17:11 +10:00
Julien Fischer
39bed7805e Improvements to mcov.
slice/mcov.m:
	Do not include labels from the standard library in coverage reports by
	default.  Add a new command line option that can be used to force mcov
	to include these labels.

	XXX TODO: labels for opt_imported standard library procedures are still
	showing up -- I will address this in a separate change.

	Change the usage message to use the same format that mmc and mprof
	use.

	Set the exit status to a non-zero value if an error occurs.

	Use io.format in more places.

	Replace calls to error/1 with unexpected/3.

	Add a new option, --flags-file, that allows options to be read
	from a file (as with the identically named mmc option).
2015-04-08 10:41:51 +10:00