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.
browser/browse.m:
browser/browser_info.m:
browser/collect_lib.m:
browser/declarative_debugger.m:
browser/declarative_oracle.m:
browser/declarative_user.m:
browser/diff.m:
browser/help.m:
browser/interactive_query.m:
browser/parse.m:
browser/util.m:
Replace implicit streams with explicit streams.
Shorten lines longer than 79 chars.
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.
In some places, change predicate names that were not meaningful
without module qualification by *including* the module qualification
in the name (e.g. init -> browser_info_init).
In some places, add XXXs.
In browser_info.m, make the output stream *part* of the debugger type,
because without this, having the debugger type belong to the stream
typeclass does NOT make sense. (The typeclass instance for debugger
used to always write to the current output stream, which this diff
is replacing with the use of explicitly specified streams.)
In browse.m, consistently put stream arguments before other arguments.
In browse.m, when exporting Mercury predicates to C, export them
under names with the standard ML_BROWSE_ prefix, NOT under the name
of a *different* predicate with that prefix.
In diff.m, eliminate an unnecessary difference between what we print
when the difference between two terms is at the root, vs what we print
when the difference between two terms is lower down.
In interactive_query.m, when trying to write a program out to a file,
do NOT write the program to the current output stream if we cannot open
the file, since that would accomplish nothing useful.
Also in interactive_query.m, cleanup .dylib instead of .so on MacOS.
In util.m, delete some unused predicates.
In collect_lib.m, document why some code is not worth updating.
In declarative_oracle.m, rename predicates with previously-ambiguous
names.
browser/MDBFLAGS.in:
Specify --warn-implicit-stream-calls for all Mercury modules
in the browser directory from now.
trace/mercury_trace_browse.c:
trace/mercury_trace_cmd_browsing.c:
ssdb/ssdb.m:
Conform to the changes in browser/*.m.
tests/debugger/queens.{exp,exp2}:
Expect the extra output from browser/diff.m.
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.
Signing assemblies with a strong name does not work with the Rosyln C# compiler
on non-Windows systems. Delay sign assemblies on non-Windows system instead
when using this compiler. (This is what the Mono documentation currently
recommends.)
configure.ac:
browser/MDB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
As above.
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.
browser/browse.m:
browser/browser_info.m:
browser/collect_lib.m:
browser/debugger_interface.m:
browser/declarative_analyser.m:
browser/declarative_debugger.m:
browser/declarative_edt.m:
browser/declarative_execution.m:
browser/declarative_oracle.m:
browser/declarative_test.m:
browser/declarative_tree.m:
browser/declarative_user.m:
browser/diff.m:
browser/dl.m:
browser/frame.m:
browser/help.m:
browser/interactive_query.m:
browser/io_action.m:
browser/listing.m:
browser/mdb.m:
browser/mer_browser.m:
browser/name_mangle.m:
browser/term_rep.m:
browser/tree234_cc.m:
Fix inconsistencies between (a) the order in which functions and predicates
are declared, and (b) the order in which they are defined.
In most modules, either the order of the declarations or the order
of the definitions made sense, and I changed the other to match.
In some modules, neither made sense, so I changed *both* to an order
that *does* make sense (i.e. it has related predicates together).
In some places, put dividers between groups of related
functions/predicates, to make the groups themselves more visible.
In some places, fix comments or programming style.
browser/MDB_FLAGS.in:
Since all the modules in this directory are now free from any warnings
generated by --warn-inconsistent-pred-order-clauses, specify that option
by default in this directory to keep it that way.
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.
*/*_FLAGS.in:
Specify that by default, the compiler should generate warnings
for unknown format strings and bad known format strings.
*/Mercury.options:
Override this default setting for a few modules that have legitimate
reasons for calling e.g. string.format with unknown format strings.
compiler/fact_table.m:
deep_profiler/html_format.m:
Minor changes to avoid calling string.format with unknown format strings.
Library grade detection causes the library installation for the csharp grade
(and probably any grades that use mmc --make) to fail. (There is likely
a better solution than this, e.g. making --no-mercury-stdlib-dir imply
--no-detect-libgrades, but the handling of command line options in this
part of the compiler is pretty convoluted, so I will look into that
separately.)
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:
As above.
Estimated hours taken: 2
Branches: main, 12.08
Sign the all the assemblies in the csharp grade.
mercury.snk:
The strong name key used for signing.
analysis/ANALYSIS_FLAGS.in:
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Pass the signing key to the c# compiler.
scripts/prepare_install_dir.in:
Copy mercury.snk to the install dir.
Branches: main, 11.01
Get more of the system compiling directly in the erlang grade. We now
get as far as the compiler directory.
browser/MDB_FLAGS.in:
ssdb/SSDB_FLAGS.in
Specify the location of .hrl files required for the standard and
mdbcomp libraries.
mdbcomp/rtti_access.m:
Avoid a warning about an unbound variable.
browser/listing.m:
Provide an Erlang definition for the c_file_ptr/0 type.
Branches: main, 10.04
Lift some assumptions that the only Java and Erlang grades are `java' and
`erlang'.
Finally use `--force-disable-ssdebug' instead of `--no-ssdb' to disable the
source-to-source debugging tranformation where required. The latter is
incorrect as it changes the grade, which disrupts the install path with `mmc
--make'.
library/Mmakefile:
scripts/Mercury.config.in:
scripts/Mmake.vars.in:
Remove the variable `INSTALL_JAVA_LIBRARY_DIR' as it assumes only one
Java grade is possible.
Don't use default `--java-classpath' options to add Mercury standard
libraries to the Java class path, for the same reason.
compiler/module_cmds.m:
Add a predicate to return the Mercury standard libraries needed for a
Java program as they are no longer listed in Mercury.config.
Add the Mercury standard libraries when creating the shell script to
launch Java programs.
compiler/compile_target_code.m:
Add the Mercury standard libraries when calling the Java compiler.
compiler/make.program_target.m:
Don't hard code `java' and `erlang' grades when installing library
grade files.
browser/MDB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Use `--force-disable-ssdebug' to disable the transform.
compiler/module_imports.m:
Don't implicitly import the `ssdb' module if `--force-disable-ssdebug'
is enabled.
compiler/handle_options.m:
Reset the `source_to_source_debug' option on encountering a `--grade'
option.
Branches: main
Use mmc --make to install Java grades. The makefile rules in library/Mmakefile
did not install .opt files into <prefix>/lib/mercury/ints/java. When
intermodule optimisation was enabled with a Java grade, the Mercury compiler
would read the .opt files from <prefix>/lib/mercury/ints, which could be from
*any* grade (they are only installed to work around problems with Mmake).
Mmakefile:
Force mmc --make to be used to install Java grades.
browser/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
Delete rules for building libraries in the Java grade with Mmake.
Move --no-libgrade options to *_FLAGS files.
library/Mmakefile:
Create the jmercury -> ../java symlink at the `mmake depend' step.
Pass -sourcepath . to javac so it can find the jmercury/runtime/*.java
files.
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Add --no-libgrade options so that mmc --make libFOO.install only
installs the main grade.
Add --no-java-classpath so that the .jar files from the installed
compiler aren't used.
Tell the Java compiler about .jar files that each directory depends on.
README.Java:
Remove a mention of Mmake with the java grade.
Estimated hours taken: 2
Branches: main
Get the java.ssdebug grade installing and compiling hello world.
Note that currently the jars for the java.ssdebug grade are installed in the
same location as the non-ssdebug jars. That's not a problem for now,
because the standard library currently has the ssdebug transformations
turned off when it's compiled in the ssdebug grade, so the java.ssdebug
jars are the same as the java jars. Changing it so that the java.ssdebug
jars are installed in a different location requires getting mmc to
adjust the classpath depending on the grade, which doesn't seem worth
it at this stage.
Also note that the interface files for the ssdb, browser and mdbcomp
libraries need to be installed in the ssdebug grade otherwise mmc
complains that it cannot find files like ssdb.m when compiling
a program. These interface files are currently only installed
when there is an ssdebug grade.
browser/MDB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Generate .module_dep files (needed to compile ssdebug transformed
programs).
browser/Mmakefile:
Build and install mer_browser.jar.
Install the interface files when in an ssdebug grade.
browser/browse.m:
Avoid a determinism warning.
browser/cterm.m:
browser/declarative_execution.m:
browser/listing.m:
Get this code compiling in java grades.
The "if (1 == 1)" before throwing an exception is to avoid
"unreachable code" errors from the Java compiler.
library/Mmakefile:
Mention that the ssdebug jars are installed in the
same spot as the non-ssdebug jars.
mdbcomp/Mmakefile:
Build and install mer_mdbcomp.jar.
Install the interface files when in an ssdebug grade.
mdbcomp/rtti_access.m:
Get this code compiling in Java grades.
scripts/Mercury.config.in:
Add the ssdb, mdbcomp and browser jars to the classpath.
If they are not installed they will just be ignored.
ssdb/Mmakefile:
Build and install mer_ssdb.jar.
Install the interface files when in an ssdebug grade.
ssdb/ssdb.m:
Get this code compiling in java grades.
Flush the output buffers after displaying the prompt so that
it's always displayed.
Estimated hours taken: 8
Branches: main
Update files as required for the addition of the new library `libmer_ssdb',
and make the changes to add a new grade component `ssdebug'.
Mmake.workspace:
Mmakefile:
Add `mer_ssdb.init', `libmer_ssdb' and `ssdb' directory to the
appropriate lists.
Order "ssdb" occurrences according to its position in the list of
which libraries can call functions in which other libraries.
configure.in:
Check the bootstrap compiler supports the `--no-ssdb' option.
browser/MDB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
Add `--no-ssdb' to break the cyclic dependencies between these
libraries and `libmer_ssdb' that would be introduced if the
source-to-source debugging transformation was applied these libraries.
It also prevents the infinite recursion which would result from ssdb
procedures calling transformed library procedures and vice versa.
analysis/.mgnuc_copts:
analysis/ANALYSIS_FLAGS.in:
analysis/Mmakefile:
profiler/.mgnuc_copts:
profiler/PROF_FLAGS.in:
slice/.mgnuc_copts:
slice/Mmakefile:
slice/SLICE_FLAGS.in:
Search the `ssdb' directory for files.
compiler/Mmakefile:
Remove the explicit `libmer_ssdb.a' from MLOBJS as it is redundant.
Make the compiler binary depend on `libmer_ssdb'.
compiler/compile_target_code.m:
scripts/mgnuc.in:
Pass "-DMR_SS_DEBUG" when compiling a C file if `--ssdb' is enabled.
Implicitly include `mer_ssdb.init' and `libmer_ssdb' in various lists
when `--ssdb' is enabled.
runtime/mercury_conf_param.h:
Document `MR_SS_DEBUG' preprocessor macro.
compiler/handle_options.m:
runtime/mercury_grade.h:
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Add "ssdebug" grade component.
Add "--ss-debug" option as an alias for "--ssdb" to be consistent with
"--decl-debug". Move the clauses to the right position.
scripts/c2init.in:
scripts/ml.in:
Link in `libmer_ssdb' if `--ssdb' enabled.
tools/lmc.in:
tools/lml:
Link in `libmer_ssdb' and add `mer_ssdb.init'.
tools/bootcheck:
Delete `ssdb' directory if `--disable-debug-libs' option enabled.
tools/binary:
tools/linear:
Link `ssdb' directory.
compiler/notes/overall_design.html:
Mention `ssdb' directory.
doc/user_guide.texi:
Add commented out documentation for the `--ss-debug' option and the
`ssdebug' grade component.
Estimated hours taken: 4
Branches: main
Do not build an IO action map to pass around to predicates in the
declarative debugger that need access to IO actions.
Instead look these up directly in the IO state.
When using the declarative debugger to debug the Mercury compiler invoked
on typecheck.m, which generates about 2.3 million IO actions,
this change reduces the memory consumption by roughly half and reduces
the delay between the end of execution trace generation and the asking of the
first question from about 30 seconds to about 2 seconds.
Use the --force-disable-tracing option to turn off tracing in the browser
directory, even in .debug and .decldebug grades.
configure.in
Check that the --force-disable-tracing option is recongnised by the
installed compiler, since we now use this option.
browser/MDB_FLAGS.in:
Turn off tracing for all code in the browser directory.
browser/declarative_analyser.m:
Remove the IO action map from the analyser state.
Reformat a comment.
browser/declarative_debugger.m:
Do not initialise the IO action map, since it no longer exists.
For final atoms, record a range of IO action numbers, instead
a list of IO actions. The actions themselves can be looked up from
the numbers when needed.
browser/declarative_edt.m:
browser/declarative_tree.m:
Remove references to the IO action map.
browser/declarative_user.m:
Look up tabled IO actions directly in the IO state when they need to be
displayed.
Implement a predicate, find_tabled_io_action, which finds a particular
tabled IO action given a range of IO action numbers and the sought
tabled IO action number.
Change several predicates to use the above instead of looking for
the IO actions in a list.
Implement a predicate, count_tabled_io_actions, which counts how many
tabled and untabled IO actions are in a range of IO action numbers.
Modify some predicates to use above.
browser/io_action.m:
Remove the io_action_map type and predicates used to construct values
of this type.
Add a new predicate, get_maybe_io_action, which looks up a possibly
untabled IO action number and returns the IO action if it was tabled.
The type returned by this predicate is maybe_tabled_io_action, which
has two functors: tabled/1 and untabled/1. The argument of the
untabled/1 functor is pointless, since it's just the IO action number,
which is required to look up the return value of get_maybe_io_action
in the first place. Remove the pointless argument.
Add a new type, io_action_range, for recording a range of IO actions.
Add an explicit `may_call_mercury' assertion to the pickup_io_action
foreign proc.
trace/mercury_trace_declarative.c:
Do not keep track of the start and finish IO action numbers for
the generated portions of the EDT and do not pass these to the
frontend. We still record the current IO action number at each
CALL and EXIT event.
Fix a bug in the progress indicator which is exposed when event
numbers become very big.
Estimated hours taken: 12
Branches: main
Remove most of the junk from the command lines executed by make when building
the compiler and by bootcheck when building test cases. We do this by moving
the junk into files consulted via the --flags option.
After this change, it is actually possible to see in a glance not just which
files are being compiled but also with which options. The size of the output
(measured in bytes) from a bootcheck is now only about 40% of what is was
before.
configure.in:
Remember the path to the bootstrap compiler and the flags it should be
invoked with separately. Put the flags into the FLAGS files in various
directories.
Test whether the default install directory actually exists, so that
the -L and -R linker options referring to this directory are passed
to the C compiler only if it does.
Mmake.common.in:
Comment out a bunch of additions of MCFLAGS, the ones whose contents
are now in FLAGS files.
Conform to the changes in configure.in.
Add a template rule for the dependencies of the FLAGS files.
Mmake.workspace:
Comment out a bunch of additions of MCFLAGS, the ones whose contents
are now in FLAGS files. In some cases, add references to the FLAGS
files.
Mmakefile:
When rebuilding Mmake.common, rebuild only Mmake.common, not all files
created by configure.
analysis/ANALYSIS_FLAGS.in:
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/PROF_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
profiler/DEEP_FLAGS.in:
slice/SLICE_FLAGS.in:
tests/TESTS_FLAGS.in:
Add these files, which each contain the junk flags (the flags which are
the same on every invocation and mostly just clutter up compiler
command lines) that are needed on each compiler invocation in the
relevant directory. Besides the results of configuration (word size
etc), and the paths to other parts of the system, these files mostly
control which warnings are enabled.
Restrict the list of directories in -I options to what is sensible;
for example, don't specify -I../analysis in the deep_profiler
directory.
*/.nocopyright:
Don't require copyright notices in FLAGS files, since that would make
them invalid.
library/INTER_FLAGS:
Add this file, which contains the flags enabled with intermodule
optimization.
tests/WS_FLAGS.ws:
Add this file. Unlike the .in files, which processed by config.status
based on the results of autoconfiguration, this one is processed to
specify the location of the workspace being tested.
analysis/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
tests/Mmakefile:
Include the relevant directory's FLAGS file on the command line, to
replace all the additions to MCFLAGS in ../Mmake.common and in
../Mmake.workspace, and in some cases, the directory-specific Mmakefile
itself.
Build the directory's FLAGS file before executing the depend target,
since most compiler options beyond --generate-dependencies come from
there.
Delete the FLAGS files generated by config.status when doing "make
clean".
tests/Mmakefile:
Allow the environment to define DIFF_OPTS.
runtime/Mmakefile:
Use an option to tell config.status what to rebuild, not some
environment variables.
tests/invalid/Mercury.options:
For two test cases, reset an option that is set in tests/WS_FLAGS,
to match the options the affected tests were compiled with before.
tests/invalid/*.err2:
Update these expected files to account for the use of error_util
in error messages by previous changes to the compiler. These expected
output files are used only with --use-subdirs.
tests/warnings/Mmakefile:
For all test cases, reset an option that is set in tests/WS_FLAGS,
to match the options the tests were compiled with before.
scripts/prepare_tmp_dir_grade_part
Copy the flags files when creating the subdirectories of tmp_dir.
scripts/mgnuc.in:
Provide a mechanism, a per-directory .mgnuc_opts file, for specifying
the options that are required for every C file in a directory. The
intention is to use this for -I../library etc, but this is not done
yet; one thing at a time.
tools/bootcheck:
Copy the FLAGS files when creating stage2 and stage3.
Don't specify the compiler options that are now in FLAGS files.
Fill in the location of the workspace in tests/WS_FLAGS before running
the tests.
Provide a mechanism (a file ~/.bootcheck_diff_opts) to allow the user
to specify what options to invoke diff with.
Move the setting of MMAKE_USE_SUBDIRS and MMAKE_USE_MMC_MAKE after
we have built stage1, and always copy the profilers if --use-subdirs
is set. The old ways of doing things caused problems if bootcheck
was given --use-subdirs but stage1 doesn't use subdirs: the bootcheck
modified the stage1 slice, profiler and deep_profiler directories.