Commit Graph

20169 Commits (6ff2c11b25a8fe9ab34973bbc5c1dfed6b5a1532)

Author SHA1 Message Date
Nicolás Ojeda Bär 6ff2c11b25 ocamltest: do not overwrite user-defined variables 2020-06-05 07:40:17 +02:00
Gabriel Scherer a8a2a7b757
Merge pull request #9634 from nojb/ocamlrunparam_comma_fix
Allow ',' at the start of OCAMLRUNPARAM
2020-06-05 07:12:40 +02:00
Nicolás Ojeda Bär c4eea2ed90 Manual 2020-06-04 22:31:25 +02:00
Sébastien Hinderer e32c1b2e8e Inria CI: also test LibBFD support on FreeBSD 2020-06-04 19:13:35 +02:00
Gabriel Scherer 42b64a7dc7 minor Changes fix 2020-06-04 18:38:05 +02:00
Gabriel Scherer 9773de813c
Merge pull request #9629 from hhugo/patch-3
fix typo in #9569
2020-06-04 16:55:04 +02:00
Gabriel Scherer 84c87bb8f1
Merge pull request #9623 from gasche/unboxed-merge-constraint
fix an environment problem in merge_constraint
2020-06-04 13:16:27 +02:00
Nicolás Ojeda Bär 9ea385d917 Changes 2020-06-04 09:37:31 +02:00
Nicolás Ojeda Bär c0440d8161 Allow ',' at the start of OCAMLRUNPARAM 2020-06-04 08:35:48 +02:00
Jacques Garrigue abb8db459d
Fix #7520: Odd behaviour of refutation cases with polymorphic variants (#9547) 2020-06-03 17:47:12 +02:00
Jacques Garrigue 97c3be20c7 add PR number for #7741 2020-06-03 17:33:49 +02:00
Jacques Garrigue 13a081b04e
Fix #7741: Failure to report escaping type variable (#9545) 2020-06-03 17:31:38 +02:00
hhugo b280e17476
fix typo in #9569 2020-06-03 13:52:46 +01:00
Gabriel Scherer 8b2f64c2ce Typemod.merge_constraint: fix computation of the signature environment
(suggested by Leo White and Jacques Garrigue)
2020-06-03 14:33:55 +02:00
Gabriel Scherer 7068266b32 Typemod.merge_constraint: be careful about the typing environments
This PR fixes an old bug in the interaction between [merge_constraint]
and [Typedecl.transl_with_constraint], where
variance (and now separability) are recomputed in an invalid type
environment. See #9624 and the new tests.
2020-06-03 14:33:50 +02:00
Gabriel Scherer 45248a7602 add a testcase for 'with type <lhs> = <rhs>' scoping 2020-06-03 14:33:12 +02:00
David Allsopp ca64723db3 s/@raises/@raise 2020-06-03 10:25:25 +01:00
Nicolás Ojeda Bär 836d62470b
Fix load path ordering (#9611) 2020-06-03 00:10:38 +02:00
Jacques Garrigue ee20f5e648
Fix the polymorphic recursion problem of #9603 (#9617) 2020-06-02 22:05:30 +02:00
Gabriel Scherer fd8188be9d
Merge pull request #9560 from stedolan/more-partial
More partial application warnings
2020-06-02 17:22:50 +02:00
Stephen Dolan fd1bb255e1 More partial application warnings 2020-06-02 12:11:41 +01:00
Xavier Leroy 0ca651b95c Remove Const_pointer from Lambda and Clambda (#9585), bootstrap
This is the bootstrap required by commit 0d44a6cfe.
2020-06-02 11:23:42 +02:00
Stephen Dolan 0d44a6cfe6 Remove Const_pointer from Lambda and Clambda (#9585)
Lambda and Clambda distinguish Const_int from Const_pointer only so
that they can pass the information to Cmm. But now that that
Const_pointer is gone from Cmm (#9578), there's no need for the
distinction in Lambda either.

This PR requires a bootstrap, because the .cmo format changes:
Lambda.structured_constant has one fewer constructor.  The bootstrap
is in the following commit.
2020-06-02 11:19:20 +02:00
Stephen Dolan a8e2f2b170
Unbox result of Unix.gettimeofday in unix and win32unix (#9561)
This patch makes Unix.time and Unix.gettimeofday be unboxed and @noalloc, which makes them about 20% faster (as measured by a stupid benchmark that does them many times in a loop).

This removes the fallback and error-handling paths from gettimeofday.  Neither is needed according to Single Unix Specification and POSIX.

Fixes: #7446
2020-06-02 11:05:57 +02:00
Florian Angeletti 180a91f5d5
Merge pull request #9580 from stedolan/stdlib-doc-fix
Ensure stdlib documentation index refers to Stdlib
2020-06-02 11:01:17 +02:00
Nicolás Ojeda Bär 973eeb1867
Add Val_some,Val_none,Some_val, Is_none, Is_some, Tag_some (#9569)
Closes: #5154
2020-06-01 19:31:47 +02:00
Xavier Leroy 4bf7a79137
Turn debugger off in programs launched by the program being debugged (#9594)
* Undefine the CAML_DEBUG_SOCKET variable early

So that if the debugged program creates or executes another program
that happens to be an OCaml bytecode executable, said program does
not try to connect to the debugger at beginning of execution.

Fixes: #8678

* Check availability of setenv() and unsetenv()

And guard the use of unsetenv() in runtime/debugger.c.
2020-06-01 19:10:12 +02:00
Gabriel Scherer 9114ab0545
Merge pull request #9592 from gasche/cmi-and-float-arrays
typedecl_separability: compute the same separability signatures in either "(no) flat float" modes
2020-06-01 16:19:15 +02:00
Stephen Dolan 9b6e6203c1 changes entry 2020-06-01 14:57:44 +01:00
Gabriel Scherer 8e83130a18 compute the same separability signatures in either "(no) flat float" modes
In -no-flat-float-array mode, instead of always returning
`best_msig` (the most permissive signature), we first compute the
flat-float-array separability signature -- falling back to `best_msig`
if it fails.

This discipline is conservative: it never rejects -no-flat-float-array
programs. At the same time it guarantees that, for any program that is
also accepted in -flat-float-array mode, the same separability will be
inferred in the two modes. In particular, the same .cmi files and
digests will be produced.

Before we introduced this hack, the production of different .cmi files
would break the build system of the compiler itself, when trying to
build a -no-flat-float-array system from a bootstrap compiler itself
using -flat-float-array. See #9291.
2020-06-01 12:19:08 +02:00
Gabriel Scherer 5c9d5db728
Merge pull request #9511 from gasche/parmatch-exhaust-lazy
Parmatch: make `exhaust` (exhaustivity and fragility checking) lazy
2020-05-30 19:01:38 +02:00
Gabriel Scherer d8acfa92e4 parmatch: ensure specialized submatrices are in source order
We produce exhaustivity counter-example in the order of the
specialized submatrices. Having submatrices in source order gives the
nice behavior that the clause that would naturally been inserted first
in the source is given first as a counter-example.

Consider for example:

    function
    | true, true -> true
    | false, false -> false

The two counter-examples are (true, false) and (false, true).

Before this patch, (false, true) would be shown first.
After this patch, (true, false) is shown first.
This corresponds to the following natural completion order:

    function
    | true, true -> true
    | true, false -> ?
    | false, false -> false
    | false, true -> ?

On the other hand, the ordering of the default submatrix, with respect
to the specialized submatrices, is not preserved -- it is always
ordered last.
One could intuitively expect the default submatrix to appear in the
position of the first omega row in the source. We tried this, and
it is not a good idea:
- the change is much more invasive as the interface of
  `build_specialized_submatrices` has to change
- the behavior of the result is in fact unpleasant; it is not
  intuitive to order counter-examples in this way.

For example, consider:

    function
    | _, None -> false
    | true, Some true -> false

The two exhaustivity counter-examples are (true, Some false)
and (false, Some _). The second comes from the default submatrix:
morally it is (_, Some _), with "some other constructor missing from
the column" instead of the first _. There is no reason to suppose that
the user would want to place this (_, Some _) or (false, Some _)
counter-example first in the completed code; indeed, this intuition
would suggest writing an exhaustive covering of patterns of the
form (_, foo), inserted after the first clause, but then the other
clauses below become unnecessary!

When an omega patterns appears high in the column like this, it is
usually because there is a very specific matching condition to the
rest of its row, that justifies some shortcutting behavior. The
program is typically *not* completed by adding more specific matching
conditions.
2020-05-30 17:11:54 +02:00
Gabriel Scherer f8e24bda0c Changes entry 2020-05-30 17:11:54 +02:00
Gabriel Scherer a8adec16f1 add regression tests for fragile-matching stack overflows 2020-05-30 17:10:37 +02:00
Gabriel Scherer 8f71174eb2 parmatch: make 'exhaust' lazy by returning a Seq.t
This solves exponential-blowup issue with the strict traversal and/or
strict witness computation in cases where an exponential number of
counter-examples is generated. This fixes Stack Overflow and
exponential-time issues on examples using or-patterns heavily,
including one that naturally found its way in real-world user
code (see the following testsuite commit).

We now systematically keep only one counter-example, instead of
letting the type-checker decide whether to discard
counter-examples (in Backtrack_or mode) or to preserve
them (in Refine_or mode).

Note: in the exhaustivity warning, there are sub-messages printed to
indicate that:

- the exhaustivity counter-example is related to an extensible type, or
- that a when-guarded clause does match the counter-example

In both cases the warning is there to explain the counter-example(s)
shown (not a property of all counter-examples); keeping at most one
valid counter-example means that they will be printed less often, but
it is the correct/intended behavior in that case.
2020-05-30 17:10:37 +02:00
Etienne Millon 71e91123c2
Attach package type attributes to core_type (#9615) 2020-05-29 14:29:10 +02:00
Manuel Hornung 2b6f49e874
Add new flag for non-elevated symbolic links and test for Developer Mode on Windows (#9593)
Support symbolic links in developer mode on Windows 10
2020-05-29 07:39:59 +01:00
Gabriel Scherer a8d06b2010 Changes: backport the caml_*_compare fix to 4.11 2020-05-28 13:51:50 +02:00
Gabriel Scherer 62dcc6e50d
Merge pull request #9613 from gretay-js/fix_compare
Bind arguments of integer and float compare in cmmgen
2020-05-28 13:47:18 +02:00
Gabriel Scherer 4088367fbc
Merge pull request #9609 from gasche/unboxed-abstract-with-manifest
separability and with-constraints: fix for bug #9607
2020-05-28 08:46:22 +02:00
Gabriel Scherer 957f10b3fd
Merge pull request #9604 from gasche/ocamltest_refactor_1
Fewer ocamltest cleanups
2020-05-27 23:19:08 +02:00
Gabriel Scherer ec74335158 typedecl: prevent the mistake of not updating transl_with_constraint 2020-05-27 22:18:06 +02:00
Gabriel Scherer 9b1bfc3b7c typedecl: correct update separability in transl_with_constraint
fixes #9607
2020-05-27 21:32:36 +02:00
Nicolás Ojeda Bär e439fea68d Changes entry 2020-05-27 19:19:22 +02:00
Nicolás Ojeda Bär b4ba61d73d Typos 2020-05-27 19:19:22 +02:00
Nicolás Ojeda Bär 105ac40bd6 Hide references in Options implementation 2020-05-27 19:19:22 +02:00
Nicolás Ojeda Bär 13e96a1bcf Remove unneeded Sys.chdir 2020-05-27 19:19:22 +02:00
Nicolás Ojeda Bär 73aa6126a7 Use with_{input,output}_file 2020-05-27 19:19:22 +02:00
Nicolás Ojeda Bär b77b13d812 Use Sys.{win32,...} instead Sys.os_type 2020-05-27 19:19:22 +02:00
Nicolás Ojeda Bär 3eebf1ab8c Use Filename.quote_command 2020-05-27 19:19:22 +02:00