Commit Graph

2887 Commits (1cd6e4451f04af4871675d0eecd48b3bac262b67)

Author SHA1 Message Date
Gabriel Scherer 314154ad69 objinfo: tell when the object file comes from a different OCaml version
When passed an object file that comes from a different OCaml version,
objinfo will currently just detect that the magic number is not what
it expects, and claim it is not a valid file. This is irritating.

The error message output by objinfo now looks like this:

    File /home/gasche/.opam/4.08.0/lib/astring/astring.cmi
    Wrong magic number:
    this tool only supports object files produced by compiler version
    	4.11.0+dev0-2019-10-18
    This seems to be a compiled interface file (cmi) for an older version of OCaml.
2019-12-03 00:08:30 +01:00
Gabriel Scherer 9d81d6a10e new Misc.Magic_number module for magic number handling
This module was originally inspired by js_of_ocaml Misc.MagicNumber module
https://github.com/ocsigen/js_of_ocaml/blob/151b811/compiler/util.cppo.ml#L277-L347

It provides parsing and validation function for magic numbers, that
can tell the difference between "not a valid magic number" and "a
valid magic number, but with another version", and print user-friendly
user messages about it.

It does not contain any knowledge for where to find the magic number
in an OCaml file (this depends on the file format); the parsing
function should be called with an input channel already at the right
position for whichever format is expect.
2019-12-03 00:08:29 +01:00
Jacques Garrigue 27ef14dab9
Fix exhaustivity of GADTs coming from incomplete unification (#9154) 2019-12-02 20:49:51 +01:00
Sébastien Hinderer 1c0424c80e ocamltest: draft of reference manual (tutorial section) 2019-11-28 18:04:53 +01:00
Sébastien Hinderer 69316099b0 Fix BFD support on OpenBSD 2019-11-28 16:20:03 +01:00
Florian Angeletti 92c7fd19e3 update Changes 2019-11-28 11:46:22 +01:00
Greta Yorsh 6daaf62904 Do not emit references to dead labels (spacetime) (#9097) 2019-11-26 12:06:19 +00:00
Gabriel Scherer 05f15cf215
Merge pull request #8820 from Drup/stringquot
Quoted extensions
2019-11-25 21:26:53 +01:00
David Allsopp 75983ab9b1 Ensure Makefile.config gets Windows-style prefix
Prefix may be passed to configure using a Cygwin-style PATH (e.g.
`./configure --prefix ~/local`). Use cygpath to ensure that the correct
version gets written to Makefile.config, or the resulting compiler has
an invalid default stdlib path.
2019-11-25 14:14:59 +01:00
Gabriel Scherer ec5a85c26f [minor] Changes fix
the PR number was missing, as reported by Gaëtan Gilbert.
2019-11-23 22:36:45 +01:00
David Allsopp fe31a0179d Move #9130 to 4.10 in Changes 2019-11-21 13:55:45 +00:00
David Allsopp 504d95c275 Fix formatting of closing brace in records 2019-11-21 12:06:53 +00:00
Jacques-Henri Jourdan 50fd3d39d8 Make [caml_stat_resize_noexc] compatible with the [realloc] API when the old block is NULL (#9119) 2019-11-18 10:48:14 +01:00
David Allsopp 2c82bfb35b
Merge pull request #9121 from dra27/fix-force-safe-string
Fix error in patch to configure.ac from #1859, with follow-on corrections
2019-11-17 08:44:38 +00:00
Konstantin Romanov a9b0ca44d2 Add set_position and set_filename to Lexing. 2019-11-16 22:14:16 +00:00
Gabriel Scherer a68d8d6e49 Changes: add missing statmemprof PRs 2019-11-15 14:01:58 +01:00
Gabriel Scherer fc14b25989 Changes: #9113 was backported to trunk 2019-11-15 13:53:07 +01:00
Gabriel Scherer fa3dfaa6a8
Merge pull request #9120 from mmottl/fix-minor-ratio-bug
Fix GC ratio multiplier bug
2019-11-15 13:47:19 +01:00
Markus Mottl 7cab2fdeaa Updated Changes with bugfix for #9073, #9120 2019-11-14 11:16:25 -05:00
Kate e0ee2f7a05 Fix configure: Define the CAML_SAFE_STRING variable when force-safe-string is on 2019-11-14 11:18:43 +00:00
Gabriel Scherer 757a64464f ocamldoc: better support of multiline code blocks in the manpage backend
Before, `man Map` would show:

```
For instance: module IntPairs = struct type t = int * int let compare (x0,y0) (x1,y1) = match Stdlib.compare x0 x1 with 0 -> Stdlib.compare y0 y1 |
c -> c end module PairsMap = Map.Make(IntPairs) let m = PairsMap.(empty |> add (0,1) hello |> add (1,0) world )
```

Now it shows:

```
For instance:
     module IntPairs =
       struct
         type t = int * int
         let compare (x0,y0) (x1,y1) =
           match Stdlib.compare x0 x1 with
               0 -> Stdlib.compare y0 y1
             | c -> c
       end

     module PairsMap = Map.Make(IntPairs)

     let m = PairsMap.(empty |> add (0,1) "hello" |> add (1,0) "world")
```

(in both cases the code is in bold)
2019-11-14 11:31:05 +01:00
Drup 5050cc7ed1 Add changes. 2019-11-13 14:54:28 +01:00
Gabriel Scherer 6465616fd9 improved error messages for exceptions in signature errors
Example:

    module Test : sig
      exception Foo
    end = struct
    end

Before this PR:

    Modules do not match: sig end is not included in sig exception Foo end
    The extension constructor `Foo' is required but not provided

After this PR (second line changed):

    Modules do not match: sig end is not included in sig exception Foo end
    The exception `Foo' is required but not provided
2019-11-12 14:16:39 +01:00
Gabriel Scherer a5e121621d
Merge pull request #9060 from gasche/protect_refs-backtraces
Misc.protect_refs: use Fun.protect to protect the backtrace
2019-11-07 20:44:34 +01:00
Gabriel Scherer f5252e9840 Misc.protect_refs: use Fun.protect to protect the backtrace
Currently Fun.protect and Misc.try_finally can be used in code that
tries carefully to preserve the first-failure backtrace, but
Misc.protect_refs cannot. This PR fixes the discrepancy. See #9057 for
a use-case.

See the GPR ( https://github.com/ocaml/ocaml/pull/9060 ) for an
in-depth discussion of the potential performance impact of this
change.
2019-11-07 14:43:17 +01:00
Gabriel Scherer e7c681d14d typedtree: make the pat_desc field of patterns immutable 2019-11-07 14:41:59 +01:00
Gabriel Scherer 65e6874026
Merge pull request #9098 from Octachron/manual_operator_chars
manual: operator char classes description
2019-11-07 14:36:48 +01:00
Bernhard Schommer e5ebec7058 Fold map function for List (#8894)
The fold_map function is quite common combination of fold and map
which allow it to pass an accumulator through map.
2019-11-07 14:12:58 +01:00
Leo White fb33b74bca Relax the level handling when unifying row fields (#9064) 2019-11-07 09:38:46 +00:00
Florian Angeletti e3f83d58dc manual: fix operator char classes 2019-11-06 16:03:24 +01:00
Gabriel Scherer 92bfafc1ac
Merge pull request #8805 from stedolan/statmemprof-comballoc-native
Keep information about allocation sizes, for statmemprof, and use during GC.
2019-11-06 13:44:14 +01:00
Simon Parry f43323be52 Fix toplevel show directive to work with constructors
The show directive now has some basic facility to show
useful information for constructors of "normal" values,
exceptions and other non-exception extension constructors.

Also updated show_type to print out recursion status
with a default of Trec_first.
2019-11-05 20:02:03 +00:00
Gabriel Scherer b667fec2e7
Merge pull request #9079 from garrigue/refactor-ppat_of_type
Typecore.type_pat: refactor ppat_of_type and Need_backtrack in wildcards
2019-11-04 17:03:32 +01:00
Jacques Garrigue da3295c3af Typecore.type_pat: refactor ppat_of_type and Need_backtrack in wildcards
There is a small, desirable change of behavior in this PR:
we do not backtrack on all wildcard pattern explosions,
only on those where ppat_of_type knows there will be GADTs.
As a result, some exhaustivity counter-examples
have been improved with more cases (see testsuite for an example).
2019-11-04 15:20:56 +01:00
Gabriel Scherer a71d42b682
Merge pull request #8938 from gretay-js/stop-before-emit
Stop before emit
2019-11-04 15:13:33 +01:00
Stephen Dolan 8c155a04be Changes 2019-11-04 14:13:05 +00:00
Gabriel Scherer 312253ce82 split patterns into "value patterns" and "computation patterns"
Value patterns match on a value (the result of computation), while
computation patterns handle the effects (hint hint) of
a computation. The only forms of computation patterns in OCaml today
are value patterns and exception patterns (exception p).

The sub-pattern `p` of the `lazy p` construction should be
a computation pattern, rather than a value pattern. This pull-request
does not make this change.

Most of the changes in this PR are boilerplate -- it really is a lot
of work now to add a new syntactic category to the typed-tree
syntax. This boilerplate is fairly automatic and should be easy to
review.

There is a subtle part to the patch, though: the implementation of the
pattern type-checking. It now has to reconstruct the value/computation
distinction (absent from the parse-tree), and return values from two
different types. Instead of splitting the type-checker in several
functions (which risked code duplications), I choose to use a GADT to
have the same [type_pat] function return two different types depending
on the caller. This is the least invasive way to adapt this part of
the codebase, whose inherent complexity is so large (unfortunately)
that adding a GADT to the mix barely makes a difference.
2019-10-31 13:29:16 +01:00
Greta Yorsh 4d7d53c805 Add Changes entry 2019-10-30 19:05:23 +00:00
Gabriel Scherer 03c33f5005
Merge pull request #9078 from gasche/ocamltest-all-compilerlibs
ocamltest: enable working with all compilerlibs
2019-10-30 15:32:35 +01:00
Gabriel Scherer 5c3d4afd6a ocamltest: enable working with all compilerlibs
ocamltest maintains a list of "subdirectories where .cmi files of
compilerlibs modules are", and uses "include ocamlcommon" to make the
content of ocamlcommon.cma available.

The present PR updates the list of subdirectories (driver/ was not
included, so Compmisc.initial_env() was unusable) and creates modifier
names (like "ocamlcommon") for all compilerlibs archives.
2019-10-30 14:47:45 +01:00
Gabriel Scherer dd47fafbf5
Merge pull request #9076 from gasche/install-all-compilerlibs
Makefile: install all compiler-libs archives instead of a manual listing
2019-10-30 11:56:48 +01:00
Gabriel Scherer 8b237caad1
Merge pull request #9074 from Octachron/regularity_error_message
#9069: reworded error messages for non-regular structural types
2019-10-30 11:04:18 +01:00
Florian Angeletti ee32976da1 reworded errors for non-regular structural types
* explicitly mention that the type definition is non-regular
* avoid implicit permutation in type parameters
* don't try to propose a "fix"
2019-10-30 10:02:31 +01:00
Gabriel Scherer b0d1d6084c Makefile: install all compiler-libs archives instead of a manual listing
The issue #9050 comes (partly) from #2281 forgetting to add the
compilerlibs/ocamlmiddleend archives in the installation target. The
present patch should solve this issue once and for all, by using
a wildcard to install all archives that have been built in
compilerlibs/, instead of using a manual listing.

Compared to trunk, the following extra files are installed in
$(LIBDIR)/compilerlibs: ocamlmiddleend.{a,cma,cmxa}. There are no
other changes in the installed-files list.
2019-10-29 18:07:51 +01:00
Nicolas Ojeda Bar bf997d5b29 Changes 2019-10-29 12:37:17 +01:00
zapashcanon c0e4096eaa add List.filteri to the stdlib (#9059) 2019-10-29 09:45:19 +01:00
Stephen Dolan b0ad600b88 Use a more compact representation of debug information.
Locations of inlined frames are now represented as contiguous
sequences rather than linked lists.

The frame tables now refer to debug info by 32-bit offset rather
than word-sized pointer.
2019-10-22 11:46:35 +01:00
David Allsopp 61ce607f1e Fix placement of #9031 in Changes 2019-10-19 20:33:50 +01:00
David Allsopp e0b7c0ed49
Merge pull request #9031 from db4/fix-win32-overflow-detection
Unregister win32 stack overflow handler in caml_shutdown()
2019-10-19 20:31:42 +01:00
David Allsopp dd492d84a5
Merge pull request #9051 from dra27/fix-9043
Add missing local root in win32 `Unix.select`
2019-10-19 08:55:23 +01:00
Gabriel Scherer 7b111e5640 sections for the working-version Changelog 2019-10-18 23:08:32 +02:00
Florian Angeletti c67cb28116 create an OCaml 4.10.0 section in Changes 2019-10-18 18:41:22 +02:00
Gabriel Scherer cc7231f5a9
Merge pull request #9030 from gasche/refactor-type_pat
typecore: a proper datatype for type_pat modes
2019-10-18 15:42:27 +02:00
Leo White 25edeab66b
Improve errors for first-class modules (#8903)
* Improve errors for first-class modules

* Changes based on Jacques' suggestions

* Add Changes entry
2019-10-18 11:41:48 +01:00
Gabriel Scherer 01a34208c3
Merge pull request #9046 from gasche/disable-warning-30-by-default
disable warning 30 (same constructor/label used in two mutually-recursive declarations)
2019-10-18 11:54:05 +02:00
Gabriel Scherer fe8ccc846d typecore: a proper datatype for type_pat modes
This type describes the parameter space of the [type_pat] function
(which type-checks of patterns, and in fact does quite a bit more) in
a way that also documents its behavior.

The code ends up being slightly more verbose at places: it's always
shorter to access one of four independent arguments than to go get the
information inside one record structure. But now it is clear which
parameters are meaningful in which situation, and I believe the code
is easier to read.

(This is joint work with Florian Angeletti)
2019-10-18 11:50:49 +02:00
Gabriel Scherer 9a0ebc18d4
Merge pull request #8993 from gadmm/resource-safe-api-pt1
Resource-safe C interface, part 1 (the 4.10 backwards-compatibility edition)
2019-10-18 07:02:36 +02:00
David Allsopp a30823a2dc Obey GC Rule 5 in win32unix/select.c 2019-10-17 21:08:50 +01:00
David Allsopp 81f9cb1903 Fix missing root in select.c 2019-10-17 19:37:09 +01:00
Guillaume Munch-Maccagnoni 890bb908e8 Changes 2019-10-17 20:14:19 +02:00
Leo White ec77196cb2
Limit GC credit to 1.0 (#8667)
* Limit GC credit to 1.0

* Add Changes entry
2019-10-17 15:41:26 +01:00
Florian Angeletti 6f772ec21c
Merge pull request #8860 from Octachron/safer_type_expr_printer
#8856: cyclic type expressions in error submessages
2019-10-17 16:28:04 +02:00
Gabriel Scherer e18564d839
Merge pull request #8981 from gretay-js/incompatible-o-c
Fix check for incompatible -c and -o options
2019-10-17 11:44:46 +02:00
Florian Angeletti 816a5088e0 Avoid duplicated mark_loops 2019-10-17 10:03:58 +02:00
Gabriel Scherer dcfc1b8b81 fix the 7636 Changelog 2019-10-17 09:56:00 +02:00
Gabriel Scherer 92a260fdf6 disable warning 30 (same constructor/label used in two mutually-recursive decls)
Warning 30 warns when the same constructor/label is used in two
mutually-recursive type declarations. This warning (added in OCaml
3.12, 2010) was meaningful at the time where constructor/label
conflicts had a shadowing semantics: the "last" definition would mean,
while ideally mutually-recursive definitions should not be strictly
ordered but defined "all at once".

Since OCaml 4.01 (2013) we support type-based disambiguation of
constructor/label names and it is now common to write code such as,
say

    type pattern = Var of var | ...
    type expr = Var of var | ...

(no warning, of course). But warning 30 fires if you instead write

    type pattern = Var of var | ...
    and expr = Var of var | ...

This doesn't make much sense, and in particular it certainly makes no
sense to enable this warning by default. The present PR disables it by
default.
2019-10-16 18:25:54 +02:00
Jacques Garrigue c147442b01
Fix #7636 using expansion for vanishing parameters (#9040) 2019-10-16 18:02:40 +02:00
Gabriel Scherer 81420443a3
Merge pull request #9037 from gadmm/resource-safe-api-pt0
Resource-safe C interface, part 0
2019-10-16 13:59:10 +02:00
Guillaume Munch-Maccagnoni 2433b9373f Separate caml_check_urgent_gc back into GC actions and async callbacks
In 8691, caml_check_urgent_gc was merged with the function that runs
asynchronous callbacks. The rationale was that caml_check_urgent_gc
already runs finalisers, and so could have run any asynchronous
callbacks.

We agreed on a different strategy: we know that users could not rely
on asynchronous callbacks being called at this point, so take the
opportunity to make it callback-safe, like was done for allocation
functions.

The new check_urgent_gc no longer calls finalisers (nor any
callbacks), and instead two internal functions are introduced:

* caml_do_urgent_gc_and_callbacks : function to perform actions
  unconditionally.

* caml_check_urgent_gc_and_callbacks : function that checks for
  something to do, and then executes all actions (GC and callbacks).
2019-10-15 19:24:41 +02:00
Stephen Dolan 71f3ec4091 Clear destination registers before sqrt instruction on amd64 (#9041)
This avoids a partial register stall.
2019-10-15 19:04:20 +02:00
Greta Yorsh 860efce4d0 Update Changes 2019-10-15 13:18:05 +01:00
Damien Doligez 01bdd5bbc4
best-fit allocator (#8809) 2019-10-15 13:52:16 +02:00
David Allsopp 36b7a70713 Deprecate the addr typedef (#8896)
The typedef was guarded by CAML_INTERNALS, but given its accidental use
in the public Is_young macro, mark the typedef as deprecated in case
CAML_INTERNALS is being defined "in the wild" to workaround this.
2019-10-14 19:34:07 +02:00
Dmitry Bely 245b71bee6 Unregister win32 stack overflow handler in caml_shutdown() 2019-10-14 15:49:01 +03:00
Stephen Dolan fd568688d7 Remove the transformation untag_int(tag_int x) = x. (#9032)
This transformation is incorrect for certain large values of x,
as it can get the wrong value in the high bit. In certain cases
where the high bit is not used (esp. storing a byte into a string),
the transformation is kept intact.

Fixes #9028.
2019-10-14 14:39:17 +02:00
Xavier Leroy 05759f10e0
Merge pull request #9006 from stedolan/int32-compilation
Int32 code generation improvements on 64 bit platforms: fewer sign extensions + faster AMD64 instruction sequence for zero extensions.
2019-10-14 14:35:09 +02:00
Thomas Refis 79f1c73462
Warn about unused functor parameters (#8891) 2019-10-14 11:11:01 +01:00
Gabriel Scherer 5f0607d1f3 Changes: fix the placement of the #8651 entry 2019-10-14 11:59:44 +02:00
Stephen Dolan 0852266a07 Improve code-generation for 32-to-64-bit zero-extension on amd64. 2019-10-14 10:45:15 +01:00
Gabriel Scherer cc1a05b055
Merge pull request #8651 from proux01/printf-h
Add printf '%#F' to output floats in hexadecimal OCaml constants
2019-10-14 11:43:01 +02:00
Jacques-Henri Jourdan 23e5bfa3bb Better stack backtraces for C calls in bytecode (#8641)
The previous mechanism worked for C calls that raise an exception, but not for C calls that call back into OCaml code which raises an exception.

This commit addresses the issue by saving the PC in the interpreter stack before a C call, so that the backtrace mechanism always sees it.

However, if an external is declared in the .ml file and exposed in the .mli file as a val, then ocamlc generates a wrapper that adds a spurious entry in the stack frame. In this PR, this change in behavior results in the re-declaration of Printexc.get_callstack as an external instead of a val, so that the spurious stack frame does not appear in call stacks obtained from Printexc.get_callstack.
2019-10-12 18:25:58 +02:00
Gabriel Scherer e48615c779
Merge pull request #8840 from gasche/tools-ocamlc.opt
Build system: use ocaml{c,opt}.opt instead of ocaml{c,opt} when available
2019-10-12 14:01:03 +02:00
Gabriel Scherer 39071d185e Changes 2019-10-12 10:30:34 +02:00
David Allsopp 96de3229cf Don't use addr typedef in Is_young
addr type is internal, but Is_young is not.
2019-10-12 08:45:27 +01:00
Jacques-Henri Jourdan 7db098bde6 Update Changes. 2019-10-11 11:19:39 +02:00
Xavier Leroy d29a01e049
Merge pull request #8670 from stedolan/stack-overflow-fix
Fix stack overflow detection with systhreads.
2019-10-11 10:30:01 +02:00
Gabriel Scherer 065fea1edd
Merge pull request #9023 from Octachron/only_raise_need_backtrack_inside_or
type_pat: restrict the use of Need_backtrack
2019-10-10 18:30:48 +02:00
Thomas Refis 8e928caea7
a better representation for modules with no name (#8908) 2019-10-09 14:15:37 +01:00
Florian Angeletti 15f19d4a09 Changes 2019-10-08 18:55:31 +02:00
Gabriel Scherer e8c2bf8477
Merge pull request #9015 from damiendoligez/fix-pr8789
Fix #8789
2019-10-07 22:07:49 +02:00
Gabriel Scherer 7e34c1ea1e
Merge pull request #8995 from dra27/dev-opts
Allow development configure options to be stored in Git 🏅
2019-10-05 18:44:25 +02:00
Gabriel Scherer e232369580
Merge pull request #8835 from dra27/save-the-planet
New configure option to disable building and installing library manpages
2019-10-05 16:52:16 +02:00
David Allsopp 4f09104d88 Allow by-host worktree-sharable configure caches
The Git configuration value ocaml.configure-cache can be used to specify
a directory to keep autoconf cache files in, relative to the worktree
root (so `git config ocaml.configure-cache .` enables the feature, and
`git config --global ocaml.configure-cache ..` enables it for all
worktrees, assuming they're at the same level).

autoconf's --cache-file option speeds up future runs of configure by
caching the results of previous tests. The cache is invalidated if any
environment variables differ (e.g. LDFLAGS) or if the build-host-target
triplet differs. This is a nuisance on Windows, where configure is both
very slow and it's also common to build with multiple different --host
values.

This PR allows a tree to be quickly reconfigured from one Windows port
to another.
2019-10-05 14:50:57 +01:00
David Allsopp 345fd4c3f9 Allow Git config options to be passed to configure
The Git configuration value ocaml.configure is now passed to the
configure script's arguments before $@ if (and only if) OCaml is being
configured from a Git clone.

This allows, for example:

- Developer-specific preferences (e.g. `--disable-ocamldoc` or
  `--disable-debug-runtime`)
- Automatic use of autoconf cach files (-C option)

It is implemented by inserting a test at the top of `configure`, which
is bypassed if `.git` doesn't exist.
2019-10-05 14:50:35 +01:00
Jacques Garrigue 16a13e668b
fix issue #8792 and replace log_type by set_type_desc in Btype (#9018) 2019-10-05 13:17:57 +02:00
Vincent Laviron 60f58174ba
Split cmmgen into generic cmm helpers and clambda-specific transformations (#1963) 2019-10-04 17:49:59 +02:00
David Allsopp d01f0b7d71 Add reviewer for #8951 2019-10-04 14:38:33 +01:00
Damien Doligez 454ee52984 Fix #8789 2019-10-04 15:25:26 +02:00
David Allsopp fb6f58ea69
Merge pull request #8951 from shindere/make-default-target
Let make's default target build the compiler
2019-10-04 14:23:27 +01:00
Nicolás Ojeda Bär 46ca15365a
Merge pull request #8971 from nojb/filename_nul
Add Filename.null
2019-10-03 18:05:52 +02:00
Tom Kelly 62d6917fd5 amd64: Emit 32bit registers for Iconst_int when we can (This is a reuse of (better) code proposed in PR1490 credit to xclerc/mshinwell) 2019-10-03 16:52:50 +02:00
Guillaume Munch-Maccagnoni b304042b29 Fix missing Caml_state (#8940)
* Fix free identifiers in spacetime

* Fix free identifiers in tools/gdb-macros

* [minor] Fix Caml_state fields in comments, and other comment updates

* Changes
2019-10-03 16:27:32 +02:00
Nicolás Ojeda Bär 91407069a4 Changes 2019-10-03 13:55:38 +02:00
Alain Frisch 552858dc5a
Unbox across static handlers (#8735) 2019-10-03 13:22:34 +02:00
Jacques-Henri Jourdan 902141206f Update Changes for #8691. 2019-10-02 11:10:13 +02:00
Gabriel Scherer ba90da42ac List.concat_map : ('a -> 'b list) -> 'a list -> 'b list (#8760) 2019-10-01 15:53:14 +01:00
Gabriel Scherer 5fc29e52a4
Merge pull request #8992 from Octachron/shared_args
Share argument implementations
2019-10-01 12:08:54 +02:00
Jacques Garrigue 1e895dbaee
Allow compiling ocamldoc with -principal (#8955)
Also solves issue #6922
2019-09-30 21:14:06 +02:00
Gabriel Scherer dc56217fec
Merge pull request #8941 from gadmm/breaking-check_urgent
Caml_alloc: Document new behaviour and upgrade path (check_urgent_gc)
2019-09-30 16:46:03 +02:00
Sébastien Hinderer 987b0814d7 Let make's default target build the compiler
This commit makes it possible to build the OCaml compiler according to
its configuration by simply runnning make. There is no need to specify
neither world nor world.opt explicitly, although the two targets
remain available.

This commit also introduces (and starts making use of) the
NATIVE_COMPILER build variable whosse value is true when the native
compiler is enabled and false otherwise.
2019-09-30 16:01:29 +02:00
Florian Angeletti 7d7eaa0622 Update changelog 2019-09-30 15:57:03 +02:00
Nicolás Ojeda Bär d3553ed0e6 Update Changes 2019-09-30 14:25:26 +02:00
Nicolás Ojeda Bär 5cf63d8450
Merge pull request #8975 from nojb/ocamltest_find_tests
ocamltest : get rid of "ocamltests" files
2019-09-30 14:13:39 +02:00
David Allsopp 705739fa54 Fix failure to install tools links
In --disable-installing-bytecode-programs mode, the .opt version of the
tools is installed, but the symlink for the tool itself is not created.
2019-09-29 13:57:15 +01:00
Nicolás Ojeda Bär 8ddbf8b753 Changes 2019-09-28 18:03:59 +02:00
Guillaume Munch-Maccagnoni aa13b8cc97 Document new behaviour and upgrade path (check_urgent_gc) 2019-09-28 02:09:55 +02:00
David Allsopp 2d717cb71a Add --disable-stdlib-manpages to configure 2019-09-27 17:13:24 +01:00
Pierre Roux 1e3cd41fe7 Add printf `%#F` to output floats in hexadecimal OCaml constants 2019-09-26 15:55:32 +02:00
Nicolás Ojeda Bär 3aff5141fd Add a new -output-complete-exe option (#8872)
This option allows to build self-contained bytecode executable and is aimed to replace `-custom`. The main difference between the two is that executables produced by `-output-compete-exe` can be stripped.
2019-09-25 08:07:31 +01:00
Gabriel Scherer e6ffdba72a
Merge pull request #8968 from gasche/refactor-pattern-traversals
typedtree: refactor the generic pattern traversal functions
2019-09-24 22:47:44 +02:00
Gabriel Scherer 7b10a26bc8 refactor the generic pattern traversal functions 2019-09-24 21:20:10 +02:00
Jeremie Dimino 2d31ebfc8b Add support for [@@immediate64]
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-09-24 07:56:15 +01:00
Sébastien Hinderer 688687d153 Changes entry 2019-09-23 14:52:25 +02:00
Gabriel Scherer 8f7708a0fb
Merge pull request #8954 from Armael/fix-toplevel-submsg-locs
Fix error submessages in the toplevel: do not display dummy locations
2019-09-20 10:58:09 +02:00
Florian Angeletti cb11bcf50a
manual: move pattern open out of the extension chapter (#8950)
* move the grammar description to the pattern section of the language reference
* add a small example in the module chapter of the tutorial
2019-09-20 10:19:18 +02:00
Armaël Guéneau e5a87c7233 update Changes 2019-09-19 15:43:07 +02:00
Gabriel Scherer 452c3df125 Changes: create a 4.09 maintenance branch, just in case 2019-09-19 15:39:04 +02:00
Thomas Refis f56b59d017
Fix "open struct .. end" on clambda backend (#8944) 2019-09-17 06:50:11 -04:00
Alain Frisch 5c031d2d3d Decide unboxing of let-bound expressions based on their Cmm translation (#2165) 2019-09-17 10:22:08 +02:00
Gabriel Scherer 5c7c619d4d List.find_map : ('a -> 'b option) -> 'a list -> 'b option (#8832) 2019-09-13 17:58:01 +02:00
Gabriel Scherer 2ed8badb40 [minor] fix 4.08.1 Changes 2019-09-13 13:36:52 +02:00
Gabriel Scherer 46a8f926e9 Changes: 4.09 reorderings 2019-09-13 11:58:27 +02:00
Gabriel Scherer f400d5c46d Changes WIP 2019-09-13 11:50:42 +02:00
Gabriel Scherer 08469ec0ce
Merge pull request #8928 from gretay-js/linear_funstate
Move contains_calls and num_stack_slots from Proc to Mach.fundecl
2019-09-12 22:21:29 +02:00
Greta Yorsh 04996b7e2e Update Changes 2019-09-12 12:58:54 +01:00
Kyle Miller 03ddf295d5 Fix source highlighting for long toplevel phrases (#7925) (#8611)
Fix #7925: error messages for long toplevel inputs would have dummy locations
2019-09-11 20:07:34 +02:00
Vincent Laviron f814450b60 Flambda: prevent recursive approximations in Build_export_info (#8924)
Fixes #8921
2019-09-11 15:28:24 +02:00
Gabriel Scherer 24cf2f926f backport #8871 to 4.09 2019-09-10 18:09:55 +02:00
Kate c01dbc1bab Enable force-safe-string by default (#1859)
* Enable force-safe-string by default

* Run the autogen script

* Add a line to the changelog

* Remove test using the -unsafe-string argument

* Disable program comparison for tests giving different binaries between ocamlopt.opt and ocamlopt.byte after switching to force-safe-string by default

* Add a comment where the compare_programs tests have been disabled to refer to an explaination of the problem
2019-09-10 17:49:20 +02:00
Leo White cdf43f9894 Add Changes entry 2019-09-09 18:36:55 +02:00
Pieter Goetschalckx 30fbae7265 Octal character literals and apostrophes in ocamlyacc actions (#1932) 2019-09-06 16:12:54 +02:00
Gabriel Scherer bf240cbab5
Merge pull request #8914 from gasche/clarify-unboxed-warning
clarify the warning of the unboxable-type-in-primitive warning
2019-09-05 21:01:42 +02:00
Gabriel Scherer e8498699f9 clarify the warning of the unboxable-type-in-primitive warning
A discussion in a forum thread
  https://discuss.ocaml.org/t/primitive-declaration-is-unannotated-and-unboxable/4306
points out that 'unboxable' is ambiguous as it can be read as either
un-boxable or unbox-able.

This commit reformulates the warning to avoid using 'unboxable', but
the very explicit 'may be either boxed or unboxed', along with a more
detailed explanation of the issue that the warning is about.
2019-09-05 17:09:06 +02:00
Gabriel Scherer eec62e5212 Changes 2019-09-03 17:45:47 +02:00
Gabriel Scherer 4710eb2114 ocamltest: fix "promote" actions on reference files with skipped lines/bytes 2019-09-03 11:43:55 +02:00
Gabriel Scherer bb1be5dd17 ocamldoc/Makefile: use ocamldoc.opt when available 2019-08-30 09:59:27 +02:00
Gabriel Scherer fd7cbd8c49
Merge pull request #8729 from jhjourdan/memprof_intern
Memprof support for unmarshalled data
2019-08-29 22:39:46 +02:00
David Allsopp 2195dbaad0
Merge pull request #8897 from stedolan/fix-alloc-async
Ensure that C allocation functions do not trigger callbacks
2019-08-29 13:36:47 +01:00
Stephen Dolan dcf346450b Ensure that C allocation functions do not trigger callbacks.
Fixes a bug in #8691 and adds a test.
2019-08-29 09:35:42 +01:00
Thomas Refis ccbdb8f9ba Changes 2019-08-28 13:24:10 +01:00
Jacques-Henri Jourdan 90073e96e5 Memprof tracking of interned data. 2019-08-27 19:14:56 +02:00
Stephen Dolan 8b20b69a16 Fix stack overflow detection with systhreads 2019-08-27 14:58:07 +01:00
Stephen Dolan 5ad64306d3
Merge pull request #8713 from kayceesrk/r14-globals
Move C global variables to a dedicated structure
2019-08-27 13:30:22 +01:00
Valentin Gatien-Baron f40011556c in -dtimings output, show time spent in C linker clearly 2019-08-26 07:58:28 +02:00
David Allsopp 7b2032b776 Update Changes 2019-08-24 12:21:03 +02:00
KC Sivaramakrishnan 525a1cec7b Revert changes to compatibility.h 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan 22d5a0cf6e Update Changes file entry 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan ca8b9927ce Unbreak Changes file 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan 316a5ff358 Copyright headers and attribution 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan f9852bb3fe Add changes entry 2019-08-23 09:50:05 +05:30
Thomas Refis f69e08ec75 Changes 2019-08-21 15:48:19 +01:00
Nicolás Ojeda Bär 9df130f14d Changes 2019-08-17 00:08:30 +02:00
Florian Angeletti a2d15b26d1
Merge pull request #8844 from MekhrubonT/trunk+mekh+1task+change_output
Improved error messages for type mismatches
2019-08-16 20:43:02 +02:00
Gabriel Scherer a72855eaaa
Merge pull request #8874 from Lereena/typing-misc-add
Add some tests for typechecking error messages
2019-08-16 18:31:50 +02:00
Oxana b4f5825c6f Add Changes entry 2019-08-14 23:10:23 +03:00
Thomas Refis 7f72b7b7d8 Changes 2019-08-13 14:35:46 +01:00
Mekhrubon Turaev fea21a54c4 added documentation for extension_constructor and extension_only_constructor functions in Printtyp; modified Changes file 2019-08-13 11:03:29 +01:00
Gabriel Scherer 387e41c5b3
Merge pull request #8866 from rmdouglas/issue/7924
Fixes for refactoring to a structured representation of Typedecl_variance.Bad_variance exception
2019-08-10 08:12:37 +02:00
Rian Douglas 1cd94ad072 Changed to using a Variant for the Variance, instead of a bare int 2019-08-09 12:03:28 -07:00
Vincent Laviron 0557f07e70 Fix lsl overflow detection (#8865)
The formula for Misc.no_overflow_lsl a k is sound only if k < width of type int.
2019-08-09 09:42:11 +02:00
Greta Yorsh e08a9688fc Eliminate dead `ICatch` handlers (#2321) 2019-08-06 12:23:13 +01:00
Florian Angeletti 1da178b453
Merge pull request #8833 from Octachron/toplevel_redefinition_beginner_hint
A beginner hint for type redefinitions in the toplevel
2019-08-01 16:26:29 +02:00
David Allsopp 2f1bd9da6e Move #8848 Changes entry to 4.09.0 2019-07-31 16:46:31 +01:00
Stephen Dolan 5e4b55d3bd Use the autoconf- or system-provided off_t rather than redetecting. (#8843)
Fixes: #8841
2019-07-31 13:56:26 +02:00
Florian Angeletti 216f854e01 update Changes for toplevel redefinition hint 2019-07-31 13:52:59 +02:00
Tom Kelly 4cd8dd25ca Fix stack probe CFI information for amd64 and i386 (#8848)
Add CFI information for the stack probes for amd64 and i386 when doing caml_c_call and caml_call_gc.
2019-07-31 11:51:37 +02:00
Xavier Leroy 9d84841c46
Merge branch 'trunk' into fatal_error_abort 2019-07-31 11:18:57 +02:00
David Allsopp c43d198cfa Merge pull request #8830 from glondu/4.08-configure-fixes
Small fixes in configure.ac

(cherry-picked from commit 1e610e2703927144786c2e62907cd07e28677a0f)
2019-07-30 10:55:58 +01:00
Mekhrubon Turaev 6cb5905c27 Improved type hierarchy for type mismatches (#8828)
Added special types for variants, records, constructors or labels type mismatch.
Printing additional info about types mismatch during compilation error.
2019-07-30 08:56:28 +01:00
Florian Angeletti 7fface1a37
Merge pull request #8779 from Octachron/cautious_expand_in_lower_contravariant
Ctype.lower_contravariant: avoid missing cmis when expanding types
2019-07-26 13:56:13 +02:00
Gabriel Scherer 1837dee56e
Merge pull request #8530 from gadmm/sort
List.sort: avoid duplicate work by chop
2019-07-26 06:48:08 +02:00
Guillaume Munch-Maccagnoni a1c05e3157 List.sort: avoid duplicate work by chop
David Allsopp: Remove unrelated reformatting
2019-07-25 22:31:39 +02:00
Florian Angeletti 15c17f5ad8 Ctype.lower_contravariant: avoid missing cmis 2019-07-25 18:56:02 +02:00
David Allsopp 713f1e8516 Changes entry 2019-07-20 14:08:49 +01:00
Gabriel Scherer e76ce7bb9b Changes: recreate 4.08+dev section 2019-07-20 11:31:32 +02:00
Thomas Refis ddb4cd93cb
Env.lookup_module: don't allow creating loops (#8810) 2019-07-18 15:40:48 +01:00
Alain Frisch 5ccf3c52dc New implementation of Env.make_copy_of_types (#8774) 2019-07-18 10:11:41 +09:00
Gabriel Scherer 2f5a3b41c3
Merge pull request #8654 from jhjourdan/debugger_dynlink
Dynlink support for ocamldebug
2019-07-17 14:30:55 +02:00
Thomas Refis b598cb054b
Merge pull request #8766 from trefis/pattern_head
Parmatch: introduce a type for simplified pattern heads
2019-07-16 13:31:05 +01:00
Gabriel Scherer 364d07589b
Merge pull request #8526 from gretay-js/function-sections
Function sections
2019-07-16 13:39:55 +02:00
Thomas Refis 54ae229008 Changes 2019-07-16 11:36:24 +01:00
Jacques-Henri Jourdan 593f94055a Dynlink support for ocamldebug
This commit adds dynlink support for ocamldebug. As a side effect, it also:
  - factorizes the various functions searching for a code fragment into one,
    called [caml_find_code_fragment];
  - removes the [caml_register_code_fragment], which does not seem to
    be used anywhere, and which clearly should not be used by external code.
2019-07-16 10:52:48 +02:00
Alain Frisch 430c20bb78
A new runtime primitive for Array.fill (#8716) 2019-07-16 09:21:23 +02:00
Greta Yorsh bfe6b4bd29 Changes entry 2019-07-15 10:26:34 +01:00
Jacques-Henri Jourdan a121072588
Merge branch 'trunk' into fatal_error_abort 2019-07-15 10:16:29 +02:00
Florian Angeletti 6582335689
#8702: fix some polymorphic variant error messages (#8777)
improved error messages for fixed row polymorphic variants: keep track of the motivation behind a fixed row (e.g it was bound to an universal or existential type variable, or private) in the types themselves and use this explanation in error messages.
2019-07-12 17:47:25 +02:00
David Allsopp ef8d8a7055 Move Changes for #8788 to 4.09.0 2019-07-11 17:22:39 +01:00
Jeremy Yallop a45189331b caml_output_value_to_bytes: avoid integer overflow (#8788)
Use intnat, not int, to represent pointer difference and avoid integer overflow in caml_output_value_to_bytes and caml_output_value_to_malloc
2019-07-11 17:22:39 +01:00
Leo White a49589911a Add Changes entry 2019-07-11 17:16:08 +01:00
Leo White 11edca8798 Fix #8769 (#8770)
* Don't generate illegal Pfield's when compiling alias coercions

* Simplify lambda code when compiling packs

* Add regression test for pr8769

* Add Changes entry
2019-06-28 16:17:00 +01:00