The date/0 type is misnamed. Values of the type have both a date and a time
component. The common name for combined date and time values is a "date_time",
for which we have had a type synonym since 2014. This change makes date_time
the proper name for type and make date into the type synonym.
Deprecate the date/0 name and note that we will change its meaning in a future
release. (It will eventually be used for data values that do not have a time
component.)
Rename predicates and functions accordingly and mark the existing versions as
obsolete.
library/calendar.m:
Make the above renamings.
library/hard_coded/stream.string_writer.m:
Replace a call to a now obsolete function.
NEWS.md:
Add entry describing the above.
tests/hard_coded/calendar_init_date.{m,exp}:
tests/hard_coded/calendar_test.m:
tests/hard_coded/fold_days.m:
tests/hard_coded/stream_string_writer_types.m:
Conform to the above changes.
Add a predicate to the calendar module for testing if a year is a leap year.
Use a more efficient method for determining this than the existing code
in the implementation of this module used (and replace that code with
a call to the new predicate).
Add the function days_to_month/2, which is a strongly typed wrapper
for the implementation function max_day_in_month_for/2.
Add a new test case covering basic operations in the calendar module,
together with the newly added operations.
library/calendar.m:
As above.
NEWS.md:
Announce the new additions.
tests/hard_coded/Mmakefile:
tests/hard_coded/calendar_basics.{m,exp}:
Add the new test case.
tests/debugger/Mmakefile:
Delete the bespoke make rules for test cases that do not require
their own special handling.
tests/debugger/all_solutions.exp:
tests/debugger/all_solutions.exp2:
tests/debugger/all_solutions.exp4:
tests/debugger/browse_packed.exp:
tests/debugger/browse_pretty.exp:
tests/debugger/class_decl.exp:
tests/debugger/cmd_quote.exp:
tests/debugger/debugger_regs.exp:
tests/debugger/field_names.exp:
tests/debugger/implied_instance.exp:
tests/debugger/label_layout.exp:
tests/debugger/list_cmd.exp:
tests/debugger/lval_desc_array.exp:
tests/debugger/multi_parameter.exp:
tests/debugger/multi_parameter.exp2:
tests/debugger/mutrec.exp:
tests/debugger/no_inline_builtins.exp:
tests/debugger/queens_rep.exp:
tests/debugger/shallow.exp:
tests/debugger/shallow.exp2:
Expect standardized event numbers and call sequence numbers,
since that is what the implicit rule specifies.
tests/debugger/all_solutions.m:
Fill in missing info about which .expN file is for what situations.
Delete parts of an action that are needed only on machines running OSF-1.
Delete parts of an action that have been obsolete since we switched
to '.' as the module qualifier character decades ago.
The crash that this diff fixes occurred when giving a command such as
"print Var^1" to mdb, where the first argument of Var is a direct arg.
runtime/mercury_ml_expand_body.h:
When deconstructing a term with a direct arg, return NULL
as the value of expand_info->chosen_arg_word_sized_ptr.
The crash occurred when we returned a non-null pointer,
which violated the expectations of trace/mercury_trace_vars.c
and its callers. (Not surprising, since those that function and
its callers were written long before the direct_arg optimization
was added to the system.)
runtime/mercury_deconstruct.h:
Document the rationale behind the above changes. (The contents of
mercury_ml_expand_body.h are #included in mercury_deconstruct.c.)
trace/mercury_trace_vars.c:
Add the debugging code I used to track down this issue, in disabled form.
Fix missing copyright year.
trace/mercury_trace_browse.c:
Delete obsolete comment.
Fix missing copyright years.
tests/debugger/direct_arg_test.{m,inp,exp}:
A test case for this bug.
tests/debugger/Mmakefile:
Enable the new test case.
compiler/hlds_out_type_table.m:
When dumping out the data constructors in the type table,
if a constructor has names for some of its fields,
put the name and the type of each field on different lines.
In the original test case for this bug, of which direct_arg_test.m
is an extreme simplification, pretty much every line overflows
without this.
Also, factor out some duplicated code, and replace bools with values
of a bespoke type.
Due to a copy-and-paste error introduced in commit 05fd615471,
set_line_number/2 was incorrectly setting the line number of the
current output stream, not the current input stream.
library/io.m:
Fix the above bug.
tests/hard_coded/Mmakefile:
tests/hard_coded/bad_set_line_number.{m,exp}:
Add a regression test.
Add a test for date creation, which is missing from existing calendar test.
In particular, test for the presence of the init_date argument lower bound
checks that were added in commit 5512b1be7.
tests/hard_coded/Mmakefile:
tests/hard_coded/calendar_init_date.{m,exp}:
Add the new test case.
... in some contexts.
compiler/unused_types.m:
Implement the easy part of the above, the part that happens
*after* we collect the info about which equivalence types are used.
Document why we can report unused equivalence types only in some contexts.
compiler/prog_data_used_modules.m:
Define an extension of the used_modules type that also records
which equivalence types were expanded in the module.
Define the operations we need on this extended type.
compiler/equiv_type.m:
Invoke one of those operations to record the expansions of equivalence
types, if requested to do so.
Inline the predicate that used to do this at its only call site.
compiler/hlds_module.m:
Replace the used_module field in the module_info with a value of
the extended type that includes not just the old used_modules info,
but also the set of expanded equivalence types.
Delete a utility predicate on the old field. The last call to this
predicate was deleted on 2022 march 30.
compiler/equiv_type_parse_tree.m:
compiler/make_hlds_passes.m:
compiler/mercury_compile_make_hlds.m:
compiler/unused_imports.m:
Conform to the changes above.
tests/warnings/warn_dead_procs.{m,err_exp}:
This test case already tests for warnings about unused du types.
Extend it to also test for unused eqv types.
tests/hard_coded/truncate_to_int.m:
Delete the {int64,uint64,uint32}_to_int predicates, and ...
library/int64.m:
library/uint32.m:
library/uint64.m:
... move them to these modules, where they always were intended to go.
Add proper comments describing them.
In the case of int64.m, it already had a to_int predicate doing a checked
conversion. Replace its definition with the one from truncate_to_int.m,
because it should never be slower, and should be faster on some platforms.
Add det function versions of the new predicates, which abort
instead of failing.
NEWS.md:
Announce the new predicates.
tests/hard_coded/truncate_to_int.m:
Add this test case to test operations that convert int64s, uint64s
and uint32s to ints *safely*.
For now, these conversions are implemented only for C. Until they
have Java and C# definitions as well, they are defined here.
tests/hard_coded/truncate_to_int.exp:
tests/hard_coded/truncate_to_int.exp2:
Expected outputs on 64 and 32 bit platforms.
tests/hard_coded/Mmakefile:
Enable the new case. For now, it will fail in non-C grades.
library/int.m:
library/int{8,16,64}.m:
library/uint.m:
library/uint(8,16,32,64}.m:
Add the new function.
NEWS.md:
Announce the additions.
tests/hard_coded/Mmakefile:
tests/hard_coded/clamp_int*.{m,exp}:
tests/hard_coded/clamp_uint*.{m,exp}:
Add tests for the new functions.
tests/hard_coded/string_code_point.m:
Avoid an ambiguity due to this module defining its own version of clamp/3.
XXX we should replace the local one with a call to int.clamp/3, but this
module constructs ranges where Max < Min and aborts with the new one.
Until now, the only integer type we generated dense switches
(including lookup switches) for was int itself; we did not do so
for any sized and/or unsigned integer types.
compiler/switch_util.m:
Simplify the representation of whether a switch is on an integer type.
The new version makes it impossible to make the mistake that caused
bug582 in the first place: not having a single representation for
for the switch being on *any* kind of integer type.
This fix requires solving a problem we never had to solve before:
representing information such as the min and max case values
in a way that works for every integer type, signed or unsigned,
sized or not. The solution that this diff adopts is to use int32s
to represent those limits, which implies that whatever the type
of the integer value being switched on, we will generate a dense
or a lookup switch for it only if all case values fit into an int32.
Since case values over two billion are vanishingly rare, this should be
an acceptable restriction.
Use uints instead of ints to represent counts of things.
Delete an unneeded pair of arguments.
compiler/lookup_switch_util.m:
Conform to the changes in switch_util.m. Use some of the new types
there to make arguments in arguments lists less confusable.
Provide some new utility operations.
Add XXXs where the basic operations we need seem not to exist.
compiler/dense_switch.m:
compiler/lookup_switch.m:
Use the new types in switch_util.m that can represent switches
on any integer type.
compiler/ml_lookup_switch.m:
compiler/ml_simplify_switch.m:
compiler/ml_string_switch.m:
compiler/ml_switch_gen.m:
compiler/switch_gen.m:
Conform to the changes above, and thereby gain the ability
to generate switches on integer types other than int itself.
library/int64.m:
Add a (commmented-out) declaration of an operation that could
help resolve one of the issues in new code in the modules above.
Similar operations would be needed in the modules of other
sized integer types as well.
library/library.m:
Fix a typo.
tests/hard_coded/bug582.{m,exp}:
Add a test case for this issue. Note that while we test whether
we get the expected output, there is no simple automatic way
to detect whether it was generated using a lookup table.
tests/hard_coded/Mmakefile:
Enable the new test case.
library/int32.m:
Add the new function.
NEWS.md:
As above.
tests/hard_coded/Mmakefile:
tests/hard_coded/clamp_int32.{m,exp}:
Add a test for the new function.
tests/warnings/unused_args_only_rec.{m,err_exp}:
As above.
tests/warnings/Mmakefile:
tests/warnings/Mercury.options:
Enable the new test case with the right options.
compiler/unused_args_warn_pragma.m:
The existing code processed only the first procedure of each predicate,
skipping all the later procedures. It had a comment saying that it
warns about an unused arg only if it was unused in all modes,
but this claim was false.
Replace this old code with new code that
- gathers the set of unused args in each procedure, recording
which ones have mode "unused",
- considers all the procedures of a predicate together, and then
- generates either a single warning for the predicate as a whole,
or separate warnings for each procedure that has unused arguments.
We now generate a single warning for the predicate only if all the
procedures agree both on which arguments are unused, and on
which of those are *marked* by the mode as unused. Of course,
most of the time this will be the case simply because most predicates
have just one procedure.
Stop module qualifying predicate names in the warnings we generate,
since we do not generate warnings for imported predicates.
Color the unqualified name as the subject of the diagnostic.
When reporting unused args, list the arguments with "unused" modes
separately from the other arguments.
Simplify the interface with our caller in unused_args.m.
compiler/unused_args.m:
Conform to the simplified interface with unused_args_warn_pragma.m.
compiler/hlds_error_util.m:
Add a new version of an existing utility function.
tests/warnings/unused_args_some_modes.{m,err_exp}:
Add a test case for the new capability.
tests/warnings/Mmakefile:
Enable the new test case.
Stop mixing "VAR = VALUE" and "Var += VALUE" definitions
of make variables. Give some make variables better names.
Move some dependency definitions out of a block of rules.
tests/warnings/Mercury.options:
Enable --warn-unused-args for the new test case.
Delete some accidentally-duplicated entries.
tests/warnings/unused_args_test.err_exp:
Update the expected output.
library/version_array2d.m:
The row or column out of bounds messages are off by one; fix that.
tests/hard_coded/version_array2d_test.exp:
Conform to the above change.
library/term_io.m:
foramt_term_nl/5 should call format_term_nl_with_op_table/6, *not*
format_term_with_op_table/6, otherwise the terminating ".\n" will
not be written.
tests/hard_coded/Mmakefile:
tests/hard_coded/format_term_nl.{exp,m}:
Add a regression test.
These were inadvertently broken by updates to programming style in
commit 185443d79.
library/rbree.m:
In the implementation of ucount, increment the count for the
current node.
tests/hard_coded/Mmakefile:
tests/hard_coded/rbtree_count.{m,exp}:
Add a regression test.
library/array.m:
library/builtin.m:
library/construct.m:
Fix copy-and-paste errors.
library/arrayd2d.m:
Use the mode array2d_di instead of array_di in a spot.
Delete an extra space from an exception message.
library/bimap.m:
Fix formatting.
library/bit_buffer.m:
Fix inverted argument types.
library/dir.m:
Say that make_single_directory/4 returns an error rather
than saying that it fails.
library/io.m:
Fix errors in obsolete pragmas.
library/assoc_list.m:
library/bag.m:
library/cord.m:
library/deconstruct.m:
library/enum.m:
library/fat_sparse_bitset.m:
library/getopt*.m:
library/int*.m:
library/io*.m:
library/type_desc.m:
Fix documentation errors.
tests/hard_coded/array2d_from_array.exp:
Conform to the changed exception message in array2d.m.
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/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.
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.
This allows to perform those checks for *all* foreign_procs,
not just the ones that get added to the HLDS.
compiler/add_foreign_proc.m:
Move the code that checks the bodies of foreign_procs for the
presence of type_info variables for existentially quantified
type variables here from typecheck.m and typecheck_errors.m.
Change the diagnostic's wording to match our new phraseology.
Record identifiers in a set, not a list, for faster membership tests,
since we now do even more of them.
compiler/foreign.m:
Provide a mechanism to return the identifiers not just in the
non-comment parts of foreign_procs, but the comment parts as well,
since add_foreign_proc.m now needs this functionality.
compiler/make_hlds_warn.m:
Conform to the change in foreign.m.
compiler/typecheck.m:
compiler/typecheck_errors.m:
Delete the code that was moved (in a modified form)
to add_foreign_proc.m.
compiler/ml_foreign_proc_gen.m:
Update a reference in a comment.
tests/invalid/exist_foreign_error.err_exp:
Expect the updated wording of the affected diagnostics,
and expect diagnostics for *all* the foreign_procs in the test,
regardless of which language they are for.
tests/invalid/exist_foreign_error.err_exp2:
tests/invalid/exist_foreign_error.err_exp3:
Delete these files, since the output they expect is now
in the .err_exp file.
tests/invalid/fp_dup_bug.err_exp2:
tests/invalid/fp_dup_bug.err_exp3:
tests/invalid/gh72_errors.err_exp2:
tests/invalid/gh72_errors.err_exp3:
Expect the updated wording of diagnostics affected by previous
changes (which updated the .err_exp files for C, not these for
Java and C#).
compiler/add_foreign_proc.m:
Use the agreed wording *consistently* in the diagnostics
generated by this module.
Also, delete a call to the test for builtins that I recently
accidentally duplicated instead of just moving.
tests/invalid/foreign_proc_dup_var.err_exp:
tests/invalid/foreign_purity_mismatch.err_exp:
tests/invalid/fp_dup_bug.err_exp:
tests/invalid/pragma_qual_error.err_exp:
tests/warnings/foreign_singleton.err_exp:
tests/warnings/singleton_test.err_exp:
tests/warnings/warn_return.err_exp:
tests/warnings/warn_succ_ind.err_exp:
Expect the updated wording for all those diagnostics.
compiler/add_foreign_proc.m:
Perform several more kinds of checks on all foreign_procs,
not just on the foreign_procs that we end up adding to the HLDS.
These are
- the checks for whether the foreign_proc is for a builtin operation;
- the checks for repeated variables in the foreign_proc's argument list;
and
- the checks for purity mismatches between the foreign_proc
and the predicate/function it is for.
An unrelated change: simplify, and make much more direct, the logic
of the is_foreign_proc_for_this_backend predicate.
tests/invalid/foreign_proc_dup_var.err_exp:
tests/invalid/foreign_purity_mismatch.err_exp:
Expect error messages not just for C foreign_procs, but Java and C#
foreign_procs as well.
tests/invalid/foreign_proc_dup_var.err_exp2:
tests/invalid/foreign_proc_dup_var.err_exp3:
tests/invalid/foreign_purity_mismatch.err_exp2:
tests/invalid/foreign_purity_mismatch.err_exp3:
Delete these files, which used to hold the diagnostics for
Java and C# foreign_procs respectively.
compiler/add_foreign_proc.m:
The existing code for adding foreign_procs
- tests whether the foreign_proc is for an imported predicate,
and if so, stops with an error message,
- then tests whether the foreign_proc is for the current backend,
and if it is not, ignores the foreign_proc,
- and then both adds the foreign proc to the HLDS, and checks it
for singletons.
Reverse the order of the last two tests, so that we now test
foreign_procs for singletons *even if* they are not for the current
backend. (Though of course we do not add such foreign_procs to the HLDS.)
library/io.environment.m:
library/private_builtin.m:
library/rtti_implementation.m:
Fix the warnings for now result for non-C foreign_procs even during
bootchecks in C grades.
tests/warnings/foreign_singleton.err_exp:
Expect warnings for Java and C# foreign_procs as well as C foreign_procs.
tests/warnings/singleton_test.{m,err_exp}:
tests/warnings/warn_return.{m,err_exp}:
tests/warnings/warn_succ_ind.{m,err_exp}:
Make these test cases more readable. Delete any obsolete parts,
as well as the causes of warnings that these test cases are
not intended to test for. (The latter makes the tests' *outputs*
more readable.)
Expect warnings for Java and C# foreign_procs as well as C foreign_procs,
and expect them with the new line numbers.
tests/warnings/foreign_singleton.err_exp2:
tests/warnings/foreign_singleton.err_exp3:
tests/warnings/singleton_test.err_exp2:
tests/warnings/singleton_test.err_exp3:
tests/warnings/warn_return.err_exp2:
tests/warnings/warn_return.err_exp3:
tests/warnings/warn_succ_ind.err_exp2:
tests/warnings/warn_succ_ind.err_exp3:
Delete these Java- and C#-specific expected outputs, since the warnings
they test for are now in the corresponding .err_exp files.
compiler/make_hlds_warn.m:
When generating "did you mean" messages to add to warnings about
singleton variables, consider state variables in two separate ways.
- When figuring out what you could have meant with a singleton reference
that is a variable such as PredInfo, consider that the intended reference
*could* have been to a state variable (such as !.PredInfo).
- When figuring out what you could have meant with a singleton reference
that is a state variable reference as !.PredIfno or !:PredIfno, consider
that the intended reference *could* have been to another state variable
(such as !.PredInfo or !:PredInfo).
Stop passing around a parameter that, for some predicates, was *always*
set to the same value.
tests/invalid/undef_symbol.{m,err_exp}:
Extend this test case with code that (except for the types)
duplicates the motivating example for this change.
tests/invalid/bug278.err_exp:
tests/invalid/field_syntax_error.err_exp:
Expect the extra dym messages that we now generate.
compiler/foreign.m:
When returning the list of identifiers inside a foreign_proc's code,
ignore the contents of comments. This means that warnings about
variable names that occur in the foreign_proc's argument list
but do not occur in the foreign_proc's code cannot be shut up anymore
by mention the variable name in comments.
The "mostly" part is that typecheck.m still looks at the bodies
of foreign_procs without knowing about comments. Fixing that
will be part a future change.
NEWS.md:
Announce this breaking change.
compiler/fact_table_gen.m:
When we try to generate a foreign_proc's body for a fact table
but cannot do so due to the fact table file not being readable,
add a marker to the predicate that the fact table is for.
compiler/hlds_markers.m:
Update the documentation of the existing predicate marker
we use for this.
compiler/make_hlds_warn.m:
Do not warn about singleton variables in foreign_proc bodies
that are empty due to missing fact table files.
library/array.m:
library/io.file.m:
library/profiling_builtin.m:
library/stm_builtin.m:
library/table_builtin.m:
library/term_size_prof_builtin.m:
tests/invalid/erroneous_throw_promise.m:
tests/invalid/foreign_procs_exist_type.m:
tests/invalid/foreign_purity_mismatch.m:
tests/invalid/gh72_errors.m:
tests/invalid_purity/purity.m:
tests/valid/solv.m:
Shut up warnings about singletons in foreign_procs by adding a _ prefix
to the names of the relevant arguments, and delete the comments
that can no longer do that job.
tests/invalid/foreign_purity_mismatch.err_exp:
tests/invalid/gh72_errors.err_exp:
tests/invalid/gh72_errors.err_exp2:
tests/invalid/gh72_errors.err_exp3:
tests/invalid_purity/purity.err_exp:
Expect updated line numbers.
tests/warnings/warn_return.{m,err_exp}:
Extend this test case to test that
- we DO warn about return statements outside comments, but
- we DO NOT warn about return statements inside comments.
library/version_array2d.m:
For every predicate or function that takes an integer argument,
if that integer is required to be non-negative, add an unsigned version.
Add bounds checks to lookup (read) and set (write) operations.
Improve the documentation of the exported operations.
Add a new implementation of the function that returns the rows
of the array as a list of lists.
Improve variable names in operations that have new unsigned versions.
NEWS.md:
Announce the new operations.
tests/hard_coded/version_array2d_test.{m,exp}:
New test case to test the operation of version_array2d.m.
It is based on the applicable parts of version_array_test.m,
but with somewhat improved organization.
tests/hard_coded/Mmakefile:
Enable the new test case.
tests/hard_coded/version_array_test.m:
Minor style fixes.
library/version_array.m:
For every predicate or function that takes an integer argument,
if that integer is required to be non-negative, add an unsigned version.
Improve the documentation of the exported operations.
Improve variable names in operations that have new unsigned versions.
NEWS.md:
Announce the new operations.
tests/hard_coded/version_array_test.m:
Modify this test case to test the new operations.
The compiler has had no code to set it from its default value of "yes"
to "no" since the Erlang backend was deleted in October 2020.
compiler/options.m:
Delete the option.
compiler/handle_options.m:
Delete an (incorrect) reference to the option.
compiler/switch_detection.m:
Stop paying attention to the option.
tests/warnings/help_text.err_exp:
Stop expecting documentation of the option.
If the compiler decides that a du type should use the direct-arg
representation for some of its constructors, it must include information
about that into the .opt file of the module defining the type, in the
form of `where direct_arg is' clauses, which will be used by modules
opt-importing that module and that type. That information was not being
included for du types defined in the *interface* section of a module.
Also fix a related issue that was uncovered: a word_aligned_pointer
assertion on a foreign_type definition would have no effect if there is
a no-tag du type definition for the same type constructor.
compiler/intermod.m:
compler/intermod_decide.m:
Make should_opt_export_type_defn and some_type_needs_to_be_written
succeed for `status_exported' du type definitions with direct-arg
constructors. While `status_exported' suggests those type
definitions would be redundant in .opt files, the information about
the direct-arg constructors is not redundant.
compiler/du_type_layout.m:
Add a is_word_aligned_ptr() value to the ComponentTypeMap if a
no-tag du type also has a foreign_type definition for the current
target language with a word_aligned_pointer assertion. Previously,
this was only being done for single ctor NON no-tag du types.
Add a XXX mentioning that we silently ignore word_aligned_pointer
assertions in other cases.
tests/hard_coded/Mercury.options:
tests/hard_coded/Mmakefile:
tests/hard_coded/direct_arg_opt.m:
tests/hard_coded/direct_arg_opt_helper_1.m:
tests/hard_coded/direct_arg_opt_helper_1.direct_arg_opt_helper_2.m:
tests/hard_coded/direct_arg_opt.exp:
Add a test case.
tests/invalid_nodepend/Mercury.options:
Prevent two test cases, fundeps_vars and require_tailrec_invalid,
from stopping after the creation of their .int files finds errors.
Continue on to the code generation stage, where the errors that
these test cases for are detected. (The fix is needed only for
bootchecks that use mmc --make.)
tests/EXPECT_FAIL_TESTS.csharp:
Recognize that hard_coded/functor_ho_inst_excp_1 is expected to fail
in C# grades. This test case was already on the expected-to-fail list,
but under its old name, functor_ho_inst_excp, which was not updated
when the name was changed.
library/array.m:
Add uint versions of most of this module's operations.
NEWS.md:
Mention the new operations.
library/edit_distance.m:
Use the new array operations to eliminate some casts.
library/edit_seq.m:
Minor style fix.
tests/hard_coded/array_gen.{m,exp}:
tests/hard_coded/array_test_2.{m,exp}:
Extend the tests of array.m's operations to the corresponding uint
versions. Expect the output for the new versions.
tests/hard_coded/array_resize.m:
tests/hard_coded/array_shrink.m:
Extend the tests of array.m's operations to the corresponding uint
versions, but generate output only if their results differ from the
original int versions. (They don't differ.)
tests/hard_coded/array_primitives.m:
Style fixes.