Commit 5f50259d16 inadvertently wrote out
the list of fact table file names in a .module_dep file without quoting,
so the .module_dep parser would fail to read it back.
compiler/make.module_dep_file.m:
Write fact table file names in .module_dep files as quoted strings.
tests/mmc_make/Mmakefile:
tests/mmc_make/factt.m:
tests/mmc_make/factt_examples:
Add a test case.
compiler/make.module_dep_file.m:
Write foreign included file names to the .module_dep stream
instead of the implicit output stream. The bug was introduced in
commit 5f50259d16.
tests/mmc_make/Mmakefile:
mmc --make does not set a non-zero exit status even if there were
problems reading a .module_dep file. Explicitly grep for "error" in
the mmc --make output in the include_file test that should have
caught the preceding bug (assuming the workspace is built with
--use-subdirs).
grep for "error" in another test case.
compiler/Mercury.options:
Delete a workaround we needed only for Erlang.
compiler/add_mutable_aux_preds.m:
Delete the implementation of mutables for Erlang.
compiler/builtin_ops.m:
Document the fact that the Erlang backend was the only user of
two operations.
compiler/compile_target_code.m:
compiler/module_cmds.m:
Delete the predicates that handled the compilation of Erlang code.
compiler/file_names.m:
Delete code dealing with file names used only by the Erlang backend.
compiler/options.m:
Delete the old internal-only order_constructors_for_erlang option.
Add an XXX about another option intended for Erlang being unused.
Leave the other erlang-related options alive for now, to avoid breaking
Mmakefiles, Mercury.options files etc that may still refer to them.
Delete references to Erlang in help and/or error messages.
compiler/handle_options.m:
Don't both updating options that were used only by the Erlang backend,
and which are now unused.
Delete references to Erlang in help and/or error messages.
compiler/unify_proc.m:
Delete the code handling the Erlang-specific option deleted from options.m.
compiler/check_libgrades.m:
compiler/delay_partial_inst.m:
compiler/llds_out_data.m:
compiler/make_hlds_passes.m:
compiler/mlds_to_c_data.m:
compiler/prog_item.m:
compiler/simplify_goal_call.m:
compiler/write_deps_file.m:
Either delete comments referring to Erlang or the Erlang backend,
or, where their existence was the motivation for some design decisions,
shift the comments to the past tense.
tests/mmc_make/Mmakefile:
Delete a reference to a recently deleted .hrl file.
My commit afe2887882 broke the ability
to run the test suite outside of a bootcheck by executing "mmake runtests"
in the tests directory. This diff fixes that.
tests/Mmake.common:
Don't define "TESTS_DIR = ..". While every single tests/*/Mmakefile
defined it as such, I overlooked the fact that tests/Mmakefile itself
defined it ".", referring to the same directory from a different starting
point. Document this easily-overlooked fact.
Rename the old runtests target, which after afe2887 runs the tests
in a single directory, as runtests_dir, to leave the target name
"runtests" itself free for tests/Mmakefile to use.
tests/Mmakefile:
Define "TESTS_DIR = .", and add a target "runtests" which invokes
"mmake runtests_dir" in each test directory.
tools/bootcheck:
Invoke "mmake runtests_dir" instead of "mmake runtests" in each
test directory.
Initialize a variable just before it is used.
tests/*/Mmakefile:
Add back the definition "TESTS_DIR = .."
A long time ago, test directories such as hard_coded had subdirectories
such as hard_coded/typeclasses. These have since been flattened out
(e.g. hard_coded/typeclasses is now just typeclasses), but there were
still remnants of the old approach. This diff deletes those remnants.
tests/*/Mmakefile:
Delete the TESTS_DIR and the SUBDIRS mmake variables; TESTS_DIR
was always set to "..", and SUBDIRS to the empty string.
Delete any references to the make variable NOT_WORKING, since
it is never used.
tests/Mmake.common:
Document that Mmakefiles in test directories don't have to set
TESTS_DIR and SUBDIRS anymore. Fix the formatting of the documentation
of the make variables they do still have to set.
Delete the targets and actions for handling subdirectories of
test directories, since there aren't any.
tests/Mmakefile:
Simplify some code.
tests/mmc_make/Mmakefile:
tests/mmc_make/bug489.exp:
tests/mmc_make/bug489.m:
tests/mmc_make/bug489.other.m:
tests/mmc_make/lexer.m:
Add test where a separate sub-module is stored in a source file
with a name that could be confused for a standard library module.
tests/Mmake.common:
Don't invoke any actions in the clean_local and realclean_local
targets, since if using mmc --make, the builtin mmake rules
have actions for those targets as well, and make can't handle
more than one action for a target having actions. Replace those
actions with dependencies on other, unique targets that have
the actions instead.
tests/*/Mmakefile:
Avoid actions in clean_local and realclean_local targets the same way.
Sort the test names in some directories that didn't already do so.
Delete some obsolete comments.
Fix style.
tests/valid/Mmake.valid.common:
As for the Mmakefiles above, and also move the definition of a make
variable before it is needed.
tests/Mmake.common:
Replace the -j1 in the runtests_local target used by all the test
directories with $(MAYBE_J1).
tests/*/Mmakefile:
Define MAYBE_J1 it as the empty string in test directories in which
different tests don't share source files.
Define MAYBE_J1 as -j1 in test directories in which
different tests do share source files.
tests/submodules/sub2_a.m:
Add this copy of sub_a.m to allow tests in the submodules directory
to be done in parallel.
tests/submodules/accessibility2.m:
Import sub2_a.m instead of sub_a.m.
tests/warnings/ambig_types_high_level.m:
Add this copy of ambig_types.m to allow tests in the warnings directory
to be done in parallel.
tests/warnings/ambig_high_level.m:
Import ambig_types_high_level.m instead of ambig_types.m.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.
*/Makefile:
*/Mmakefile:
As above.
tests/hard_coded/.gitignore:
Don't ignore the purity subdir. This ignore must have been left over
from when purity.m was a test in hard_coded, not hard_coded/purity,
and it ignored an executable, not a directory.
Allow external files to be included in pragma foreign_decl and pragma
foreign_code declarations:
:- pragma foreign_decl("Lang", include_file("Path")).
:- pragma foreign_decl("Lang", local, include_file("Path")).
:- pragma foreign_code("Lang", include_file("Path")).
where Path may be an absolute path to a file or a path relative to the
directory that contains the source file of the module containing the
declaration.
mmc --make takes include_file into account when computing dependencies.
Mmake is unchanged yet.
compiler/prog_data.m:
Add types foreign_literal_or_include and foreign_include_file_info.
Rename "foreign_code" where "foreign_proc" is meant.
compiler/prog_foreign.m:
Use foreign_literal_or_include where we now want to allow include_file
directives.
compiler/prog_io_pragma.m:
Parse include_file forms of pragma foreign_decl and pragma
foreign_code declarations.
Rename "foreign_code" where "foreign_proc" is meant.
compiler/prog_io_typeclass.m:
Use foreign_literal_or_include where we want to allow include_file.
Make get_item_list_foreign_code return a list of foreign include
files.
Rename "foreign_code" where "foreign_proc" is meant.
compiler/file_names.m:
Add a predicate to get a module's source file name.
Add make_include_file_path.
Reorder a predicate within the module.
compiler/file_util.m:
Add write_include_file_contents, a common predicate for copying
the contents of an included file into the output.
Make output_to_file catch and report exceptions from
write_include_file_contents, and return a success code.
compiler/export.m:
compiler/llds_out_file.m:
compiler/llds_out_util.m:
compiler/mercury_compile_llds_back_end.m:
Handle include_file directives when generating target code.
Make output_llds use output_to_file, and propagate its success code.
Conform to changes.
compiler/mercury_compile_mlds_back_end.m:
compiler/mlds_to_c.m:
compiler/mlds_to_cs.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_java.m:
compiler/mlds_to_managed.m:
Handle include_file directives when generating target code.
Propagate success codes from output_to_file.
compiler/elds_to_erlang.m:
compiler/mercury_compile_erl_back_end.m:
Handle include_file directives when generating target code.
Propagate success code from output_to_file.
Fix a tiny bug: the "do not edit" comment names the .erl file
as the source file.
compiler/mercury_compile.m:
Take account of the success codes now returned by target code
generators, stopping on failure.
compiler/mercury_to_mercury.m:
Print out include_file directives.
compiler/module_imports.m:
Record in module_imports the list of included files.
compiler/make.dependencies.m:
Add files referenced by include_file directives as dependencies of
the module's compiled-code target.
compiler/make.module_dep_file.m:
Introduce .module_dep file format version 2, which has an additional
field: the list of included files that the module depends on.
Refactor the .module_dep file parsing code.
compiler/add_pragma.m:
compiler/add_solver.m:
compiler/coverage_profiling.m:
compiler/det_analysis.m:
compiler/erl_call_gen.m:
compiler/erl_code_gen.m:
compiler/foreign.m:
compiler/goal_util.m:
compiler/hlds_goal.m:
compiler/hlds_module.m:
compiler/hlds_out_goal.m:
compiler/intermod.m:
compiler/make_hlds_passes.m:
compiler/make_hlds_warn.m:
compiler/ml_code_gen.m:
compiler/modecheck_goal.m:
compiler/modules.m:
compiler/polymorphism.m:
compiler/pragma_c_gen.m:
compiler/prog_item.m:
compiler/typecheck.m:
compiler/unique_modes.m:
compiler/write_deps_file.m:
Conform to changes.
Rename "foreign_code" where "foreign_proc" is meant.
doc/reference_manual.texi:
Document include_file as a lanaguage extension.
tests/invalid/Mmakefile:
tests/invalid/foreign_include_file_missing.err_exp:
tests/invalid/foreign_include_file_missing.m:
tests/mmc_make/Mmakefile:
tests/mmc_make/inc/code.c:
tests/mmc_make/inc/code.cs:
tests/mmc_make/inc/code.erl:
tests/mmc_make/inc/code.java:
tests/mmc_make/inc/decl.cs:
tests/mmc_make/inc/decl.erl:
tests/mmc_make/inc/decl.h:
tests/mmc_make/inc/decl.java:
tests/mmc_make/include_file.exp:
tests/mmc_make/include_file.m:
Add test cases.
NEWS:
Announce the change.
Branches: main
Add support for the `csharp' grade to `mmc --make', and make it possible to
install the `csharp' grade with `mmake install'.
Also some miscellaneous fixes.
configure.in:
Require a recent enough bootstrap compiler that recognises C# as a
language for `pragma foreign_type'.
Mmakefile:
Use `mmc --make' to install the standard library in csharp grade.
aclocal.m4:
Search for the Mono C# compiler `gmcs', which is required for generics
at this time. Prefer it over the DotGNU C# compiler, which I have not
tested.
Search for `mono'. If found, it will be used in shell scripts to
launch executables generated via the csharp backend.
Remove "MS_" prefixes on the variables MS_CSC and MS_ILASM, which are
not Microsoft-specific. More importantly, it should be less likely to
make the mistake of adding an extra underscore to CSCFLAGS and
ILASMFLAGS.
README.DotNet:
Conform to variable renamings.
compiler/compile_target_code.m:
Add new linked target types `csharp_executable', `java_launcher' and
`erlang_launcher', instead of overloading `executable'.
Link with `mer_std.dll' and other libraries when generating C#
executables. There is no `mer_rt.dll'.
Pass "/debug" to the C# compiler if `--target-debug' is set.
Create a shell script to launch the executable if necessary.
Delete an unused predicate `standard_library_directory_option'.
compiler/file_names.m:
`.cs' and `.cs_date' are grade-dependent.
compiler/handle_options.m:
Force `.exe' as the executable file extension in csharp grades.
Make the `erlang' grade component imply the same options as MLDS
grades.
compiler/make.m:
Classify executable target types based on the compilation target.
compiler/make.module_target.m:
Handle `mmc --grade csharp --make <target>.dll'.
compiler/make.program_target.m:
Install library DLLs in csharp grades.
Make clean targets remove files for csharp grades.
Conform to changes.
compiler/make.util.m:
Add a stub foreign type.
Conform to changes.
compiler/module_cmds.m:
Factor out code to generate the shell scripts which launch programs
compiled in Java, Erlang and C# grades.
compiler/options.m:
Add `cli_interpreter' option to remember the name of the program which
should be used to run CLI (.NET) programs.
Add C#-related options to the help message.
compiler/options_file.m:
Remove "MS_" prefixes on MS_ILASM_FLAGS and MS_CSC_FLAGS, and remove
the extra underscore before "FLAGS". In all uses of the variables,
they were spelt without the extra underscore.
doc/user_guide.texi:
Document options and file types related to the C# grade.
library/Mmakefile:
Pass `mercury_dotnet.cs' to the C# compiler when building the standard
library. Suppress some warnings.
Allow stubs in this directory for csharp grade.
Conform to variable renamings.
library/builtin.m:
Uncomment foreign language pragmas for C#.
Handle null values in C# implementation of `deep_copy'.
library/private_builtin.m:
library/string.m:
Compare strings by ordinals in C#, instead of culture-specific rules.
Although the latter is allowed according to the documentation, it is
likely to slower, and cause confusion when porting between backends.
Handle negative index in string.set_char.
library/rtti_implementation.m:
Uncomment foreign language pragmas for C#.
`System.Type.GetType' only searches the current executing assembly or
in mscorlib for a type. As we have to be able to find types in other
assemblies (e.g. mer_std.dll or user DLLs), explicitly search through
a list of assemblies.
library/thread.semaphore.m:
Uncomment foreign language pragmas for C#.
Fix missing class qualification.
library/array.m:
library/bitmap.m:
library/bool.m:
library/dir.m:
library/exception.m:
library/io.m:
library/mutvar.m:
library/par_builtin.m:
library/region_builtin.m:
library/store.m:
library/thread.m:
library/time.m:
library/univ.m:
library/version_array.m:
Uncomment foreign language pragmas for C#.
mdbcomp/rtti_access.m:
Add type and procedure stubs.
runtime/mercury_dotnet.cs.in:
Override `Equals(object)' methods in `TypeCtorInfo_Struct' and
`TypeInfo_Struct' classes. This requires we override `GetHashCode' as
well.
Handle nulls arguments to `Equals' methods as is the expected behaviour.
Override `ToString' in `TypeCtorInfo_Struct' to produce more useful
output during debugging.
scripts/Mercury.config.in:
Record the configured CLI_INTERPRETER and pass that to the compiler as
a flag.
Conform to variable renamings.
scripts/Mmake.vars.in:
Pass value of CSCFLAGS from Mmake through to `mmc --make'.
Conform to variable renamings.
scripts/Mercury.config.bootstrap.in:
scripts/Mmake.rules:
Conform to variable renaming.
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Canonicalise high-level code, high-level-data, C# target code to the
`csharp' grade.
Handle erlang grades like other grades.
scripts/prepare_install_dir.in:
Copy `.cs' files from the runtime directory when preparing an install
directory.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
trace/Mmakefile:
Do as other non-C grades in this directory.
Conform to variable renamings.
tests/hard_coded/foreign_enum_dummy.m:
tests/hard_coded/sub-modules/non_word_mutable.m:
tests/hard_coded/sub-modules/sm_exp_bug.m:
Make these tests work in C#.
tests/mmc_make/Mmakefile:
Update a regular expression to account for `mmc --make' writing
"Making rebuild.exe" on platforms where the .exe suffix is not normally
used.
tests/mmc_make/complex_test.exp2:
Add alternative output (minor difference in floating point precision).
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
tests/general/structure_reuse/Mmakefile:
tests/hard_coded/Mmakefile:
tests/hard_coded/sub-modules/Mmakefile:
tests/par_conj/Mmakefile:
tests/stm/Mmakefile:
Disable some tests in the csharp grade.
tests/invalid/Mmakefile:
Disable some tests in the csharp grade.
Enable a test which should work in java grades.
tests/valid/Mmakefile:
Do as other non-C grades in this directory.
When testing the csharp grade in this directory, produce only the C#
target files for now.
tests/run_one_test:
Don't compress a failing test case executable when the executable is
actually only a shell script.
Estimated hours taken: 0.2
Branches: main
tests/*/Mmakefile:
Sort the lists of tests in each directory. (We usually keep each list
sorted, but then we concatenate several lists, which loses the order.)
This gives you a better idea of how far a bootcheck still has to go.
tools/bootcheck:
Build the interface files before the rest of the files in the library
directory. Again, this gives you a better idea of how far a bootcheck
still has to go.
Make the dependencies for the slice subdirectory of the stage2 at the
same time as the other subdirs; don't let it be caught later.
library/Mmakefile:
Build the interface files in the right order.
Estimated hours taken: 25
Branches: main
Add support for :- external procedures to the Erlang backend.
Add Erlang support to mmc --make.
compiler/elds.m:
Extend the ELDS for definitions of external procedures.
compiler/elds_to_erlang.m:
Move the logic for mapping a module name to a file name into
module_name_to_file_name, as it is needed for mmc --make as well.
Similarly move erlang_module_name to modules.m.
Output export annotations for :- external procedures which are
exported.
Conform to changes in the ELDS.
compiler/erl_call_gen.m:
Don't generate assignment statements between variables of dummy types.
compiler/erl_code_gen.m:
Generate skeleton ELDS definitions for external procedures.
Fix more cases where success expressions could be inserted after
`erroneous' goals. The Erlang compiler would complain about unbound
variables appearing in success expressions following erroneous goals,
because it doesn't know that the erroneous goal would throw an
exception.
Handle some special cases with `erroneous' and `failure' goals where we
used to generate code that the Erlang compiler would complain about
references to unbound variables, or variables being bound in one branch
of a conditional statement but not another, etc.
- handle a special case where the goal inside a commit scope has
determinism `failure', i.e. it would never actually commit;
- handle a special case where the condition of an if-then-else is
`erroneous', so the Then branch can't be reached;
- handle a special case where a disjunct has determinism `failure',
so later disjuncts will always be evaluated.
Generate code for promise_solutions and exist_quant scopes.
Wrap large success expressions in closures instead of duplicating them
into each disjunct, in the same way that we do for switches.
Disable duplicating of small success expressions into branches of
switches and disjunctions for now, as the implmentation is buggy.
compiler/handle_options.m:
Remove the LLDS and MLDS options from the grade_component_table entry
for the "erlang" grade. They caused compute_grade to return "none" if
only --target erlang was used (because --target erlang didn't imply the
same set of meaningless options).
compiler/hlds_pred.m:
Fix the implementations of `status_is_exported' and
`status_defined_in_this_module' for external procedures.
compiler/compile_target_code.m:
compiler/make.dependencies.m:
compiler/make.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/modules.m:
Add Erlang support to mmc --make. It can build "libraries" (we just
use directories called libFOO.beams containing Erlang .beam bytecode
files), install them and executables (which are just shell scripts
which invoke the Erlang runtime system).
Refactor some code and fix a few assumptions in places that we were
building for the C backends.
Replace some calls to io.remove_file by io.remove_file_recursively as
our Erlang "libraries" are actually directories.
Unrelated bugfix: for mmc --make --use-grade-subdirs foo.realclean,
remove the symlink created for foo.init in the current directory.
Delete module_name_to_file_name_sep as it is no longer used.
compiler/options.m:
Add options --erlang-interpreter, --erlang-object-file-extension
adn --install-command-dir-option.
doc/user_guide.texi:
Document --install-command-dir-option.
tests/mmc_make/Mmakefile:
Generate TEST_FLAGS *after* start_runtests_local as
start_runtests_local runs make realclean_local, which deletes
TEST_FLAGS.
library/io.m:
Add io.remove_file_recursively which can remove non-empty directories.
Fix the fallback implmentation io.buffer_to_string which was calling a
non-existent `from_char_list_semidet' predicate.
NEWS:
Mention io.remove_file_recursively.
Estimated hours taken: 2
Branches: main
tests/mmc_make/Mercury.options:
tests/mmc_make/Mmakefile:
tests/mmc_make/linkage_test.exp:
tests/mmc_make/linkage_test.m:
tests/mmc_make/lib/linkage_test2.m:
Add a test case for the new `--lib-linkage' option to `mmc --make'.
Fix an existing test case (complex_test) in the same directory. It was
looking for the file `../TESTS_FLAGS' while in the directory
`tests/mmc_make/lib', which doesn't exist. The workaround used is to
symlink or copy `tests/TESTS_FLAGS' into `tests/mmc_make/TESTS_FLAGS'
as necessary.
Estimated hours taken: 1
Branches: main
Fix a bug which caused `mmc --make foo.o' to fail.
compiler/make.m:
compiler/make.util.m:
Avoid returning multiple possible file types for object files.
compiler/compile_target_code.m:
For the (in, out, in) mode of maybe_pic_object_file_extension,
always return `non_pic' if the platform doesn't need special
handling for PIC.
tests/mmc_make/Mmakefile:
tests/mmc_make/build_object:
Test case.
Estimated hours taken: 0.25
Branches: main
compiler/handle_options.m:
Fix a bug which caused `--rebuild' to be disabled.
tests/mmc_make/Mmakefile:
tests/mmc_make/rebuild.m:
Test case.
Estimated hours taken: 20
Branches: main
Make it easier to use shared libraries on x86 with
`mmc --make'.
There is now a third kind of object file, `.lpic_o'.
These files are compiled with `--pic-reg' but not with
CFLAGS_FOR_PIC, so they can be linked with shared Mercury
libraries.
On x86, executables which are linked with shared Mercury
libraries now depend on $(main_module.lpic_os), not
$(main_module.os).
This doesn't work with Mmake because ml doesn't know
which libraries are Mercury libraries, so it can't
link with the static versions of those libraries if
MERCURY_LINKAGE is set to "static".
configure.in:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
Work out whether `.lpic_o' files are needed.
compiler/modules.m:
Add `.lpic_o' to the list of grade or architecture
dependent files.
NEWS:
README.Linux:
compiler/options.m:
doc/user_guide.texi:
Document MERCURY_LINKAGE, LINKAGE, --linkage,
--mercury-linkage and -R.
compiler/options_file.m:
compiler/make.program_target.m:
Handle LINKAGE and MERCURY_LINKAGE variables.
Allow LIBGRADES, LINKAGE and MERCURY_LINKAGE to be target-specific.
scripts/mmc.in:
Set up the default linkage using the MERCURY_LINKAGE
variable.
compiler/compile_target_code.m:
Build `.lpic_o' files.
Work out which type of object files to link with.
When linking statically with Mercury libraries,
find the absolute pathname for the `.a' file
for each Mercury library, and pass that to ml,
rather than just using `-lname'.
Pass `-R' options to ml for each `-R' option to mmc.
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/mercury_compile.m:
Specify which type of object files to build.
compiler/make.program_target.m:
compiler/make.module_target.m:
Make sure all generated object files are cleaned up.
compiler/prog_io.m:
Add a better message for files which can't be found.
compiler/make.util.m:
Add `.lpic_o' to the list of extensions.
compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
Pass `--linkage shared' to mmc (`--shared' is in MLFLAGS).
tests/Mmakefile:
tests/mmc_make/Mmakefile:
tests/mmc_make/Mercury.options:
tests/mmc_make/complex_test.{m,exp}:
tests/mmc_make/hello.{m,exp}:
Test `mmc --make'.
tests/lib/complex*.m:
The complex numbers library from the extras distribution,
for use in the mmc_make tests.