compiler/make.dependencies.m:
In three separate places, replace code that computed a deps_set
through an intermediate data structure with code that computes
that deps_set directly.
compiler/make.deps_set.m:
Add an auxiliary predicate needed by the new code in make.dependencies.m.
compiler/comp_unit_interface.m:
When creating .int0 files from .m files, delete the parts of the .m
parse tree *before* module qualifying it, instead of after.
This saves the time that would otherwise be needed to module qualify
those parts. The biggest saving comes from not module qualifying clauses,
though we delete some other parts as well.
compiler/parse_dcg_goal.m:
The DCG transformation adds unifications to the then-parts and else-parts
of if-then-elses. Use the contexts of the actual user code in these parts
for the compiler-generated conjunctions of which they are part.
tests/invalid/dcg_context.{m,err_exp}:
The test case from m-users which motivated this change. The error message
generated by the compiler for this code used the same context for
both the user-written then-part and the compiler-created else part
of an if-then (no else) goal in a DCG clause. The fix makes it clear,
in this instance and most others, that when mode analysis complains
about a mismatch between the two arms of the if-then-else, it is
talking about two separate pieces of code.
tests/invalid/Mmakefile:
Enable the new test case.
tests/invalid_nodepend/Mercury.options:
tests/invalid_purity/Mercury.options:
Let several test cases proceed to the compiler invocation we want to test.
tests/submodules/impl_def_literal.m:
Comment out the atomic goal in this test case. (See below for the reason.)
tests/valid/big_foreign_type.m:
tests/valid/bug318.m:
tests/valid/flatten_conj_bug.m:
tests/valid/ho_and_type_spec_bug.m:
tests/valid/mert.m:
tests/valid/param_mode_bug.m:
These test cases were missing C# definitions (and in some cases,
Java definitions) of types and/or predicates. Add them.
tests/warnings/Mercury.options:
tests/warnings/Mmakefile:
Update references to a not-long-ago renamed file.
tests/warnings/foreign_singleton.m:
Add Java and C# definitions of some predicates.
tests/warnings/foreign_singleton.exp:
Update the line numbers in the expected output for C.
tests/warnings/foreign_singleton.exp[23]:
Add these expected output files for Java and C#.
compiler/simplify_goal.m:
Generate an error message if we find an atomic goal
but we are targeting a language which has no definitions
for the primitive operations used in the implementation of such goals.
Until now, for tests/submodules/impl_def_literal.m (which until now
contained an atomic goal), the compiler would generate code that
aborted at runtime. We report the problem, which avoids the generation
of code that would abort.
Traditionally, we always wrote out parse trees (of .intN files, for example)
to a file. However, we have also supported being able to write out *parts*
of parse trees to strings, because that ability is useful e.g.
- in error messages, printing the code that the error message is about,
- when debugging.
We are considering a use case which requires the ability to write out
the *whole* parse tree of a .intN file to a string. That use case is
comparing whether the old and new versions of a .intN file are identical
or not, because we want to update the actual .intN file only if they
differ. (Updating the .intN file if they are identical could trigger
the unnecessary recompilation of an unbounded number of other modules.)
Previously, we have done this comparison by writing out the new parse tree
to an .intN.tmp file, and compared it to the .intN file. It should be simpler
and quite possibly faster to
- read in the old .intN file as a string
- convert the new parse tree to a string
- compare the two strings
- write out the new string if and only if it differs from the old string.
This should be especially so if we can open the .intN file in read-write mode,
so the file would need to be opened just once, in step one, even if we do
need to write out the new parse tree in step four.
compiler/parse_tree_out.m:
Add functions to convert parse_tree_int[0123]s to strings.
To avoid having to reimplement all the code that currently writes
out those parse trees, convert the current predicates that always do I/O
into predicates that use the methods of the existing pt_output type class,
which, depending on the selected instance, can either do I/O or can build
up a string. This conversion has already been done for the constructs
that make up some parts of those parse trees; this diff extends the
conversion to every construct that is part of parse trees listed above.
As part of our existing conventions, predicates that have been
generalized in this way have the "output" or "write" in their names
replaced with "format".
We also perform this generalization for the predicates that write out
parse_tree_srcs and parse_tree_module_srcs, because doing so requires
almost no extra code.
compiler/parse_item.m:
compiler/parse_tree_out_clause.m:
compiler/parse_tree_out_info.m:
compiler/parse_tree_out_inst.m:
compiler/parse_tree_out_misc.m:
compiler/parse_tree_out_pragma.m:
compiler/parse_tree_out_pred_decl.m:
compiler/parse_tree_out_type_repn.m:
compiler/prog_ctgc.m:
Perform the generalization discussed above, both on predicates
that write out Mercury constructs, and on some auxiliary predicates.
In a few cases, the generalized versions already existed but were private,
in which case this diff just exports them.
In a few cases, rename predicates to avoid ambiguities.
compiler/add_clause.m:
compiler/hlds_out_goal.m:
compiler/hlds_out_pred.m:
compiler/hlds_out_type_table.m:
compiler/hlds_out_typeclass_table.m:
compiler/intermod.m:
compiler/intermod_analysis.m:
Conform to the changes above.
compiler/comp_unit_interface.m:
When we cannot generate a .int0/.int/.int2 file because of file access
issues, the reason is *usually* that we can't read a .int3 file.
However, it is also possible that the reason is that we can't read
a .int0 file, so include that possibility in the overall error message.
(The "can't read this file" message, with the specifics of the file
that couldn't be read, would have been printed earlier.)
tests/invalid_make_int/missing_parent_import.int_err_exp:
tests/invalid_make_int/sub_c.int_err_exp:
tests/invalid_make_int/test_nested.int_err_exp:
Expect the updated error message.
tests/invalid/foreign_enum_invalid.{m,err_exp}:
Delete the "foreign enum in interface" error from this test case,
moving it to invalid_make_int/bad_in_interface.
tests/invalid/foreign_type_visibility.err_exp2:
tests/invalid/foreign_type_visibility.err_exp3:
Add these expected outputs for Java and C# respectively.
tests/invalid/foreign_type_visibility.m:
Document the new expected output files.
tests/invalid/foreign_type_visibility.err_exp:
Update for changed line numbers.
tests/invalid/foreign_include_file_missing.m:
Fix indentation.
tests/invalid/Mercury.options:
Allow a test case to get past the creation of interface files.
tests/invalid_make_int/bad_in_interface.{m,int_err_exp}:
Move the "foreign enum in interface" part of invalid/foreign_enum_invalid
here.
tests/invalid_make_int/bad_in_interface.{m,int_err_exp}:
New test case containing the parts of the old test cases
external_in_interface, fact_table_in_interface and
foreign_proc_in_interface, all in tests/invalid_nodepend,
that the compiler now reports when creating .int files.
This test case replaces the external_in_interface and
foreign_proc_in_interface test cases, since the only other thing
they tested was the "no clauses for pred/func ..." message,
which is also tested by several other test cases.
tests/invalid_make_int/type_vars_int.{m,int_err_exp}:
tests/invalid_make_int/unbound_type_vars_int.{m,int_err_exp}:
New test cases containing the parts of the old test cases
invalid_nodepend/type_vars and invalid_nodepend/unbound_type_vars
respectively containing the errors that the compiler now reports
when creating .int files.
tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
List the new test cases being added to this directory.
tests/invalid_nodepend/bad_fact_table.m:
The part of the old invalid_nodepend/fact_table_in_interface test case
that the compiler does NOT report when creating .int files.
Due to the removal of the parts that ARE reported at that time,
the old name is no longer appropriate.
tests/invalid_nodepend/bad_fact_table.err_exp:
tests/invalid_nodepend/bad_fact_table.err_exp2:
Update these two old expected output files for the changes in the
file name and the line numbers.
tests/invalid_nodepend/bad_fact_table.err_exp3:
Add this new expected output file for bootchecks that use mmc --make.
(The .m file contains an explanation of its contents.)
tests/invalid_nodepend/bug410.{m,err_exp}:
Fix a syntax error that would be reported at .int file creation time,
and achieve its effect by simply commenting out the declaration
whose absence results in the actual errors whose handling
this test case is checking.
tests/invalid_nodepend/external_in_interface.{m,err_exp}:
tests/invalid_nodepend/foreign_proc_in_interface.{m,err_exp}:
Delete these test cases, which are replaced by
invalid_make_int/bad_in_interface.m.
tests/invalid_nodepend/fact_table_in_interface.{m,err_exp,err_exp2}:
Delete this test case, which is replaced by
invalid_nodepend/bad_fact_table.
tests/invalid_nodepend/type_vars.{m,err_exp}:
tests/invalid_nodepend/unbound_type_vars.{m,err_exp}:
Delete the parts of these test cases that are now in
invalid_make_int/{,unbound_}type_vars_int.
tests/invalid_nodepend/Mmakefile:
Apply the two deletions and the rename to the list of test cases.
tests/invalid_nodepend/Mercury.options:
Apply the two deletions and the rename to the list of test cases.
Specify --no-halt-at-invalid-interface for a whole bunch of test cases,
allowing the compiler, even Java/C# bootchecks, to proceed past
the errors reported when creating .int files.
tests/invalid_make_int/bad_finalise_int.{m,int_err_exp}:
tests/invalid_make_int/bad_initialise_int.{m,int_err_exp}:
tests/invalid_make_int/bad_mutable_int.{m,int_err_exp}:
tests/invalid_make_int/bad_foreign_type_int.{m,int_err_exp}:
New test cases containing the discoverable-at-interface-file-creation-time
parts of the correspond test cases in tests/invalid_nodepend without
the _int suffix on the test case name.
tests/invalid_make_int/missing_initial_section.{m,int_err_exp}:
New test case containing the discoverable-at-interface-file-creation-time
parts of tests/invalid_nodepend/duplicate_modes.m.
tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
Enable the new test cases.
tests/invalid_nodepend/bad_finalise_decl.{m,err_exp}:
tests/invalid_nodepend/bad_foreign_type.{m,err_exp}:
tests/invalid_nodepend/bad_initialise_decl.{m,err_exp}:
tests/invalid_nodepend/bad_mutable.{m,err_exp}:
tests/invalid_nodepend/duplicate_modes.{m,err_exp}:
Delete the parts of these test cases that have been moved to
tests/invalid_make_int.
compiler/check_typeclass.m:
Don't module qualify the names of type constructors in which are
reporting a problem regarding typeclass constraints.
tests/invalid_make_int/bad_detism_category.{m,int_err_exp}:
tests/invalid_make_int/bad_end_module.{m,int_err_exp}:
tests/invalid_make_int/bad_existential_data_type.{m,int_err_exp}:
Move these test cases here from tests/invalid_nodepend, since
most of the errors they report are now diagnosed when making .int files.
Delete the code leading to the two errors that do not fall into this
category. One of those errors is still exercised by a remnant of the
old moved test case, which is now undetermined_existential_data_type.m
in tests/invalid_make_int; the other is exercised by other test cases
that this diff does not touch.
tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
Add the moved test cases to the list of test case in this directory.
tests/invalid_nodepend/fundeps_unbound_in_ctor.err_exp:
tests/invalid_nodepend/type_vars.err_exp:
Update these files to expect an unqualified type constructor name.
tests/invalid_nodepend/undetermined_existential_data_type.{m,err_exp}:
Construct this copy by deleting from the old bad_existential_data_type.m
all the code moved to tests/invalid_make_int.
tests/invalid_nodepend/Mmakefile:
Delete the moved test case, and update the name of the remaining test case.
compiler/det_analysis.m:
Improve an error message about foreign_procs by printing it with
the context of the foreign_proc itself, not the context of the
procedure it is for. Also, make the wording more specific.
compiler/prog_event.m:
Reading event sets is currently implemented when the compiler
is compiled for the C backend (because its parser uses lex/flex
and yacc/bison). However, that is no reason for crashing the compiler if
- someone asks it to read an event set
- while the compiler is compiled to a target language other than C.
Fix this by returning an apology message instead of crashing.
tests/invalid/pragma_c_code_no_det.m:
tests/invalid/test_may_duplicate.m:
tests/invalid/test_may_export_body.m:
Add foreign procs for Java and C# as well as for C.
tests/invalid/pragma_c_code_no_det.err_exp{,2,3}:
tests/invalid/test_may_duplicate.err_exp{,2,3}:
tests/invalid/test_may_export_body.err_exp{,2,3}:
Add expected output files for Java and C#. Update the line numbers
in the expected file for C.
tests/invalid/test_type_spec.m:
Delete the parts of this test case that contain errors that we now report
when creating .int files. We now test for those errors using the new test
case tests/invalid_make_int/test_type_spec_int.
tests/invalid/test_type_spec.err_exp:
Delete the messages for the deleted errors, expect verbose errors
(see the update of Mercury.options below), and update the line numbers.
tests/invalid/try_detism.m:
Explain the reason for the need for the new .err_exp2 file.
tests/invalid/try_detism.err_exp{,2}:
Add the new .err_exp2 file for C#, which differs from the .err_exp file
only in the variable number of a compiler-generated variable.
Update the line numbers in the .err_exp file.
tests/invalid/undef_type.m:
Fix the one problem in this test case that we now report when we create
.int files. The handling of that problem is now tested in the new
tests/invalid_make_int/undef_type_int test case.
tests/invalid/undef_type.err_exp:
Don't expect a report for the fixed error.
tests/invalid/Mercury.options:
Run the test_type_spec test case with verbose errors.
tests/invalid/Mmakefile:
Don't try to execute the test cases that this diff moves to
tests/invalid_make_int.
Execute the test cases that try to read event set specifications
only when targeting C. This is not the exact condition we want,
but it is the closest to that condition that we can actually get.
tests/invalid_make_int/bad_instance.{m,int_err_exp}:
tests/invalid_make_int/type_arity.{m,int_err_exp}:
tests/invalid_make_int/undef_inst.{m,int_err_exp}:
tests/invalid_make_int/undef_mode.{m,int_err_exp}:
tests/invalid_make_int/undef_type_mod_qual.{m,int_err_exp}:
Move these tests here from tests/invalid.
tests/invalid_make_int/test_type_spec_int.{m,int_err_exp}:
tests/invalid_make_int/undef_type_int.{m,int_err_exp}:
The parts of the test_type_spec and undef_type test cases in tests/invalid
that get error messages generarated for them while making .int files.
tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
Add the tests moved here, in whole or in part, from tests/invalid.
compiler/add_foreign_proc.m:
Don't module qualify the named of predicates/functions
defined by foreign_procs when generating an error message
about that foreign_proc, since
- you can add foreign_procs only for local predicates/functions, and
- even if you one for a NON-local predicate/function, the context will
tell you exactly which foreign_proc is being complained about.
Also, improve the wording of the error message.
tests/invalid/instances_pc.instances_pc_helper_1.err_exp2:
tests/invalid/instances_pc.m:
Add a new expected output file for bootchecks in C# and Java grades,
and document the new expected output file.
tests/invalid/pragma_c_code_dup_var.{err_exp2,err_exp3}:
tests/invalid/pragma_c_code_dup_var.{m,err_exp}:
Add two new expected output files for bootchecks in C# and Java grades.
Note the role of each expected output file, and apply the resulting
line number changes to the expected output file for C.
tests/invalid_make_int/instance_no_type.{m,int_err_exp}:
Move this test case from tests/invalid to tests/invalid_make_int,
since the compiler now diagnoses the bug it tests for
during the creation of the .int file.
tests/invalid_make_int/pragma_export_int.{m,err_exp}:
Move half of the pragma_export test case here from tests/invalid,
since the compiler now diagnoses the bug it tests for
during the creation of the .int file.
tests/invalid_nodepend/pragma_export.{m,err_exp}:
Move the other half of the pragma_export test case here from tests/invalid.
With mmc --make, the diagnosable-at-.int-file-creation-time errors
prevent the compiler from ever getting to the errors that are not
diagnosable at that time, so delete the code that gives rise to those
diagnosable-at-that-time errors from this version of the test case..
tests/invalid/Mmakefile:
Delete the tests moved to other test directories.
tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
tests/invalid_nodepend/Mmakefile:
Add the tests moved to these directories from tests/invalid.
compiler/make.program_target.m:
All the multimodule tests in tests/invalid_make_int have been failing
in C# grades. The script for these tests has two main steps:
- build all the .int3 files involved, and then
- build the .int file.
The second step is expected to fail, with its error messages being tested,
but the first step is expected to succeed. The test cases were failing
because mmc --make built the .int files as part of the FIRST stage.
The cause was code that built all interface files (.int3, .int0,
.int/.int2 and even .opt) as a preliminary first step before actually
trying to act on *any* build-all target. The fix is to make this
preliminary step build only the interface files that come before
the build-all target's file kind in the build order. In this case,
that means not building anything in the preliminatu step of the
build-all-int3s target before building all the .int3s, thus leaving
the construction of the .int file for the second step, which is
*expected* to fail.
tests/invalid/exported_unify_helper_1.m:
Rename exported_unify2.m to exported_unify_helper_1.m in accordance
with our usual scheme.
tests/invalid/exported_unify.{m.err_exp,err_exp2}:
Update both expected error files for the rename. Since the .err_exp2 file
was ancient, this update fixed the test case failure for C# (and almost
certainly for Java) bootchecks. Note the role of each expected output
file in the source code.
tests/invalid/foreign_procs_exist_type.err_exp2:
tests/invalid/foreign_procs_exist_type.err_exp3:
Add these files containing the expected outputs for Java and C#.
tests/invalid/foreign_procs_exist_type.m:
Add a note about the role of each expected output file.
tests/invalid/foreign_procs_exist_type.err_exp:
Update the line numbers for this file containing the C expected output.
tests/invalid/foreign_purity_mismatch.m:
tests/invalid/fp_dup_bug.m:
For each C foreign proc being tested, add C# and Java foreign_procs
as well.
Add a note about the role of each expected output file.
tests/invalid/foreign_purity_mismatch.err_exp2:
tests/invalid/foreign_purity_mismatch.err_exp3:
tests/invalid/fp_dup_bug.err_exp2:
tests/invalid/fp_dup_bug.err_exp3:
Add these files containing the expected outputs for Java and C#.
tests/invalid/foreign_purity_mismatch.err_exp:
tests/invalid/fp_dup_bug.err_exp:
Update the line numbers for this file containing the C expected output.
tests/invalid/gh72_errors.m:
This test case tests an error message from the direct arg transformation.
This transform does not apply to C# and Java grades, so in those grades,
the compiler does not generate those messages. In those grades, this
test case failed because the compilation succeeds, instead of failing
(with the expected message, or not).
Fix this failure by adding to gh72_errors.m C# and Java foreign_procs
that do get error messages.
tests/invalid/gh72_errors.err_exp2:
tests/invalid/gh72_errors.err_exp3:
Expect these error messages in C# and Java grades respectively.
tests/invalid/gh72_errors.err_exp:
Update the line numbers in the error messages during C compilations.
compiler/options.m:
doc/user_guide.texi:
Add a new developer-only option, --std-int-file-not-written-msgs,
which, if specified, calls for the "file not written" messages
we generate when we want to write interface files but can't
to be written out in a standard form that deletes the directory
path component from the names of the files not written out.
In the long term, it is less work to add this option once
than to add a separate .err_exp file for each affected test case.
compiler/write_module_interface_files.m:
Obey the new option.
tests/invalid/ee_invalid.m:
Add C# and Java foreign_types next to the C foreign_type.
tests/invalid/erroneous_throw_promise.m:
Add C# foreign_procs next to the C and Java foreign_procs.
tests/invalid/exist_foreign_error.m:
Add C# and Java foreign_procs next to a C foreign_proc.
tests/invalid/exist_foreign_error.err_exp:
tests/invalid/exist_foreign_error.err_exp2:
tests/invalid/exist_foreign_error.err_exp3:
Update the line number in the expected error output file for C,
and add expected error output files for Java and C#.
tests/invalid_make_int/bug17.{m,int_err_exp}:
tests/invalid_make_int/builtin_int.{m,int_err_exp}:
Move these test cases here from tests/invalid, since all the errors
we test for are reported when making the .int file.
tests/invalid/Mmakefile:
Delete the tests moved to tests/invalid_make_int.
tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
Add the tests moved from tests/invalid. Specify the new option
for all the test cases.
compiler/write_module_interface_files.m:
compiler/comp_unit_interface.m:
Move the predicates that generate the parse trees of interface files
from write_module_interface_files.m to comp_unit_interface.m.
Move the types they need with them, and document them.
Rename the predicates involved to make clear whether they generate
parse trees, write them out, or both.
In comp_unit_interface.m keep private the previously exported predicates,
because their only callers are the moved predicates, so all calls them
are now local to the module.
compiler/make.get_module_dep_info.m:
compiler/mercury_compile_main.m:
Conform to the changes above.
compiler/write_module_interface_files.m:
Put the code that writes out parse_tree_intNs in separate predicates
from the code that generates them.
This separation is useful in situations in which
- we need to generate several .intN files as fast as possible, and
- later operations will need access to the contents of those files.
With the current setup, we can call e.g. write_short_interface_file_int3
on several parse_tree_module_srcs in parallel, but this comes at the cost
of each worker process building up only its own have_parse_tree_maps
"database" of parse trees. This means if worker process A generates
an interface file, another worker process B will need to read that
interface file to get access to its contents.
With the setup created by this diff, we can generate all the parse trees
for the interface files in the main process, keeping *all* their parse
trees in its have_parse_tree_maps structure, and hand off each parse tree
as it is constructed to a worker process for writing out.
tests/invalid/any_to_ground_in_ite_cond_nomax.m:
Add C# and Java foreign_procs next to a C foreign_proc.
tests/invalid/bad_fact_table_data.err_exp2:
Add the expected output for this test case in grades that
do not support fact tables.
tests/invalid/bad_fact_table_data.m:
Document which expected output files is expected to be matched
in which bootchecks.
compiler/globals.m:
Add to the globals a new structure that maps extension strings
(such as ".o", ".a" or ".all_picos) to a representation of what
mmc --make target they represent.
compiler/handle_options.m:
Build up this map by processing the values of the options
object_file_extension
pic_object_file_extension
executable_extension
library_extension
shared_library_extension
checking them for collisions both with each other's values,
and with the fixed ".install" extension.
compiler/make.top_level.m:
Use the new map to simplify the code that converts extensions
to mmc --make targets.
These are issues I encountered while working on my previous commit
involving grab_modules.m.
compiler/make.make_info.m:
Give a name to the type that implements the data structure
that we usually use variables named DepStatusMap to refer to.
Rename the make_info field holding this data structure
from mki_dependency_status, which could mean any of several things,
to mki_dep_file_status_map, which pretty clearly says it maps
dependency_files to status information. (mki_dependency__file_status_map
would have been too long.) Rename the getter/setter predicates
accordingly.
compiler/make.check_up_to_date.m:
Do a similar clarifying rename on a predicate.
Convert an if-then-else to a switch.
Add a long XXX describing a problem I found while investigating
with some temporarily-failing test cases. Those test cases now succeed
despite the presence of this bug.
compiler/make.get_module_dep_info.m:
Delete code to write out error_specs that later code is guaranteed
to also write out on all possible execution paths. This resulted
in double-printed error messages in some test cases, which succeeded
despite this, because this problem occurred during compilation tasks
(such as the creation of .int3 files) that the test cases do NOT involve.
Speed up a search/insert operation pair.
compiler/mercury_compile_main.m:
Fix a sort-of bug that that included some error_specs in a list of
error_specs twice. The code writing out the error_specs would have
deleted the duplicates, but still, it is better to avoid adding
the duplicates in the first place.
compiler/make.program_target.m:
Merge two pairs of adjacent switches.
compiler/make.module_target.m:
Conform to the changes above.
compiler/grab_modules.m:
grab_{qual,unqual}_imported_modules_*, the two main predicates
of this module, have for a while now taken as input both a
parse_tree_module_src, and several separate arguments each describing
part of the origin of that parse_tree_module_src. They then created
a new module_baggage structure, filling some of its fields using
those arguments, but filling other fields with default values,
which were no more than guesses at what the right value might be.
This has obviously worked, but it could work only because
the guessed-at fields are either not used or were guessed well.
However, this may change in the future. After this diff, we now require
the caller to pass to these predicates a fully-and-correctly-filled-in
module_baggage structure instead, which guards against that
possibility, and leads to cleaner and more understandable code
to boot.
We do throw away any errors in the initial module_baggage
in order to prevent parts of the compiler that aren't set up
to handle any errors there from causing additional test failures
in C# (and probably Java) grades. This preserves old behavior,
at least for now.
compiler/write_module_interface_files.m:
Make the versions of write_private_interface_file_int0 and
write_interface_file_int1_int2 that took a burdened_module
as an argument the *only* versions of those operations,
since the burdened_module contains the module_baggage structure
we now want to pass to grab_modules.m.
Replace the parse_tree_module_src argument of
write_short_interface_file_int3 with a burdened_module.
This is only for "cultural compatibility" with the neighboring
predicates; unlike those two, this predicate does not need access
to the module_baggage.
compiler/make.get_module_dep_info.m:
compiler/mercury_compile_main.m:
Conform to the changes above.
compiler/module_baggage.m:
Fix a misleading variable name.
Writing trace counts the default trace count file aborts on Windows due to the
program basename not being stripped of drive and directory qualifications.
Use the machinery introduced in commit 54de823 to avoid this.
Add XXX WINDOWS comments about other potential problems with the trace counts
mechanism on Windows.
runtime/mercury_trace_base.c:
When constructing the default name for trace counts files, use the recently
add MR_get_program-basename() function to extract the program basename.
Add XXX WINDOWS comments about some other things. Resolving these will
be the subject of future changes.
runtime/mercury_runtime_util.c:
Adjust an error message.
compiler/split_parse_tree_src.m:
Rename split_into_compilation_units_perform_checks to
split_into_component_modules_perform_checks. The type of the returned
data structures was changed from raw_compilation_units to
parse_tree_module_srcs a while ago.
Perform the same rename for some internal predicates as well.
Factor out some common code.
compiler/mercury_compile_main.m:
compiler/module_baggage.m:
Conform to the changes above.
Several places in the runtime make use of the program basename. This is
computed by stripping any directory qualification from the value of argv[0].
Currently, this is done by searching for uses of '/' as a directory separator.
This does not work on Windows where '\' is the directory separator and paths
may also be drive qualified. This diff adds a function that will handle
Windows-style paths.
Also, none of the uses of the program basename in the runtime currently account
for the presence of the .exe executable extension on Windows. After this diff,
users won't have to, and in fact will not be allowed to, include the .exe
extension in the program name in these contexts.
runtime/mercury_runtime_util.[ch]:
Add a function, MR_get_program_basename(), whose job is
to strip any drive or directory qualification, and the executable
extension from a given path. On Windows, we use the OS's splitpath()
function to do this.
Add an XXX about the .exe extension on Cygwin.
runtime/mercury_wrapper.c:
Use the new function when computing:
- the name of the program-specific MERCURY_OPTIONS environment variable;
- the value of the --trace-count-if-exec runtime option;
- the value of the --coverage-test-if-exec runtime option.
doc/user_guide.texi:
Document that the .exe extension is not expected in the three spots above.
... instead of ErrorStream, in more places.
compiler/compile_target_code.m:
compiler/file_util.m:
compiler/handle_options.m:
compiler/mercury_compile_front_end.m:
As above.
compiler/make.program_target.m:
compiler/mercury_compile_main.m:
compiler/xml_documentation.m:
Don't pass ErrorStream to predicates that don't need it anymore.
... to account for the fact that they now contain constructed parse trees,
as well as read-in parse trees.
compiler/read_modules.m:
Make the rename described above.
Make it possible to differentiate between constructed and read-in
parse trees, in case this becomes necessary in the future.
compiler/deps_map.m:
compiler/generate_dep_d_files.m:
compiler/grab_modules.m:
compiler/make.get_module_dep_info.m:
compiler/make.make_info.m:
compiler/mercury_compile_main.m:
compiler/mercury_compile_make_hlds.m:
compiler/recompilation.check.m:
compiler/write_module_interface_files.m:
Conform to the changes above.
In make.get_module_dep_info.m, add an XXX.
configure.ac:
Require the installed compiler to support both the option,
and the Mmake rules that invoke it.
compiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
ssdb/Mmakefile:
Get the mmake depend to depend on prog.depend_ints, not prog.depend,
Give the prog.depend_ints targets themselves the same prerequisites
as the existing prog.depend targets.
In mfilterjavac/Mmakefile, fix what looks like an old problem
by making the depend target a prerequisite of the check and ints targets.
.. that failed because the "For more information, recompile with `-E'
message was missing.
This diff takes the number of failed test cases in these grades
from 228-ish to 171.
compiler/make.module_target.m:
Stop calling the predicate that outputs that message outside
of the part of mmc --make's machinery that can fork the compiler process,
and ...
compiler/mercury_compile_main.m:
... ensure that it is called *inside* the forked process, in such cases.
Do this by ensuring that
- each switch arm in do_process_compiler_arg gathers up the error_specs
generated by code executed along that switch arm, and
- after the switch, do_process_compiler_arg prints both these
error_specs, *and* the "For more information, recompile with `-E'
message if warranted.
Previously, the last of those points happened on some execution paths,
but not all.
... instead of ErrorStream.
compiler/parse_tree_out.m:
As above.
compiler/make.get_module_dep_info.m:
compiler/mercury_compile_main.m:
compiler/write_module_interface_files.m:
Don't pass ErrorStream to predicates that don't need it anymore.
compiler/check_typeclass.m:
Delete the verbose_only part of an error message, because it duplicated
almost exactly the always-printed part of the same error message.
tests/invalid/instance_var_bug.err_exp:
Don't expect the verbose part.
tests/invalid/bad_instance2.err_exp:
tests/invalid/invalid_instance_declarations.err_exp:
Don't expect a reminder about the existence of the verbose part.
tests/invalid/bad_exported_mode.err_exp2:
Update the name of a recently moved file in the context.
tests/invalid/bad_exported_mode.m:
Add a comment specifying when we expect each .exp_exp* file to match.