Commit Graph

2746 Commits (8b7ff3532cd4de3232c044a9db9dd44bfd0f947e)

Author SHA1 Message Date
Thomas Refis efac790249
Make some locations more accurate (#8987) 2020-10-14 16:03:10 +02:00
Florian Angeletti 5e15dd8eb5
Merge pull request #9861 from trefis/9858
Catch Nondep_cannot_erase
2020-10-13 16:31:34 +02:00
Greta Yorsh 855c13cd6e
ability to restart compilation from .cmir-linear IR files 2020-10-13 15:07:13 +02:00
Xavier Leroy f809e9dec1
Make sure the process can terminate when the last thread calls Thread.exit (#9973)
To this end, the tick thread must be stopped, otherwise it prevents
the whole process from exiting.

Fixes: #9971
2020-10-12 15:24:40 +02:00
Mehdi Bouaziz 6ab6052e15
[hashtbl] Restore ongoing traversal status after filter_map_inplace (#8746) 2020-10-12 15:12:09 +02:00
Gabriel Scherer 0cec3a353b
Merge pull request #9803 from trefis/pr9799
pat_env points to the correct environment
2020-10-12 11:00:52 +02:00
Gabriel Scherer 82b29828d2
Allow `[@tailcall true]` and `[@tailcall false]` (#9754)
* remove the unused is_native_tail_call_heuristic forward reference

This forward-reference from Lambda to Asmcomp was used to generate
machine-specific tailcall information in -annot output; this only use
was removed in 57d329e07b, so we can now
remove it to simplify the codebase.

The logic was non-trivial and might be useful again in the future.

* [minor] testsuite: convert warnings/w51.ml to an expect-test

* [minor] translattribute: refactor attribute payload deconstruction

* [@tailcall false]: warn if the call *is* a tailcall

(+ constructor renaming suggested by Nicolás during review)

* Changes

* testsuite: add an example with the 'invalid payload' exception

(suggested by Nicolás during review)
2020-10-10 13:41:39 +02:00
Xavier Leroy 86c8a98f3c
Merge pull request #9948 from nojb/remove_spacetime
The Spacetime memory profiler is not going to be supported in Multicore OCaml, and  is already broken by some of the related changes in OCaml 4.12.  The core development team decided to remove Spacetime support from OCaml 4.12.
2020-10-09 14:43:23 +02:00
Nicolás Ojeda Bär 899a2013aa Adapt tests 2020-10-08 20:28:15 +02:00
Nicolás Ojeda Bär 43883ae4bc Remove labels after calls, checkbound, and GC points 2020-10-08 20:28:15 +02:00
Thomas Refis c7f9c8e559 pat_env: I must not tell lies 2020-10-07 15:54:23 +02:00
Thomas Refis b938cb32c5 add test from PR#9799 2020-10-07 15:54:23 +02:00
Greta Yorsh 04bceec6cc
Save Linear IR before emit (#8939)
* Save IR before emit

* Update .depend for linear_format

* Test for -save-ir-after command-line option

* Address review comments

* Add Changes entry
2020-10-07 11:32:40 +01:00
Leo White 952281944d
Merge pull request #9429 from lpw25/more-hash-operators
Add ppx-only unary operators
2020-10-06 07:46:35 +01:00
Xavier Leroy 786ee521cf
Use "error checking" mutexes in the threads library (#9846)
- Mutex.lock raises Sys_error if the mutex is already locked by the
  calling thread.
- Mutex.unlock raises Sys_error if the mutex is unlocked or locked
  by another thread.

Add the corresponding tests.

Co-authored-by: David Allsopp <david.allsopp@metastack.com>
2020-10-05 15:00:58 +02:00
Xavier Leroy af48d9fe8f
Add a naked pointers dynamic checker (#9956)
This is selected at configure-time, option --enable-naked-pointers-checker.

The major GC warns when it detects out-of-heap pointers that could cause the no-naked-pointers runtime system to crash.

This is supported on x86-64 only, but on all ports (Unix and Windows).

Added tests involving naked pointers in tests/runtime-naked-pointers

Co-authored-by: KC Sivaramakrishnan <kc@kcsrk.info>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Co-authored-by: Enguerrand Decorne <decorne.en@gmail.com>
2020-10-05 14:44:31 +02:00
Nicolás Ojeda Bär 5381e13626
Fix handling of Exit_compiler exception in toplevel (#9798) 2020-10-05 09:46:20 +02:00
Jacques Garrigue a5f63ba65f
Remove propagation from previous branches (#9811) 2020-10-03 10:48:57 +09:00
David Allsopp 3527051e8d Clearer error in testsuite when ocamltest missing 2020-09-22 20:40:57 +01:00
Xavier Leroy 72dbcb8433
Merge pull request #9864 from xavierleroy/is_immediate-refactored
Revised detection of arithmetic instructions with immediate operands
2020-09-22 09:22:26 +02:00
David Allsopp 001c2d1283 Restore Cygwin64 support 2020-09-21 13:36:03 +01:00
Leo White 44fff5c92a Add ppx-only unary operators 2020-09-18 10:33:16 +01:00
Leo White fdbb4e201e Fix PR#7538 2020-09-18 09:38:08 +01:00
Leo White cfb1d66387 Add test for PR#7538 2020-09-18 09:16:52 +01:00
Leo White bbad93d222
Merge pull request #9783 from lpw25/widen-warning-16
Widen warning 16 to more cases
2020-09-18 09:12:56 +01:00
Leo White 98d4f0b864 Widen warning 16 to more cases 2020-09-17 18:54:22 +01:00
Leo White 74270315a0 Add some tests for warning 16 2020-09-17 18:54:22 +01:00
Xavier Leroy a55b0e17dc Test for immediates: also test "checkbound"
Plus: bow to check-typo.
2020-09-17 10:41:16 +02:00
Xavier Leroy a61052edf5 New test exercising immediate arguments to integer operations 2020-09-16 11:52:30 +02:00
Florian Angeletti d0e983e2aa
Merge pull request #9745 from johnwhitington/trunk
Unify labeled and unlabeled Standard Library module interfaces
2020-09-15 11:07:25 +02:00
Xavier Leroy ba0a9c2ce8
Export, document, and use Unix._exit (#9914)
This is a wrapper around the _exit system call.  It has been implemented
in otherlibs/unix/exit.c for a long time but never exported.

This commit exports and documents it as `Unix._exit`.

The Unix implementation of `establish_server` is changed to use `_exit`
and to have gender-neutral comments.

A test was added to check that OCaml finalization actions are not performed.
2020-09-14 19:03:42 +02:00
Florian Angeletti bc4d260de7
Merge pull request #9865 from raphael-proust/pp_print_seq
Stdlib.Format: add pp_print_seq
2020-09-14 16:52:11 +02:00
Thomas Refis 162df93916 catch Nondep_cannot_erase exception 2020-09-14 13:27:03 +02:00
Thomas Refis 6aad418899 add test from #9858 2020-09-14 13:27:03 +02:00
Raphaël Proust faeb43ba5a Add test for Stdlib.Format.pp_print_seq 2020-09-12 09:19:30 +02:00
Florian Angeletti 9a31c888b1
Merge pull request #9433 from lpw25/fix-package-constraints-for-module-aliases
Fix package constraints for module aliases
2020-09-11 18:21:24 +02:00
John Whitington c3f6cd7ff7 Merge remote-tracking branch 'upstream/trunk' into trunk 2020-09-11 14:14:38 +01:00
Chet Murthy 0d46b5206d redo: This little patch fixes the pretty-printing of "rebind" extension-constructors (and also rebind exceptions) so that it matches the parser. With tests. a rebind extension like
type t  += A = M.A [@a]
was pretty-printed as

type t += A[@a] = M.A
[obviously wrong, also not accepted by parser]

With tests for extension-constructors and exceptions.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-extension-constructor-rebind-pprint-4.11
# Changes to be committed:
#	modified:   Changes
#	modified:   parsing/pprintast.ml
#	modified:   testsuite/tests/parsetree/source.ml
#
# Untracked files:
#	Changes.orig
#	parsing/pprintast.ml.orig
#	testsuite/tests/parsetree/source.ml.orig
#	testsuite/tests/parsetree/source.ml.rej
#
2020-09-10 11:09:06 -07:00
Chet Murthy e2ec81fe56 re-do of print polyvariants that start with a core_type,closed, not low with leading bar ("|").
a type "[ | w ]" must be printed with the "|", or it won't be
reparseable.

with tests, Changes entry.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-polyvariant-pprint
# Changes to be committed:
#	modified:   Changes
#	modified:   parsing/parsetree.mli
#	modified:   parsing/pprintast.ml
#	modified:   testsuite/tests/parsetree/source.ml
#
# Untracked files:
#	Changes.orig
#	parsing/pprintast.ml.orig
#	testsuite/tests/parsetree/source.ml.orig
#	testsuite/tests/parsetree/source.ml.rej
#
2020-09-09 13:37:36 -07:00
Gabriel Scherer 03839754f4
List.equal, List.compare (#9668)
`List.equal f foo bar` is nicer than
`List.length foo = List.length bar && List.for_all2 f foo bar`.

Note: with List.compare there is a risk of users having opened the
List module, and then using 'compare' from the stdlib unqualified. For
example:

    List.(sort compare foo bar)

Such code will break (type error), and has to be fixed by using
Stdlib.compare. Stdlib is available since OCaml 4.07; people wishing
to support both 4.12 and older releases would have to avoid opening
List, or rebind 'compare' locally.
2020-09-09 20:01:04 +02:00
David Allsopp 212c0fa70c
Allow running a single test in testsuite/Makefile (#9807)
* Allow running a single test in testsuite/Makefile.  Syntax is `make one FILE=...`

* Rename `make list` into `make one LIST=...` for consistency.

* Always read actual lines from files

read should, as a general rule, always be followed by -r in scripts. If
IFS is not empty, then spaces are stripped as well.
2020-09-09 19:54:00 +02:00
progman1 8f87147c9d toplevel: a discrepancy in extension constructors printing
fixes #9148

genprintval.tree_of_extension was missing instantiation of constructor argument types.
the Ctype.apply code is factorized out from a number of other places.
2020-09-08 18:04:09 +02:00
Xavier Leroy 1b48b5aa3c
Merge pull request #9872 from xavierleroy/seek-text-channels
Revised {in,out}_channel_length and seek_in for channels in text mode
2020-09-08 09:52:22 +02:00
David Allsopp db0eb09fca
Merge pull request #9801 from dra27/ocamltest-cmp-take-729
Finally fix EOL-at-EOF and normalisation in ocamltest
2020-09-07 14:06:27 +01:00
Xavier Leroy a7d1af4a87 Test rand.ml: make it less likely to fail
Use Random.bits() instead of Random.int 10000 to get a 2^-30 expected
failure rate instead of 10^-5.
2020-09-07 13:55:59 +02:00
Jeremy Yallop 44c053008a
Merge pull request #9066 from gasche/either
Add `('a, 'b)  Either.t = Left of 'a | Right of 'b` and `List.partition_map`
2020-09-03 22:47:55 +01:00
Florian Angeletti ce04a5c1b1 Merge pull request #9862 from Octachron/4.11.1_with_less_daring_assertions
9859: revert 9348, inferred function types and :>
(cherry picked from commit 28b82e2e397d129840e35fb8da0b8af8b9f59633)
2020-09-03 13:55:17 +02:00
Florian Angeletti 66c368ae77 Merge pull request #9857 from lpw25/fix-poly-refs-check
Add missing `lower_contravariant` call (fixes #9856)

(cherry picked from commit 56707233fb6e33d0e5d0719b8550a15db8aa02d9)
2020-09-03 13:55:17 +02:00
Florian Angeletti 63972f9687
Fix injectivity test wrt value restriction (#9867)
The original test is rejected when the value restriction is properly implemented.
2020-09-03 11:09:35 +02:00
Gabriel Scherer ca6f3ee057 List.partition_map : (a -> (b, c) Either.t) -> a list -> b list * c list 2020-09-02 13:59:53 +02:00