Commit Graph

2322 Commits (1cd6e4451f04af4871675d0eecd48b3bac262b67)

Author SHA1 Message Date
Gabriel Scherer 1cd6e4451f Map.filter_map and Set.filter_map 2020-03-31 15:01:41 +02:00
Jacques Garrigue e10e2bfa99
add optional argument principality examples (#9405) 2020-03-31 13:52:22 +02:00
Greta Yorsh 824ce35492
Replace caml_int_compare and caml_float_compare with primitives (#2324) 2020-03-26 10:58:10 +01:00
Jérémie Dimino c7de942730
Fix #9344 (#9368)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2020-03-17 11:38:45 +00:00
Stephen Dolan 6246d5ce03
Merge pull request #9367 from stedolan/unify-backtraces
Make bytecode and native-code backtraces agree
2020-03-17 10:45:34 +00:00
Stephen Dolan 07d0192b22 Generate the same backtraces for method send in bytecode and native 2020-03-16 18:15:09 +00:00
Stephen Dolan cc7b687a02 Generate the same locations for raises in bytecode and native code 2020-03-16 18:15:09 +00:00
Jérémie Dimino e54876a869
Add a new toplevel directive #use_output "<command>"
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
2020-03-16 17:48:41 +00:00
Gabriel Scherer 0fff7a43c5
Merge pull request #9196 from gasche/clarify-disambiguation-3
disambiguation: improve the interface of `NameChoice.disambiguate`
2020-03-09 13:39:32 +01:00
Gabriel Scherer bf6c8d4b95 disambiguation: improve the API of NameChoice.disambiguate 2020-03-07 14:35:05 +01:00
Thomas Refis c323d11144
Merge pull request #8934 from trefis/usage
Stop relying on location to track usage
2020-03-06 16:49:44 +01:00
Florian Angeletti b82d5194c2
Merge pull request #9343 from lpw25/fix-short-paths-environments
Re-enable `-short-paths` for some error messages
2020-03-06 09:38:40 +01:00
Thomas Refis dacf8b5a0b typecore: wrap_unpacks => type_unpacks
This allows us to give the same uid to the module bound in the guard,
and the one bound in the rhs.
2020-03-05 13:35:14 +01:00
Thomas Refis 7e370000d3 update testsuite 2020-03-05 13:35:14 +01:00
Leo White 971ffafffb Apply short-paths to an additional case 2020-03-05 09:44:18 +00:00
Leo White 1188af3614 Fix some bugs in short-paths 2020-03-03 18:04:47 +00:00
Leo White 9de0113e94 Add test for short-paths in error messages 2020-03-03 18:01:13 +00:00
Stephen Dolan de9e630852 Assert that Cassign is only used on Clet_mut-bound variables 2020-02-25 15:23:38 +00:00
Stephen Dolan 1336ce0c0d Use typing information from Clambda for mutable Cmm variables 2020-02-25 15:03:14 +00:00
Florian Angeletti bb15443a23 Revert "Make asmgen tests run"
This reverts commit e168edc67d.
2020-02-24 11:20:14 +01:00
Gabriel Scherer 9d8897db14
Merge pull request #9318 from trefis/empty_in_or_pattern
Fix exhaustivity checking in presence of empty types
2020-02-21 13:12:34 +01:00
Guillaume Bury 0d362f6abf Fix arith.cmm test
An error was triggered on the floating point computations because of
rounding errors between the read from the D array, and the C-side fp
computation which used 80-bit precision.
2020-02-20 15:37:39 +01:00
Guillaume Bury e168edc67d Make asmgen tests run
Relative paths are needed in ocamltest (rather than plain executable
file names), because else 'execvp' searches for the executable in the
PATH instead of the current directory.
2020-02-20 15:37:30 +01:00
Stefan Muenzel 6b94a5500d Add a test showing that the exhaustiveness check doesn't work with the empty variant 2020-02-19 13:30:16 +01:00
Florian Angeletti edabf2008c Merge pull request #9292 from lpw25/fix-best-fit-32-bit
Fix bug in best-fit on 32-bit

(cherry picked from commit 9e52341ece4e8c73087d622d2900cf3a97c6fe7b)
2020-02-11 10:45:36 +01:00
Nicolás Ojeda Bär 87296ee8e0
Dynlink: preserve module initializers backtrace (#9183)
* dynlink: preserve backtrace of module initializers
* Stabilize debug event sort
* Update test reference file
2020-02-06 07:21:23 +01:00
Pieter Goetschalckx 99224a96b7
Quoted extensions in comments, ocamllex and ocamlyacc (#9166)
* Support quoted extensions in comments
* Support quoted extensions in ocamllex
* Support quoted extensions in ocamlyacc
* Fix copying of comments in ocamlyacc
2020-02-03 10:55:28 +01:00
Gabriel Scherer e1addb7962
Merge pull request #9269 from Octachron/fix_annot
#9218: wrong file name error with -annot and inline records
2020-01-30 08:41:20 +01:00
Gabriel Scherer 13ab6b4a64
Merge pull request #2188 from rlepigre/recursive-yet-unboxed
Recursive yet unboxed
2020-01-29 10:16:33 +01:00
Florian Angeletti 9f696f0a8e 9218, avoid module/type path collitsion
In presence of -annot, the type printer can be requested to print the
inner path of inline records (i.e "t.A"). Before this commit, the
printing of these paths could trigger a lookup to a module with a
invalid name "t".
If this lookup fails this is fine.
However, if there is a cmi file in the environment sharing the name "t",
the lookup can partially succeed (since cmi are not required to start
with a capital letter) until we compare the module name stored in the
cmi with the requested module name.
Obviously, the valid module name "T" of the cmi cannot match the invalid
module name "t" that was requested, and the cmi reader raises a wrong
module file name error.

This commit avoids this whole process by detecting in the type printer
when we are printing an inlined record type constructor.
2020-01-28 16:30:56 +01:00
Jacques-Henri Jourdan ca5f81ccd0 Fix callstack test by forcing flambda not to optimize. 2020-01-28 14:47:20 +00:00
Jacques-Henri Jourdan 35104694b5 Fix test comballoc.ml 2020-01-28 14:47:20 +00:00
Gabriel Scherer e940f925ad typedecl_separability: handle GADT equations in a more predictable order
The separability signature of a type declaration is not inferred in
a principal way, it depends on the order in which GADT equations are
processed. In non-principal cases, we may have two parameters that are
related by an equality, with one of them being given mode Ind and the
other Sep. Either choice of which to make Sep is sound, but (Ind, Ind)
would be unsound.

We change the implementation to ensure that equations are processed in
an order such that the lefmost parameters are the most constained: if
equations imply that ('a = 'b), with the parameter 'a coming before 'b
in the type declaration, and they must be separable, then 'a gets the
mode Sep and 'b gets the mode Ind. This corresponds intuitively to
remembering that 'b is equal to a previous parameter, instead of
remembering than 'a is equal to a not-seen-yet parameter.
2020-01-28 13:56:23 +01:00
Gabriel Scherer c62c9d19f9 separability: add some interesting examples to the testsuite 2020-01-28 12:09:33 +01:00
Rodolphe Lepigre 15a6ff229d typedecl: use the new Separability implementation, remove old code
Because this changes the separability of standard library types, and
those separabilities are stored in the .cmi files, this commit changes
the .cmi files in the standard libraries in way that appear to require
a bootstrap (it looks like some part of the stdlib is built with
boot/ocamlc and others with ocamlc, and the two should produce/expect
the same .cmi exactly). The bootstrap will come as a separate commit.
2020-01-28 12:09:33 +01:00
Rodolphe Lepigre 20b62c8386 Cleaned up [@@unbox] validity check. 2020-01-28 11:39:52 +01:00
Stephen Dolan f874b3ee01 Memprof: report different callstacks for different combined allocations 2020-01-25 22:55:56 +01:00
Stephen Dolan 07bf49db5b Statmemprof support for native allocations (incl. Comballoc) 2020-01-25 22:55:56 +01:00
Gabriel Scherer d408e58ea1
Merge pull request #9261 from lthls/rec_check_ignore_fix
Fix soundness bug in Rec_check with anonymous let module
2020-01-24 22:06:37 +01:00
Gabriel Scherer a6825861ee
Merge pull request #9247 from jhjourdan/memprof-byte-loc
Memprof: get precise callstacks when memory is allocated directly in the bytecode interpreter
2020-01-24 22:06:00 +01:00
Vincent Laviron 31a14e3082 Fix the regression test 2020-01-24 14:50:48 +01:00
Vincent Laviron 643fe20ab0 Add regression test 2020-01-24 14:29:56 +01:00
Florian Angeletti dc56d71b53 types: allow class type paths in #t 2020-01-20 17:21:02 +01:00
Leo White c272447b1e Relax the handling of explicit polymorphic types 2020-01-20 13:48:16 +00:00
Jeremy Yallop 73a37d45f8 Add Seq.unfold. 2020-01-15 15:38:46 +00:00
Jacques-Henri Jourdan c4d7bcd352 Memprof: get precise callstacks when memory is allocated directly in the bytecode interpreter.
This includes two changes: first, in bytegen.ml, we add a pseudo-event after every allocation or closure instruction. Second, in the interpreter, we save the current PC in the interpreter stack in [Setup_for_gc].
2020-01-15 11:59:51 +01:00
Jacques-Henri Jourdan e1a22e80fb Memprof API: cannot be start if already running, cannot be stopped if not already running. 2020-01-14 10:42:16 +01:00
Jeremy Yallop 38eb6d5f64
Add Array.for_all2 and Array.exists2 (#9235)
* Partially revert "Removed for_all2, exists2 and find again."

This partially reverts commit 83dcf62ebf.

(Restore for_all2 and exists2.)

* Partially revert "Fixed typos and changed exists2 and for_all2."

This partially reverts commit 7a082785be.

* Array.(for_all2,exists2): simplify documentation; add @since annotations

* Changes: remove trailing whitespace
2020-01-13 13:52:39 +00:00
Jacques-Henri Jourdan 0c8416478c Drop support for tags in memprof.
They are somewhat difficult to handle for native allocations, and it is not clear how useful they are. Moreover, they are easy to add back since [Gc.Memprof.allocation] is a private record.
2020-01-11 13:19:10 +01:00
Gabriel Scherer 8a79f6ce59
Merge pull request #9021 from Octachron/longident_parser
Expose parsers for Longident.t
2020-01-10 11:23:09 +01:00