Commit Graph

20045 Commits (f52fdc2068204da5d78678b02ee0ac2444b6f8c1)

Author SHA1 Message Date
Gabriel Scherer 9568154248
Merge pull request #9389 from Anukriti12/trunk
call_linker now returns exit_code for better user response on linking_error, fixes #7141
2020-04-17 17:05:56 +02:00
Florian Angeletti 9108648867
Merge pull request #9409 from Octachron/yet_another_implicit_deps_error
packed modtype lookup can fail due to missing cmi
2020-04-17 16:28:19 +02:00
David Allsopp c29450548a
Merge pull request #9057 from dra27/debugging-the-debugger
Aid debugging the debugger
2020-04-17 12:15:34 +01:00
Leo White a5da4162b1 Add Changes entry 2020-04-17 11:20:10 +01:00
octachron 35dbd85b3e packed modtype lookup can fail due to missing cmi
This commit removes an assert false and makes the missing
cmi case behaves like the abstract case.
2020-04-17 11:22:38 +02:00
David Allsopp 43c84d2750
Merge pull request #9335 from dra27/fix-stdlib-manpages
Correct implementation of --disable-stdlib-manpages
2020-04-17 10:17:16 +01:00
David Allsopp 014105bf1c Use configure-caches on AppVeyor 2020-04-17 10:16:03 +01:00
David Allsopp eaa2a01eeb Use configure-caches on AppVeyor 2020-04-17 10:16:03 +01:00
David Allsopp db1d8488e6 Run AppVeyor with -j for branches 2020-04-17 09:35:16 +01:00
David Allsopp 094447b8fe Run AppVeyor with -j for branches 2020-04-17 09:35:16 +01:00
David Allsopp 644696e041 Display AppVeyor environment 2020-04-17 09:28:05 +01:00
David Allsopp 1850f55c58 Display AppVeyor environment 2020-04-17 09:28:05 +01:00
Leo White a534650f41 Add locations to docstring attributes 2020-04-17 09:21:31 +01:00
David Allsopp 540df2ee65 Introduce $MAKE to AppVeyor script 2020-04-17 08:58:44 +01:00
David Allsopp afe92bb4f3 Introduce $MAKE to AppVeyor script 2020-04-17 08:58:44 +01:00
Leo White 59fac074fe
Merge pull request #9349 from lpw25/inline-hint
Add [@inlined hint] attribute
2020-04-17 08:27:58 +01:00
David Allsopp dce967139c
Merge pull request #8639 from dra27/autoconf-tweak
autoconf tweaks
2020-04-17 07:43:28 +01:00
Xavier Leroy 67ada54ce3
Reimplement output_value using a hash table to detect sharing (#9353)
The previous implementation was doing temporary in-place modifications
of the OCaml value being marshaled.  This is incompatible with
Multicore OCaml.
2020-04-16 17:56:28 +02:00
Leo White 3dee10ec6a Add Changes entry 2020-04-16 15:58:09 +01:00
Leo White f46abe1916 Add [@inlined hint] attribute 2020-04-16 15:58:03 +01:00
Gabriel Scherer 9f95355acb
Merge pull request #9447 from trefis/rematch-more-heads
pattern-matching refactoring: keep going
2020-04-16 14:32:00 +02:00
Stephen Dolan 6fbecf0f72 Reset Reg.visit_generation during Reg.reset 2020-04-16 13:19:33 +01:00
Gabriel Scherer 761383d597 Changes 2020-04-15 17:33:38 +02:00
Gabriel Scherer 6ceba91930 matching: minor code factorization of compile_* functions 2020-04-15 17:33:27 +02:00
Gabriel Scherer b2a2c94211 matching: factorize compile_match and compile_match_nonempty 2020-04-15 17:32:42 +02:00
Gabriel Scherer d67a091fb0 matching: inline split_and_precompile* to clarify compile_* 2020-04-15 17:30:59 +02:00
Gabriel Scherer 2d9aafce62 matching: what_is_cases returns a head 2020-04-14 09:58:34 +02:00
Guillaume Munch-Maccagnoni b1fdc44547
Install a pretty printer for the Fun.Finally_raised exception (#9266) 2020-04-13 19:09:47 +02:00
Stephen Dolan 2208a4cbe6
Fix tail-call optimisation with a mutable ref (#9443)
Fix tail-call optimisation with a mutable ref
(Clet_mutable was not recognized properly in tail position.)

Add a test for tail-call optimisation with a mutable ref
2020-04-13 18:20:56 +02:00
Xavier Leroy 88a1bceb1b
configure: use cc as assembler with clang and for all FreeBSD platforms (#9437)
In recent FreeBSD, `cc` is Clang and `ld` is LLD, the LLVM linker, but
`as` is still GNU binutils.  Moreover, Clang contains its own
assembler and does not call `as`.  Consequently, object files produced
by invoking `as` directly are slightly different from those produced
by `cc`.

This can cause obscure errors such as issue #9068: `ld -r` fails when
combining objects produced by `as` and objects produced by `cc`.

The workaround is to use `cc` as the assembler.  We already did that
for the ARM and ARM64 targets, but #9068 shows that it is necessary
for AMD64 too.  Just use `cc` as assembler for all FreeBSD targets.

Similar issues were reported under Linux when clang and LLD are used
instead of GCC and binutils.  We already used clang as the preprocessed
assembler in this case.  Also use clang as the assembler in this case.

Closes: #9068
2020-04-11 11:17:11 +02:00
Xavier Leroy 6040bcfdae
Merge pull request #9426 from xavierleroy/configure-mingw
Configure: improve selection of GCC options
2020-04-08 19:54:27 +02:00
Xavier Leroy 286d4d6390 Update Changes for PR#9426 2020-04-08 19:17:36 +02:00
Xavier Leroy e35babe426 configure: use m4_normalize to reformat long messages 2020-04-08 19:17:11 +02:00
Xavier Leroy 797698d8b0 configure: quote [] inside cases of AS_CASE construct
Patterns such as `gcc-[012]-*` are expanded as `gcc-012-*`.
An extra quoting is needed: `gcc-[[012]]-*` is expanded as `gcc-[012]-*`.
2020-04-08 19:17:11 +02:00
Xavier Leroy c5afa9303d configure: add GCC option -fexcess-precision=standard
This option forces GCC to follow the ISO C standards concerning
rounding of intermediate FP results.  It avoids some FP issues
with the x86 32 bits ports of OCaml, which can run into
excess precision problems due to the x87 FP unit.

Closes: #7917
2020-04-08 19:17:11 +02:00
Xavier Leroy 743ca1baff configure for mingw: GCC optimization options
Require GCC >= 5.0 and use the same GCC optimization options as for
the other ports.
2020-04-08 19:17:11 +02:00
Jacques Garrigue d67c704c4d
In `{expr with ...}`, always evaluate `expr` even if all labels are redefined (#9432)
This commit reverts c1a7ace (originally c545e04), which was a
temporary fix that is no longer needed because it was superseded by
#6608.

The temporary fix caused `{expr with lbl1 = e1; ... }` to not evaluate
`expr` if all labels of its type are overriden.  As reported in #7696
this is not desirable.  Reverting the temporary fix causes `expr` to
be evaluated always.

As a consequence, a corner case of value "let rec" is no longer accepted.
The corresponding test was updated.

Closes: #7696
2020-04-08 18:58:43 +02:00
Xavier Leroy 8ff2f34b05
Merge pull request #9420 from xavierleroy/output-value-fixes
Minor fixes to the marshaler (output_value)
2020-04-08 10:17:40 +02:00
Xavier Leroy 3d4564c54b Update Changes 2020-04-08 10:13:19 +02:00
Xavier Leroy 13fbd2ab78 caml_output_value_to_malloc: revise freeing of output buffer
This commit changes caml_output_value_to_malloc to use the same
pattern as caml_output_val and caml_output_value_to_bytes:
the blocks of output are freed in the same loop that copies
them to the final destination.

Originally, caml_output_value_to_malloc calls free_extern_output
to free the blocks of output.  This is correct too, but causes
extern_free_stack to be called twice, once at the end of extern_value
and once in free_extern_output.  This is OK because extern_free_stack
is protected against double free errors.

Still, I find it more elegant, more consistent with the rest of the
code, and less error-prone w.r.t. double free errors to not call
free_extern_output at the end of caml_output_value_to_malloc.

Later, free_extern_output could be renamed to e.g. extern_finalize
to emphasize that it is to be called when something goes wrong and
we are about to raise an exception.
2020-04-08 10:10:20 +02:00
Xavier Leroy 4d11d1da04 extern.c: make sure extern_free_stack() is always called on an exception
In the original code, if `caml_output_value_to_block` raises an exception,
`free_extern_output` does not call `extern_free_stack` because
of the early return on `extern_userprovided_output != NULL`.
2020-04-08 10:09:37 +02:00
Julien Rousé 61a2be4844
Fix documentation comment for struct large_free_block (#9399)
Fix the name of the field `isnode` in the struct `large_free_block` in the comment documenting it (was `node` before).

Replace "son" by "child" in the documentation of the struct "large_free_block".
2020-04-07 19:20:48 +02:00
Xavier Leroy d235f167fa
PowerPC, System Z: do not reset backtrace_pos in caml_raise_exception (#9428)
* PowerPC, System Z: do not reset backtrace_pos in caml_raise_exception
* Add Changes entry
2020-04-07 15:47:55 +02:00
Gabriel Scherer 2e82c0e843 Changes entry for the refactoring of the pattern-matching compiler 2020-04-07 15:25:06 +02:00
Gabriel Scherer 7bc2663a0e
Merge pull request #9422 from Anukriti12/gcd
replaced fib example with gcd in coreexample.etex
2020-04-07 15:08:58 +02:00
Gabriel Scherer 7612a6d9b1 [minor] fix a Makefile warning by defining undefined variables
Report by Xavier Leroy:
  https://github.com/ocaml/ocaml/pull/9414#issuecomment-610231289
2020-04-07 15:06:12 +02:00
Gabriel Scherer 019cd43ef1
Merge pull request #9417 from trefis/rematch-can_group-simplif
matching: simplify can_group
2020-04-07 08:42:35 +02:00
Gabriel Scherer d05f86e13b [minor] matching: rename `group_var` into `simple_omega_like`
(Report from Florian Angeletti)
2020-04-07 06:41:20 +02:00
Thomas Refis acd44f90af [REVIEW REQUIRED] matching: simplify can_group
review of can_group factorization by @gasche:

> I reviewed the change to `can_group` and believe it is correct.
> (I knew it would be nicer as a binary operation!)
>
> The different treatments of Lazy and Tuple/Record does look a bit odd,
> but I believe that it is actually the right thing to write.
>
> In the Tuple or Record case, the idea is that we can group Any heads
> with the Tuple/Record case and just explode all of them (including the
> Any cases) according to the tuple/record arity.
>
> In the Lazy case, the corresponding choice would be to add Any values
> to the Lazy group, and force all the elements of the group. This is
> not so nice, because intuitively we shouldn't force Lazy values unless
> we have to.
>
> One may expect that in general the argument of the pattern will be
> forced anyway, as long as there is at least one Lazy pattern above in
> the matrix, so it doesn't really matter whether we include the Any
> patterns in the forced group or not. I would argue that (1) even if
> that was true, it would be semantically dubious to handle Any that way
> (see a more precise criterion below), (2) I am not actually sure that
> this is true, what if the first group gets found unreachable by
> splits in following columns?
>
>     # type void = | ;;
>     # match (lazy (print_endline "foo"), (None : void option)) with
>       | lazy (), Some _ -> .
>       | _, None -> false;;
>     - : bool = false
>
> This gives the following decision tree for whether Any is included in
> the group:
>
> - Can the absence of Any be used to generate nice/efficient tests for
>   the heads of the group? In that case, don't include Any.
>   (Not included: all the Constant cases, Array (discriminate on size),
>    String, etc.)
>
> - Is Any always exactly equivalent to a more-defined head for values
>   of this type? In that case, do include Any, otherwise do not.
>   (Included: Variant, Record)
>   (Not included: Lazy)
2020-04-07 06:41:20 +02:00
Florian Angeletti abda688b03
Merge pull request #1706 from Octachron/extension_disambiguated_bis
Spellchecker hints and type-directed disambiguation for extensible variants: bis
2020-04-06 11:28:37 +02:00