configure.ac:
As above. The test was inadvertently broken when MR_Spy_Point was
renamed to MR_SpyPoint. However, it would only make a difference for
anyone still using gcc < 3.
configure.ac:
Deduplicate checks for how to access the program counter from a
signal handler context.
Check REG_RIP for x86-64 and REG_EIP for i386.
Define _GNU_SOURCE for the register constants (REG_RIP, etc.)
Drop support for accessing the PC on Alpha as it doesn't fit easily
into the "uc_mcontext.gregs[$reg]" pattern.
configure.ac:
Delete check for sa_sigaction field. If a call to sigaction()
has the SA_SIGINFO flag set then the handler must be specified in
the sa_sigaction field, not the sa_handler field.
runtime/mercury_conf.h.in:
Delete MR_SIGACTION_FIELD macro.
runtime/mercury_signal.c:
Don't use MR_SIGACTION_FIELD macro.
Don't define dummy value for SA_SIGINFO.
tools/configure_mingw_cross:
Don't set now-unused variable.
The configure checks for sigcontext (aka sigcontext_struct) have failed
for a long time without anyone noticing. The MR_GET_FAULT_ADDR macro
that is also needed for the sigcontext code paths was only ever defined
for __i386__ and __mc68000__.
According to the sigaction(2) man page, the struct sigcontext
argument was obsoleted by the introduction of the SA_SIGINFO flag
(which we also have code for, though also not working either).
configure.ac:
Delete checks related to struct sigcontext.
Delete check for asm/sigcontext.h
runtime/mercury_conf.h.in:
Delete macros that are no longer defined.
runtime/mercury_memory_handlers.c:
runtime/mercury_signal.c:
runtime/mercury_signal.h:
Delete code for using signal handlers that take a sigcontext argument.
Add XXX where native GC casts a context parameter to
struct sigcontext * when it should be a ucontext_t *.
Possibly never tested.
runtime/mercury_faultaddr.h:
Delete this file containing only the MR_GET_FAULT_ADDR macro which is
no longer used.
runtime/RESERVED_MACRO_NAMES:
ssdb/RESERVED_MACRO_NAMES:
trace/RESERVED_MACRO_NAMES:
Delete macros that are no longer defined.
tools/configure_mingw_cross:
Don't need to set variables mercury_cv_sigcontext_struct_2arg and
mercury_cv_sigcontext_struct_3arg any more.
extras/graphics/mercury_tcltk/mltcltk.m:
Delete an old workaround that has not been required for versions of Tcl
from 8.1 (released in 1999) onwards
Minor syntax and style updates.
trace/mercury_trace_cmd_browsing.c:
The "level" command was documented to reset the current ancestor level
to the level of the current event (ancestor level 0) when invoked
without arguments, but when invoked that way, it reported an error
instead. Fix this.
tests/debugger/queens_rep.inp:
tests/debugger/queens_rep.exp:
Add a test for the fix in this existing test case.
The fix is in two parts.
compiler/disj_gen.m:
The first is fixing a bug I introduced recently while fixing
github issue #90. The fix involved flushing resume vars to the stack
*before* executing the code of a non-last disjunct, but the state of
the code generator while generating the code of that disjunct needs
to reflect this having been done. The earlier change did not do this,
but this one does.
library/exception.m:
The second part is some needed declarations of entry labels
were not visible when compiling exception.c. Give exception.m,
and hence exception.c, access to the declarations of those labels
by #including the files containing the declarations, and ...
library/profiling_builtin.m:
... include two such declarations in the .mh file of this module
for use by exception.m.
tests/EXPECT_FAIL_TESTS.asm_fast.gc.profdeep:
Expect the setenv test case to fail in deep profiling grades, since
(in the absence of working tail recursion while deep profiling)
its million-calls-deep recursion to construct a million cons cells
allocates *much* more memory per recursive call than in other grades,
and thus running out of memory is the expected result.
Conflicts:
compiler/disj_gen.m
compiler/modecheck_unify.m:
User-written lambdas always include a mode declaration. However,
the compiler can also construct lambdas from curried calls, and these
do not have a mode declaration. These converted, non-mode-declared
lambdas always start out containing *only* the curried call, but
the polymorphism transformation can insert other code before this call,
e.g. to pick up the typeinfos and/or typeclass infos to be passed
to that call from other typeclass infos, so don't abort if the lambda
contains calls to the builtin predicates that do these things besides
the original call.
tests/valid/undetermined_mode_lambda.m:
A regression test for the bug.
tests/valid/Mmakefile:
Enable the new test case.
compiler/disj_gen.m:
When generating code for a non-final disjunct, if the resume point
across that disjunct may require the resume variables to be
in their stack slots, flush them to those stack slots *before*
entering the code of the disjunct, not after. Flushing them
too late was the cause of Mantis bug #513, which this diff fixes.
Fix indentation.
compiler/code_gen.m:
compiler/ite_gen.m:
Flush debug output as soon as it is finished being written,
that this output appears in the expected order relative to
mdb events when the compiler is executed in the debugger.
compiler/code_loc_dep.m:
Add conditionally-compiled debug code to hekp debug the generation
of code for failures.
Make some debug output more readable.
Give a predicate and a bunch of variables a more meaningful names.
compiler/opt_debug.m:
When dumping instructions for debugging purposes, indent it by four spaces
instead of tabs. Use more readable code to do the dumping.
compiler/hlds_llds.m:
Give some function symbols more meaningful names.
compiler/code_loc_dep.m:
Give some function symbols and variables more meaningful names.
Replace list(prog_var) with set_of_progvar in the signatures
of some predicates to express the invariant that the argument
should not contain any duplicates.
Provide a utility predicate for ite_gen.m.
Generate more readable debug output.
compiler/ite_gen.m:
Factor out some common code.
Optimize some tests.
Break up a predicate to reduce the level of indentation.
Add some module qualifications to reduce type ambiguity.
compiler/var_locn.m:
Separate the two use cases of init_var_locn_state_2, since one needs
more work than the other. Factor out the parts that are common to both.
compiler/llds.m:
Define a bespoke type to control whether auto-comments are printed or not.
compiler/code_gen.m:
compiler/disj_gen.m:
compiler/frameopt.m:
compiler/hlds_out_goal.m:
compiler/layout_out.m:
compiler/live_vars.m:
compiler/live_vars.m:
compiler/liveness.m:
compiler/liveness.m:
compiler/llds_out_file.m:
compiler/llds_out_instr.m:
compiler/llds_out_util.m:
compiler/lookup_switch.m:
compiler/lookup_switch.m:
compiler/opt_debug.m:
compiler/optimize.m:
compiler/use_local_vars.m:
Conform to the changes above.
This fixes a bug reported by Keri Harris on m-users.
compiler/llds_out_file.m:
Output foreign_codes before the C modules that may contain
foreign_procs, since those foreign_procs may need to refer
to entities defined in the foreign_codes.
compiler/mercury_compile_llds_back_end.m:
Improve some comments.
tests/hard_coded/foreign_code_before_proc.{m,exp}:
A regression test for this bug.
tests/hard_coded/Mmakefile:
Enable the regression test.
tests/invalid/require_tailrec_1.err_exp3:
tests/invalid/require_tailrec_2.err_exp3:
tests/invalid/require_tailrec_3.err_exp3:
Add these expected output files for deep profiling grades. They
differ from the expected output files for both the LLDS and MLDS
backends because deep profiling does not support *any* tail calls.
tests/invalid/require_tailrec_1.m:
tests/invalid/require_tailrec_2.m:
tests/invalid/require_tailrec_3.m:
Update the source code of these test cases to document
what circumstances each expected output file is for.
tests/invalid/require_tailrec_1.err_exp:
tests/invalid/require_tailrec_1.err_exp2:
tests/invalid/require_tailrec_2.err_exp:
tests/invalid/require_tailrec_2.err_exp2:
tests/invalid/require_tailrec_3.err_exp:
tests/invalid/require_tailrec_3.err_exp2:
Update the existing expected output files to account for the
changes in line numbers caused by the new documentation.
This should fix Mantis bug #514.
runtime/mercury_builtin_types_proc_layouts.h:
Fix the first problem: refer to four type constructors defined
in private_builtin.m by their correct arities, so that the proc layout
structures we generate for their unify and compare predicates
get generated with the correct names and contents.
The arities were probably correct when the code was written;
we changed them from 1 to 0 at some point, and simply forgot
to update all the affected places.
runtime/mercury_stack_layout.h:
Fix the second problem: add "extern" to the declarations of those
proc layout structures. Without the "extern", compilers defaulting
the -fcommon will place these structures into common storage,
which can be used as *definitions*. With the "extern", compilers
should do the right thing whether or not they default to -fcommon.
runtime/mercury_unify_compare_body.h:
Conform to the change in mercury_builtin_types_proc_layouts.h:
refer to the affected four types using the correct arities.
compiler/process_util.m:
Make do_wait always assign all output variables.
Make do_wait return an error message if waitpid() fails.
Do not use MR_perror.
Make wrappers wait_pid and wait_any return errors from waitpid().
Change wait_any to return maybe(pid) in case waitpid() does not
return a child process id.
browser/util.m:
compiler/equiv_type_hlds.m:
compiler/inst_test.m:
library/construct.m:
library/io.m:
Ensure output variables are initialised in all code paths.
scripts/Mercury.config.bootstrap.in:
Pass --restricted-command-line to the bootstrap compiler. On Windows, the
command lines with which we invoke the Java compiler in the compiler
directory are apparently "too long".
Update README.MacOS.
configure.ac:
Only emit a warning about Xcode 11 being broken for versions 11.0 - 11.3.
README.MacOS:
Shift the note about broken versions of Xcode 11 to a more
prominent position.
Mention that the deep profiler set up instructions given here
only apply to 10.8 or earlier; after that users will need to
install their own web server.
Mention that the building 32-bit Mercury installations on Catalina
does not work since 32-bit code is no longer supported there.
Convert this file from sort-of Markdown to actual Markdown.
Various minor cleanups.
m4/mercury.m4:
Recent versions of the Java compiler print the output of -version
to the standard output instead of the standard error. Account for
this in order to avoid unwanted noise in the configure script.
doc/user_guide.texi:
mmake now assumes the use of GNU make.
Document the .dll and .exe files generated when we target C#.
Document that the .exe extension will be used for executables
when targeting C on Windows.
Add paragraphs describing what is generated for executables
by the C#, Java and Erlang backends.
Despite its name, mgnuc works with all (supported) C compilers
not just GNU C.
Mention the .dylib extension used for shared libraries on macOS.
Uncomment the documentation for C# libraries.
Update the section on Java libraries; the existing text describes
a very old state of affairs.
README.Java:
Add a missing word.
On Windows the name 'mmc' is also used for the executable for Microsoft
Management Console. For the MSVC port on the Windows command line we have long
provided a batch file named 'mercury' as an alternative to `mmc' in order to
avoid this clash. (Re-arranging your PATH to avoid the clash is not always an
option.)
Provide a shell script named 'mercury' that serves the same purpose elsewhere.
Its main use is to avoid the name clash on MinGW/MSYS, Cygwin etc., but
making the name available everywhere should avoid unnecessary changes in build
scripts and alike.
Document the issue with the name clash in the appropriate chapter of the user's
guide and also in the top-level Windows README file.
scripts/mercury.in:
Add a template for the 'mercury' script.
configure.ac:
Create the 'mercury' wrapper script.
scripts/Mmakefile:
Add 'mercury' to the list of scripts.
doc/user_guide.texi:
Add a paragraph describing the 'mmc' name clash on Windows and what
to do about it.
Unrelated change: ':' is no longer a module qualifier.
README.MS-Windows:
Point users to the relevant chapter of the user's guide for ways
to deal with the `mmc' name clash.
NEWS:
Announce the addition.
My commit afe2887882 broke the ability
to run the test suite outside of a bootcheck by executing "mmake runtests"
in the tests directory. This diff fixes that.
tests/Mmake.common:
Don't define "TESTS_DIR = ..". While every single tests/*/Mmakefile
defined it as such, I overlooked the fact that tests/Mmakefile itself
defined it ".", referring to the same directory from a different starting
point. Document this easily-overlooked fact.
Rename the old runtests target, which after afe2887 runs the tests
in a single directory, as runtests_dir, to leave the target name
"runtests" itself free for tests/Mmakefile to use.
tests/Mmakefile:
Define "TESTS_DIR = .", and add a target "runtests" which invokes
"mmake runtests_dir" in each test directory.
tools/bootcheck:
Invoke "mmake runtests_dir" instead of "mmake runtests" in each
test directory.
Initialize a variable just before it is used.
tests/*/Mmakefile:
Add back the definition "TESTS_DIR = .."