library/type_desc.m:
Check for TypeInfo.args == null to avoid a null pointer exception.
This is necessary for the Java grade.
Make the corresponding change for C# grade for consistency,
though it does not appear to be necessary.
library/rtti_implementation.m:
Return zero arity for null TypeInfo.args arrays. This fixes the
failure of the hard_coded/pretty_printing test case in the Java grade,
and probably in the C# grade as well.
tests/general/read_dir_regression.m:
Fix the failure of the failure of this test case in the Java grade,
by massaging the error message returned for an intentionally-failed
open of a directory as a plain file. When opening ".", the error message
(on my laptop, at least) returns the full absolute path name of the
current directory. Since this will be different in different workspaces,
we can't update the expected output file, but we can replace this
changeable part of the error message with a fixed string. This diff
does this.
tests/hard_coded/ho_solns.m:
Add a note about the cause of the failure of this test case.
tests/hard_coded/string_code_point.exp2:
Conform to the old switchover from the "codepoint" spelling
to "code_point".
tests/feedback/mandelbrot_dir:
tests/feedback/mmc_dir:
Add "_dir" suffixes to the names of these two subdirectories.
The reason is that when doing a bootcheck in the java or C# grades,
which always use mmc --make, the realclean action we executed
for each test, mandelbrot and mmc, in this directory,
deleted these directories, because their names coincided
with the names of what would have been the executables
in these tests. (Of course, part of the problem is that
the realclean action effectively executed "rm -r" instead of
just "rm" when it *thought* it was removing an executable.)
tests/feedback/Mmakefile:
Tell the tests to get the deep profiling data files from the
updated directory names.
And give more consistent names to some predicates.
compiler/mercury_compile_augment.m:
Move the code that controls the compilation of .c files to .o
for the LLDS backend here from mercury_compile_llds_back_end.m,
to allow the similarities and dissimilarities between the MLDS
and LLDS backends to be seen easily.
Delete the part of the moved code that wrote out .mh files
for a SECOND time.
Rename some predicates.
compiler/mercury_compile_llds_back_end.m:
Delete the code moved to mercury_compile_augment.m. Export some
predicates needed by the moved code.
compiler/mercury_compile_mlds_back_end.m:
Rename a predicate.
compiler/export.m:
Simplify the interface of this module.
doc/mercury_user_guide.texi:
Fit the compilation section into its new position.
Fix the description of C# compilation.
scripts/mgnuc.in:
Change the help message NOT to assume that the C compiler is gcc,
since we have supported other C compilers as well for a long time.
Move a comment to the code it applies to.
compiler/mercury_compile_augment.m:
Add a comment.
compiler/export.m:
Replace /* */ C commments with // commments.
... and change the extensions of the files to which it writes its output, from
.order and order_trans_opt to .module_order and .module_order_for_trans_opt.
compiler/options.m:
Change the name of the option from --generate-module-order
to --also-output-module-order, while keeping the old external name
as well for now. Update its documentation accordingly.
Document the private option --trans-opt-deps-spec more extensively.
compiler/file_names.m:
Change the extension strings we use for those two files.
NEWS.md:
Announce the change in the option name and in the *public* file extension.
compiler/opt_deps_spec.m:
Refer to the option by its new internal name.
tests/warnings/help_text.err_exp:
Expect the updated option names and help text.
compiler/quantification.m:
Consistently use "NonLocals" to refer to these sets. Previously,
many predicates used that terminology, but many others used
"NonLocalVars". "NonLocals" is what we use in the rest of the compiler.
Document the quant_info structure better.
compiler/quantification.m:
Define and use data types for explicitly associating goals
in conjunctions with the variables that occur after them
in the conjunction. This requires allocating a bit more memory,
but allows us to replace iterating over two lists with iterating
over one list. There is no measurable effect on overall performance.
compiler/superhomogeneous_lambda.m:
Carve the code handling lambda expressions out of superhomogeneous.m.
This code was about 49% of the code of the module.
compiler/superhomogeneous_util.m:
Carve some utility types and predicates out of superhomogeneous.m,
since it now also needed by superhomogeneous_lambda.m.
Also, delete the unused function unify_var_term_project_var.
compiler/superhomogeneous.m:
Delete the moved code.
compiler/make_hlds.m:
compiler/notes/compiler_design.html:
Include and document the new modules.
compiler/add_clause.m:
compiler/field_access.m:
compiler/goal_expr_to_goal.m:
Conform to the changes above.
... and move a predicate to be with similar predicates.
compiler/typecheck_util.m:
Move the typecheck_var_has_type_2 predicate here from typecheck_clauses.m,
give it a more descriptive name, and give it a simpler-to-understand
interface.
Give another predicate a more descriptive name as well.
compiler/typecheck_clauses.m:
Delete the predicate moved to typecheck_util.m.
Conform to the changes above.
compiler/typecheck_unify_var_functor.m:
Conform to the changes above.
The non .par LLDS grades currently "support" concurrency. However, this support
is really only usable with a small few benchmark programs, due to the inability
of the implementation to switch threads if the executing thread blocks. Disable
this capability by causing spawn/3 to abort if used in non .par LLDS grades.
library/thread.m:
Make the above change to spawn/3.
compiler/globals.m:
Update the code that checks if the current grade supports concurrency.
compiler/options.m:
Adjust documentation for the --parallel option.
tests/warnings/help_text.err_exp:
Conform to the above change.
compiler/options.m:
Move --warn-simple-code to the "warnings about dodgy code"
category, as
- most of the issues that it warns about are indeed evidence
of dodgy code, and
- its existing documentation also states that it is intended
to report likely-to-be-incorrect code.
Change the internal name of --warn-simple-code, in order to force
all its existing uses to be reclassified.
Let the --warn-redundant-code part stay in the style issues category,
since the code will work just the same if the redundancies are removed.
NEWS.md:
Announce the new option.
compiler/simplify_goal_call.m:
Reclassify all uses of --warn-simple-code.
Add a missing condition in an if-then-else.
compiler/add_clause.m:
compiler/add_type.m:
compiler/check_type_inst_mode_defns.m:
compiler/convert_import_use.m:
compiler/convert_parse_tree.m:
compiler/det_analysis.m:
compiler/det_infer_goal.m:
compiler/mercury_compile_front_end.m:
compiler/mode_errors.m:
compiler/simplify_goal.m:
compiler/simplify_goal_disj.m:
compiler/simplify_goal_ite.m:
compiler/simplify_info.m:
compiler/simplify_tasks.m:
compiler/state_var.m:
Reclassify all uses of --warn-simple-code.
tests/warnings/help_text.err_exp:
Expect the updated help text.
compiler/options.m:
Rename the internal names of these three options. Keep the old
external names, but make the main external name the new name.
NEWS.mdb:
Announce the renames.
compiler/check_options.m:
compiler/det_check_proc.m:
compiler/det_check_switch.m:
compiler/simplify_goal_ite.m:
Conform to the change above. Change the severity of the messages
controlled by the changed options severity_warning.
tests/warnings/help_text.err_exp:
Expect the updated help text.
The objective of this step is two-fold:
- to fix --inhibit-warnings, making it shut up all warning
and informational messages; and
- to ensure that it *stays* fixed, even when after new diagnostics
are added.
As part of this fix, this diff adds a whole bunch of new warning
options, in order to control the warnings that previously were
not controlled by any option. (There was no need for new
informational options.)
As it happens, we have long used severity_informational for messages
that did not report any information about the code being compiled,
but to report actions that the compiler was taking. Create a new
option category, oc_report, for the new options that now control
those diagnostics.
---------------------
compiler/error_spec.m:
Change severity_warning and severity_informational to take an option
as as argument. The semantics is that the diagnostic in which
the severity occurs is conditional on that option, meaning that
it is printed only if that option is set to "yes".
Delete the severity_conditional function symbol from the severity
type, since the mechanism just above handles its only use case.
Define subtypes to represent error_specs in a standard form.
compiler/error_sort.m:
Provide operations to convert error specs into their standard form.
Make the sorting operation itself operate on the standard form.
compiler/write_error_spec.m:
Convert error_specs to standard form before writing them out,
in order to avoid duplicating the code for their standardization.
Change the code that writes out error_specs to operate on the
standard form. Implement the test implicit in the warning and
and informational severities in this code.
compiler/error_util.m:
compiler/compiler_util.m:
Delete operations that do not make sense with the new severity type.
---------------------
compiler/options.m:
Add new options to control all the previously-uncontrolled
warning and informational messages.
NEWS.md:
Announce the *public* new options.
compiler/option_categories.m:
compiler/print_help.m:
Add the new option category, and fake-include it in the help text
and the user guide. (The inclusion is fake because none of the
options in the new category are user visible, meaning the section
containing them is not visible either.)
---------------------
compiler/det_infer_goal.m:
Start a severity warning diagnostic with "Warning:"
instead of "Error:".
compiler/mark_trace_goals.m:
Fix an incorrect error message.
compiler/purity.m:
Replace a correct/incorrect color pair with two inconsistent colors,
because there is a reasonable probability of each one being right.
---------------------
compiler/accumulator.m:
compiler/add_clause.m:
compiler/add_mode.m:
compiler/add_pragma.m:
compiler/add_pragma_tabling.m:
compiler/add_pred.m:
compiler/add_type.m:
compiler/check_module_interface.m:
compiler/check_type_inst_mode_defns.m:
compiler/check_typeclass.m:
compiler/color_schemes.m:
compiler/common.m:
compiler/convert_import_use.m:
compiler/convert_parse_tree.m:
compiler/dead_proc_elim.m:
compiler/det_check_proc.m:
compiler/det_check_switch.m:
compiler/det_infer_goal.m:
compiler/du_type_layout.m:
compiler/format_call_errors.m:
compiler/grab_modules.m:
compiler/hlds_call_tree.m:
compiler/inst_check.m:
compiler/introduce_parallelism.m:
compiler/make_hlds_error.m:
compiler/make_hlds_warn.m:
compiler/mark_tail_calls.m:
compiler/mark_trace_goals.m:
compiler/mercury_compile_main.m:
compiler/mercury_compile_make_hlds.m:
compiler/mode_errors.m:
compiler/modes.m:
compiler/module_qual.qual_errors.m:
compiler/opt_deps_spec.m:
compiler/options_file.m:
compiler/parse_goal.m:
compiler/post_term_analysis.m:
compiler/post_typecheck.m:
compiler/pre_typecheck.m:
compiler/purity.m:
compiler/read_modules.m:
compiler/recompilation.check.m:
compiler/simplify_goal.m:
compiler/simplify_goal_call.m:
compiler/simplify_goal_disj.m:
compiler/simplify_goal_ite.m:
compiler/split_parse_tree_src.m:
compiler/state_var.m:
compiler/stratify.m:
compiler/style_checks.m:
compiler/superhomogeneous.m:
compiler/table_gen.m:
compiler/term_constr_errors.m:
compiler/term_errors.m:
compiler/termination.m:
compiler/typecheck_clauses.m:
compiler/typecheck_error_overload.m:
compiler/typecheck_error_undef.m:
compiler/typecheck_errors.m:
compiler/typecheck_msgs.m:
compiler/unused_args.m:
compiler/unused_imports.m:
compiler/warn_unread_modules.m:
compiler/write_module_interface_files.m:
Conform to the changes above, mostly by either
- adding an option to all warning and informational messages,
sometimes using existing warning options and sometimes new ones,
or
- turning already explicitly-conditional-on-an-option messages
into implicitly-conditional-on-that-option messages.
---------------------
tests/invalid/one_member.m:
Conform to the change in det_infer_goal.m.
tests/invalid/require_tailrec_1.err_exp:
tests/invalid/require_tailrec_2.err_exp:
Actually obey the options for these modules in Mercury.options.
tests/invalid_purity/purity.err_exp:
tests/warnings/purity_warnings.err_exp:
Conform to the change in purity.m.
tests/warnings/moved_trace_goal.err_exp:
Conform to the change in mark_trace_goals.m.
tests/warnings/help_text.err_exp:
Expect the documentation of all the new options.
There are currently two separate predicates used for invoking the C# compiler.
One is in link_target_code and is used to create executables and libraries
in the C# grade. The other is compile_target_code and was previously used
by the old .NET backend to compile additional C# source files. It is currently
plugged into the code that compiles the source files used for fact tables, but
as they are not supported by the C# backed, it has never been used in practice
for this purpose.
Delete the code for invoking the C# compiler in compile_target_code, since it
will have no users after this diff and is almost certainly affected by bitrot
at this point.
compiler/compile_target_code.m:
Delete the compile_csharp_file/8 predicate. It is unused.
compiler/make.module_target.m:
Abort if we are requested to build a Java or C# foreign code file.
The only thing that currently makes such requests is compilation of
fact tables and neither the Java or C# backend supports those.
Add an explanation of an issue in an XXX.
compiler/link_target_code.m:
Add an XXX about the MS C# compiler that needs to be investigated.