Use the latest revisions of the GPL version 2 and LGPL version 2 text from the
FSF. This replaces out-of-date addresses and the assumption that the year
begins with 19.
COPYING:
COPYING.LIB:
As above.
Documentation/README.x86.md:
As above.
Move the the bit about x86-64 not being affected by the issue
described in this file from the bottom to the top.
Documentation/README.Linux.md:
Add a pointer to the README.x86.md file.
README.md:
Conform to the above change.
Documentation/README.Linux-m68k.md:
As above.
Mention that this port has not been tested (to the best of my knowledge)
since 1998.
Documentation/README.Linux.md:
Add a link to the Linux/m68k README.
README.md:
Update a link.
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.
Documentation/README.Linux-PPC:
Rename -> README.Linux-PPC.md:
Convert this file to Markdown.
Make the note at the head of this file a bit stronger.
Delete a dead link.
README.md:
Documentation/README.Linux:
Conform to the above change.
The --with-msvcrt option was intended for selecting between the older Microsoft
C runtime (crtdll.dll) and the Microsoft Visual C runtime (msvcrt.dll). This is
all now ancient history, since the MSVCRT itself has been superseded by the
Universal C runtime since Windows 10. Delete the --with-msvcrt option and all
uses of it.
configure.ac:
Delete the --with-msvcrt option.
scripts/mgnuc.in
scripts/ml.in:
Delete uses of the above configuration value.
Documentation/README.MS-VisualC.md:
Delete references to --with-msvcrt.
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.
compiler/hlds_goal.m:
Document that all goals inside from_ground_term_deconstruct scopes
are not just unifications, but unifications whose right hand sides
are rhs_functors.
compiler/constraint.m:
Fix a potential problem, which is that pushing a constraint into
from_ground_term_{deconstruct,other) scopes can invalidate
their invariants.
compiler/goal_refs.m:
Fix a comment.
compiler/lco.m:
Qualify a call.
compiler/modecheck_goal.m:
Fix a misleading predicate name, and typos.
compiler/try_expand.m:
Exploit the newly-documented invariant about from_ground_term_deconstruct
scopes.
Simplify the interfaces between the new modules and switch_detection.m.
compiler/scout_disjunctions.m:
New module containing the part of the old switch_detection.m
that scouts disjunctions ahead of the main pass in bulk.
compiler/find_bind_var.m:
New module containing the part of the old switch_detection.m
that scouts disjunctions as *part* of the main pass, piecemeal.
compiler/switch_candidates.m:
New module containing the part of the old switch_detection.m
that recognizes candidate switches, and chooses the best switch
if there is more than one candidate.
compiler/switch_detection.m:
Delete the moved code. Conform to the interface simplifications.
compiler/check_hlds.m:
compiler/notes/compiler_design.html:
Add and document the new modules.
compiler/cse_detection.m:
Conform to the changes above.
compiler/hlds_out_goal.m:
Add the capability to format a case as a string.
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.
The changes to file copying in the compiler in early 2024 mean that we no
longer encounter the same performance problems these workarounds were put
in place to avoid.
compiler/Mmakefile:
library/Mmakefile:
As above.
In Unix expansion of wildcard arguments is done by the shell. On Windows,
this is not the case and programs are responsible for expanding wildcard
argument themselves. When using source file mapping, we typically used
wildcards to specify the source files to map. When native Windows Mercury
compilers are used in the Windows command prompt or PowerShell, this does
not work, which is inconvenient to say the least. (In environments like
Cygwin or MSYS2, the shell does do wildcard expansion.)
Microsoft's C runtime has an optional component that programs can
link against which will do wildcard expansion on the argument vector
before main is called. Set up builds with MSVC to link against this
component when building the Mercury compiler.
scripts/parse_ml_options.sh-subr.in:
scripts/ml.in:
Add a new option --use-msvc-setargv-extension, which causes the the
wsetargv.obj file that enables the extension to be passed the linker.
(MSVC seems rather picky about where this is positioned. A a result
we do it within the ml script where have we more control over the matter.)
compiler/Mmakefile:
Pass --use-msvc-setargv-extension to the ml script if we are using MSVC.
Unrelated: Fix the identity of a compiler in a comment.
Unrelated: Add an XXX about something that looks suspicious.
util/mkinit.c:
Add a pointer to scripts/ml.in, saying that if the Windows entry
point (currently wmain) is updated, then the script may need to
be updated.
The source file name that is used as the second argument of a .module_dep file
may be directory qualified (e.g. if we are using source file mapping to
include source files from multiple directories). On Windows, such directory
qualified source file names may use '\' as a path separator. We use the term
parser to read the contents of .module dep files and that requires '\' to be
escaped. However, the code that writes module_dep files does not currently
do the required escaping. Fix that.
compiler/make.module_dep_file.m:
Escape the source file name before writing it to a .module_dep file.
MSYS2's MSYS environment is similar to Cygwin and shares a lot of its
underlying code. Executables in this environment are linked with
msys-2.0.dll, which is a POSIX-emulation layer similar to cygwin1.dll.
The change of configuration triple for this environment last year from
x86_64-pc-msys to x86_64-pc-cygwin means that we can trivially support
Mercury in it by virtue of the fact that we already support Cygwin.
This diff makes some changes required to allow Mercury to bootcheck in
the MSYS2 MSYS environment.
configure.ac:
Modify the error message we print if we detect *-pc-msys
architecture.
tools/bootcheck:
Do not abort if we detect the MSYS2 MSYS environment.
Extend the comment describing the handling of the different MSYS2
environment.
Give a variable a more accurate name.
Drop support for versions of MSVC before version 19. We have never tested the
64-bit port with older versions and effort spent maintaining the 32-bit version
would be better spent elsewhere.
Rewrites and updates for README.MS-VisualC.md.
NEWS.md:
Announce the above.
Documentation/README.MS-VisualC.md:
Rewrite the introduction to
Fix and adjust markup.
Delete the post-installation instruction to modify the host and target env
types in Mercury.config. This is unnecessary as of commit 6f2a3e69a.
Delete an old section concerning Cygwin and network drives.
Documentation/README.MSYS2.md:
Add a section on using Mercury compilers created in the MSYS2 environment
at the Windows Command Prompt. As of rotd-2025-12-31, this now works
out of the box, without requiring users to edit Mercury.config.
Fix some markup errors.
Minor adjustments to other sections.
Documentation/README.MinGW:
As above.
Documentation/README.MS-Windows.md:
Conform to the above change. Delete references to the original
MSYS platform.
- Delete coverage of the old MSYS / MinGW platform, since it is dead
at this point. Recommend that users do not use it. This README now
describes the MSYS2 platform exclusively.
- Delete a note to developers about the bootcheck script not working.
It has worked with MSYS2 since the beginning of 2025 and we no longer
care about the old MSYS.
- Delete a section describing how to build a MinGW cross compiler
in Cygwin using gcc's -mno-cygwin option. That has not worked
in well over a decade. (In fact, I can't remember it ever having
worked.)
- Describe MSYS2 environments and which ones we recommend for use
with Mercury.
- Expand the description of how to use Mercury in the MSYS2 shell.
- Add a section on a common problem, Mercury compiler generated
executables aborting due to the loader being unable to find
libwinpthread-1.dll.
Documentation/README.MinGW:
As above.
Where possible, make the uint version the main version,
casting its result to int for the old length/count versions.
In a few places, apply simple speedups.
library/list.m:
library/one_or_more.m:
Add ulength operations as uint versions of length operations
for these sequence data structures.
library/edit_seq.m:
Delete the local definition of what is now list.ulength.
library/diet.m:
library/ranges.m:
library/fat_sparse_bitset.m:
library/fatter_sparse_bitset.m:
library/set.m:
library/set_bbbtree.m:
library/set_ctree234.m:
library/set_ordlist.m:
library/set_tree234.m:
library/set_unordlist.m:
library/sparse_bitset.m:
library/test_bitset.m:
library/tree_bitset.m:
Add ucount operations as uint versions of count operations
for these set data structures.
library/bag.m:
Add ucount operations as uint versions of count operations
for this bag data structure.
library/map.m:
library/multi_map.m:
library/one_or_more_map.m:
library/rbtree.m:
library/tree234.m:
Add ucount operations as uint versions of count operations
for these map data structures.