compiler/higher_order.specialize_in_module.m:
Document the meaning of a field.
compiler/add_pragma_type_spec.m:
compiler/hlds_module.m:
Change the code filling and using that field to avoid misleading
variable and predicate names. Add some extra documentation
where that can help.
compiler/add_pragma_decl.m:
compiler/add_pragma_gen.m:
compiler/add_pragma_impl.m:
These three new modules add declarative pragmas, implementation pragmas,
and compiler-generated pragmas to the HLDS respectively.
compiler/add_pragma_util.m:
This new module contains the parts of the old add_pragma.m
that are needed by more than one of the three modules above.
compiler/add_pragma.m:
Delete this module.
compiler/notes/compiler_design.html:
Update the relevant documentation.
compiler/add_pragma_tabling.m:
Use standard length section dividers.
compiler/make_hlds.m:
Include the new modules.
compiler/make_hlds_passes.m:
Import the new modules.
... out of add_pragma_type_spec.m.
compiler/add_pragma_type_spec.m:
compiler/add_pragma_type_spec_constr.m:
As above.
compiler/add_pragma.m:
Import the new module.
compiler/make_hlds.m:
Include the new module.
compiler/notes/compiler_design.html:
Document the new module.
I seem to have been broken it on Aug 18 with the move to associate
a option with every severity_informational spec. The code added then
treated all these options as bool options, but one is not.
compiler/error_util.m:
Allow a severity_informational spec to depend on an accumulating
option, which --show-pred-movability is.
As far as I can see, it is the only non-bool option used
in such messages, but since we don't have a database of
options named in severity_informational specs, I can't be sure.
compiler/hlds_call_tree.m:
Avoid printing a sentence when its subject is moot.
tests/valid/show_movability.m:
New test case to test the --show-pred-movability option.
tests/valid/Mercury.options:
Specify the option for the new test case.
Commit 92f60e5c7 inadvertently changed the conjunction operator recognised by
this program from "," to ", ". Fix that.
samples/interpreter.m:
tests/debugger/interpreter.m:
As above.
compiler/unused_args.m:
Make the new version of a test succeeds, where the old version
*looked like* it failed, but did not.
compiler/lambda.m:
Fix misleading module comment.
compiler/build_eqv_maps.m:
compiler/equiv_type.m:
As above.
compiler/parse_tree.m:
compiler/notes/compiler_design.html:
Include and document the new module.
compiler/decide_type_repn.m:
compiler/equiv_type_hlds.m:
compiler/make_hlds_passes.m:
compiler/mercury_compile_make_hlds.m:
compiler/qual_info.m:
Conform to the changes above.
compiler/parse_type_defn.m:
As above.
tests/invalid/field_syntax_error.{m,err_exp}:
tests/invalid/types.{m,err_exp}:
Add an instance of each bug the diagnostics are for,
and test for the updated diagnostic text.
compiler/parse_module.m:
When complaining about missing ":- interface"/":- implementation" markers,
reword the diagnostic to clarify that these should come after
the initial ":- module" declaration.
tests/invalid_make_int/missing_initial_section.int_err_exp:
tests/invalid_nodepend/bigtest.err_exp:
tests/invalid_nodepend/errors_1.err_exp:
tests/invalid_nodepend/errors_2.err_exp:
tests/invalid_nodepend/errors_3.err_exp:
tests/invalid_nodepend/funcs_as_preds.err_exp:
tests/invalid_nodepend/invalid_main.err_exp:
tests/invalid_nodepend/no_exports.err_exp:
tests/invalid_nodepend/occurs.err_exp:
tests/invalid_nodepend/prog_io_erroneous.err_exp:
tests/invalid_nodepend/types.err_exp:
tests/invalid_nodepend/vars_in_wrong_places.err_exp:
Expect the updated wording.
compiler/unused_args.m:
The old code that we use to decide whether we want to warn
about unused args in a predicate was built up piecemeal
over a long time, mostly before the creation pred_origins.
It never had a cohesive design.
Add a new version of the test that has a cohesive design,
consisting of just a test of the pred_status, and a case analysis
of the various possible values of the pred's origin.
Add code to automatically compare the result of the old and new tests,
and abort if they do not match. After a few days of tests on code
other than the Mercury system that don't trigger any of the new exceptions,
we can throw away the old code.
When set, this option tells the compiler to generate warnings
about locally-defined types that are neither used in the module
nor exported to any other module.
compiler/options.m:
Add the new option.
compiler/unused_types.m:
New module to implement the new option.
compiler/mercury_compile_front_end.m:
Invoke the new module, unless the presence of previous errors
would make its warnings just a distraction.
compiler/check_hlds.m:
Include the new module.
compiler/notes/compiler_design.html:
Document the new module.
compiler/typecheck_error_wrong_type.m:
Simplify some code.
browser/declarative_tree.m:
compiler/accumulator.m:
compiler/du_type_layout.m:
compiler/intermod.m:
compiler/mode_errors.m:
compiler/parse_inst_mode_defn.m:
compiler/polyhedron.m:
compiler/split_parse_tree_src.m:
compiler/tag_switch_util.m:
compiler/typecheck_error_unify.m:
compiler/unneeded_code.m:
deep_profiler/mdprof_test.m:
library/getopt.m:
library/getopt_io.m:
Delete unused types reported by the new option.
library/rtti_implementation.m:
Comment out unused type reported by the new option. This type was exported
to both Java and C#, but this diff comments it out because neither language
the Java or the C# runtime system seems to use the exported versions
either. (Bootcheck in both java and csharp grades worked, with the
same number of test case failures as before.) We do not delete it,
because it may be useful in the future.
tests/warnings/help_text.err_exp:
Expect the documentation of the new option.
tests/invalid_nodepend/Mmakefile:
Specify --warn-unused-types for two test cases to test that the compiler
does NOT generate warnings about unused types in the presence of previous
errors.
tests/warnings/abstract_type_decl.err_exp:
tests/warnings/bug412.err_exp:
tests/warnings/warn_dead_procs.err_exp:
Expect the new warnings for unused types.
tests/warnings/Mmakefile:
Specify --warn-unused-types for the three test cases listed above.
compiler/mercury_compile_middle_passes.m:
Pass the main predicate of unused_args.m two flags that together
specify what it should do, besides generating warnings. This makes
the code easier to understand, since each ignored argument representing
a set of unused_args pragmas is now preceded by a flag argument
that says "do not generate those pragmas".
compiler/unused_args.m:
Delete the code for deciding whether (a) we want to generate unused_args
pragmas or (b) record unused_args information in the analysis registry.
This is because the code doing that was duplicating the code fragments
in mercury_compile_front_end.m and mercury_compile_augment.m that decided
which predicate to call in mercury_compile_middle_passes.m:
either middle_pass_for_opt_file, or output_analysis_file.
This duplication not only violates the "Don't repeat yourself" principle",
but also led to hard-to-understand code in unused_args.m.