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.
compiler/Mercury.options:
Stop specifying --no-warn-implicit-stream-calls for make.module_target.m.
compiler/make.module_target.m:
Use explicit streams when invoking mmc recursively for a target.
Add a call to maybe_print_delayed_error_messages. It does not fix
the problem it looks like it *should* fix, but it is almost certainly
a required step for that fix.
compiler/mercury_compile_main.m:
Take the explicit streams that make.module_target.m now passes.
compiler/write_error_spec.m:
Make the mutables consulted by maybe_print_delayed_error_messages
thread local. This should help, but it does not solve the problem.
Fix an issue exposed by commit 7d001786a0.
VPATH indirectly refers to GRADESTRING_NO_TARGET.
When the VPATH is being calculated after the makefile is read,
the reference to GRADESTRING_NO_TARGET causes make to try to run the
Mercury compiler to output a grade string, but we may not yet have a
working Mercury compiler.
scripts/Mmake.vars.in:
Set EXTRA_INIT_DIRS_NO_TARGET to a non-empty string
(that references GRADESTRING_NO_TARGET in a pattern substitution)
only if EXTRA_LIB_DIRS is actually non-empty.
compiler/make.build.m:
... as opposed to what you get from io.output_stream.
Change argument order to reflect our usual style.
compiler/make.get_module_dep_info.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
Conform to the changes above.
... so that the following code can write to an *explicitly*, as opposed
to *implicitly*, specified stream.
compiler/code_gen.m:
compiler/code_info.m:
Include the stream to which debug output should be written in the
code_info structure. Move the predicate that tests whether we should
generate debug output from code_loc_dep.m to code_info.m, since it
belongs there.
compiler/code_loc_dep.m:
compiler/ite_gen.m:
compiler/proc_gen.m:
Conform to the changes above.
compiler/typecheck_info.m:
Include the stream to which debug output should be written in the
relevant field of the typecheck_info structure.
compiler/unneeded_code.m:
Include the stream to which debug output should be written in the
uc_option_values structure.
compiler/dep_par_conj.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mercury_compile_middle_passes.m:
compiler/stack_opt.m:
compiler/typecheck.m:
compiler/typecheck_debug.m:
Replace calls to io.output_stream with explicitly passed streams.
... and almost all calls to get_error_output_stream. Replace them
with ProgressStreams and ErrorStreams passed down from higher in the
call tree.
Use ProgressStreams, not ErrorStreams, to write out error messages about
any failures of filesystem operations. These are not appropriate to put
into a module's .err file, since they are not about an error in the
Mercury code of the module.
compiler/globals.m:
Delete the predicates that return progress streams, and the mutable
behind them.
compiler/passes_aux.m:
Delete the predicates that return progress streams. Delete the
versions of the progress-message-writing predicates that didn't get
the progress stream from their caller.
compiler/*.m:
Pass around ProgressStreams and/or ErrorStreams explicitly,
as mentioned at the top of log message.
In a few places, don't write out error_specs to ErrorStream,
returning it to be printed by our caller, or its caller etc instead.
In some of those places, this allowed the deletion an existing
ErrorStream argument.
Given that get_{progress,error}_output_stream took a ModuleName input,
deleting some of the calls to those predicates left ModuleName unused.
Delete such unused ModuleNames.
In a few places, change argument orders to conform to our usual
programming style.
Fix too-long lines.
GNU Make 4.4 reports undefined variable warnings about MERC_INT_DIR.
The problem is related to MERC_INT_DIR being referenced in a
$(shell ...) command, but being defined later.
scripts/Mmake.vars.in:
Move the definition of MERC_INT_DIR to Mmake.vars,
before its reference in MERC_INT_DIR_FOR_VPATH.
scripts/Mmake.rules:
Delete definition of MERC_INT_DIR from Mmake.rules.
compiler/make.top_level.m:
Put the code for recognizing the single module targets, the build-all
module targets, and the misc targets into a single giant switch.
That leaves the if-then-else chain handling only the dynamic extensions,
i.e. those whose values are specified by option values. Put the ones
dealing with executables before the ones dealing with libraries.
This prevents warnings about undefined variables $@ and $*
when running mmake with GNU Make 4.4.0.90 or above (Mantis bug 566).
scripts/Mmake.vars.in:
Define "_NO_TARGET" variants of ALL_GRADEFLAGS, ALL_MCFLAGS and
GRADESTRING variables that make no reference to target-specific
variables such as GRADEFLAGS-prog.
Add EXTRA_INIT_DIRS_NO_TARGET.
Delete MERCURY_EXTRA_INT_DIRS and MERCURY_EXTRA_INIT_DIRS,
instead referring to EXTRA_INT_DIRS and EXTRA_INIT_DIRS_NO_TARGET
directly. The variables with the "MERCURY_" prefix don't appear to
serve any purpose.
Rename UNIX_MERCURY_{EXTRA_INT_DIRS,MERC_INT_DIR,_EXTRA_INT_DIRS}
to {EXTRA_INT_DIRS,MERC_INT_DIR,EXTRA_INT_DIRS}_FOR_VPATH
so they aren't used for some other purpose.
Make EXTRA_INIT_DIRS_FOR_VPATH refer to EXTRA_INIT_DIRS_NO_TARGET
instead of EXTRA_INIT_DIRS.
Update MMAKE_VPATH to refer to the _FOR_VPATH variables,
which do not refer to any target-specific variables.
Fix some whitespace.