Commit Graph

510 Commits (3c1d4986bcd434ed641f6844388b86910354696a)

Author SHA1 Message Date
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Fabrice Le Fessant a0bdce52f5 Fix PR#6516 in testsuite
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15095 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-17 21:11:18 +00:00
Gabriel Scherer 3689794e47 Fix for PR#6441 (Stefan Holdermans)
During closure conversion, the right-hand side of a functional binding in a
recursive binding group is now always closed as a named expression rather than
an anonymous expression.  As a result, direct recursive calls do not need to
retrieve their target from a closure environment.  This does not only result in
more efficient code being generated, but also avoids a potential blocker for
successful tail-call detection during pseudo-instruction selection.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14966 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-05 15:59:15 +00:00
Xavier Leroy 18d23e3a3d Reflecting commit 14963 on version/4.02:
PR#2719: wrong scheduling of bound checks within a try...with Invalid_argument -> _ ...


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14964 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-05 13:59:33 +00:00
Mark Shinwell 5791532c5d fix gc-roots test case for no-naked-pointers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14913 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-23 12:11:49 +00:00
Maxence Guesdon 577ea36b88 Fix ocamldoc test to follow new interface; add object type test
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14910 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-22 13:39:11 +00:00
Gabriel Scherer 74b20bef58 replay trunk@14523: warn on non-principal format6 coercions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14869 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 15:07:17 +00:00
Gabriel Scherer 3ffa399b37 Use a nominal datatype for CamlinternalFormat.format6
This should make the type-checking of formats simpler and more robust:
instead of trying to find a pair as previously, we can now use the
path of the format6 type directly.

A nice side-effect of the change is that the internal definition of
formats (as a pair) is not printed in error messages anymore.
Because format6 is in fact defined in the CamlinternalFormatBasics
submodule of Pervasives, and has an alias at the toplevel of
Pervasives, error messages still expand the definition:

> Error: This expression has type
>          ('a, 'b, 'c, 'd, 'd, 'a) format6 =
>            ('a, 'b, 'c, 'd, 'd, 'a) CamlinternalFormatBasics.format6
>        but an expression was expected of type ...

Passing the option `-short-paths` does avoid this expansion and
returns exactly the same error message as 4.01:

> Error: This expression has type ('a, 'b, 'c, 'd, 'd, 'a) format6
>        but an expression was expected of type ...

(To get this error message without -short-paths, one would need to
define format6 directly in Pervasives; but this type is mutually
recursive with several GADT types that we don't want to add in the
Pervasives namespace unqualified. This is why I'll keep the alias
for now.)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14868 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 15:07:13 +00:00
Jacques Garrigue 14c7fc4a0c apply patch for PR#6420: Bad error message for non-exhaustive matching on extensible types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14859 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 04:05:21 +00:00
Gabriel Scherer ac23816f4a temporarily disable principality warning test in coercion.ml
Contrarily to the previous commit, this change is *not* completely
benine: it corresponds to the fact that Jacques' trunk@14523 (a
principality warning on formats in some situation) has not yet been
replayed on the format-gadts branch -- I mainly focused on backward
compatiblity.

The plan is to replay this change really soon, *after* converting
format6 to a nominal datatype -- this will much simplify the
re-implementation of the warning in the type-checker.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14847 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:47 +00:00
Gabriel Scherer af49756df3 fix testsuite/tests/typing-warnings/coercions.ml.reference
The change is benine: currently, error messages about format6 also
give its definition as a product of an inner format and a string: the
message changes, but the semantics is the same.

Ultimately, we want the error message *not* to change (we don't want
the internal implementation of formats to be exposed to the innocent
user), and that will be achieved by converting format6 to a nominal
type instead of a structural pair.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14846 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:45 +00:00
Gabriel Scherer 78315ea89c fix Tests.ml{,.principal}.reference
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14845 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:43 +00:00
Gabriel Scherer e0b1dab7be fix some testsuite Makefiles
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14844 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:41 +00:00
Gabriel Scherer f0e39fee7d For %{..%}, restore Pierre's semantics
(printf {%foo%} bar) will print the string representation of the
format type of both `foo` and `bar`, instead of printing `bar`
(for this purpose one can just use %s). `bar` content is ignored, but
the typer should check that its type is compatible with the one of
`foo`.

This semantics allows to use (printf %{..%}) for testing/debugging the
use of %(...%): put in the brackets what you believe to be the format
type you want to use, and as argument the format you wish to pass, and
you'll get type-checking confidence and the "canonical" representation
of the format string which you can use in the %(...%) -- note that
using the canonical format type is not mandatory.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14840 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:33 +00:00
Gabriel Scherer 02c5fb47ca testsuite Makefile fix
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14839 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:31 +00:00
Gabriel Scherer 6a8f12080b testsuite for %_[nNlL]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14824 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:03 +00:00
Gabriel Scherer 3ab9516300 a testsuite to measure format behavior changes and the effectiveness of legacy mode
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14819 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:54 +00:00
Gabriel Scherer 72669307e8 second part of Benoît Vaugon's format+gadts patch
To finish the bootstrap cycle, run:

  make library-cross
  make promote
  make partialclean
  make core

  make library-cross
  make promote-cross
  make partialclean
  make ocamlc ocamllex ocamltools

  make library-cross
  make promote
  make partialclean
  make core
  make compare

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14810 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:37 +00:00
Jacques Garrigue 48ecf7eb15 Fix PR#6410: Error message for an attempt to use a functor as a module is confusing
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14790 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 08:13:04 +00:00
Gabriel Scherer fc8c777825 fix testsuite
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14786 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 20:25:10 +00:00
Gabriel Scherer 755b19650b Reformulation of the user-facing slot-access API
- The internal [backtrace_slot] type is not exposed anymore, instead
  accessors function return orthogonal information
  (is_raise, location). This is both more extensible and more
  user-friendly.

- The [raw_backtrace_slot] is exposed separately as a low-level type
  that most users should never use. The unsafety of marshalling is
  documented. Instead of defining
  [raw_backtrace = raw_backtrace_slot array], I kept [raw_backtrace]
  an abstract type with [length] and [get] functions for
  random-access. This should allow us to change the implementation in
  the future to be more robust wrt. marshalling (boxing the trace in
  a Custom block, or even possibly the raw slots at access time).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:20:00 +00:00
Gabriel Scherer 3dae9e6014 improve backtrace testsuite
Test the behavior of the deprecated primitive [caml_get_exception_backtrace],
and minimal tests for hashing/comparison of raw backtrace slots.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14782 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:57 +00:00
Jacques Garrigue b6500cc2a4 Fix PR#6405: unsound interaction of -rectypes and GADTs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14769 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 05:46:07 +00:00
Jacques Garrigue 88e8bec163 Fix PR#6394: Assertion failed in Typecore.expand_path
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 10:55:05 +00:00
Alain Frisch 0f1fb19cbe #6318: Extend match...with with exception cases. (Patch by Jeremy Yallop, backend part by A. Frisch).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14743 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:49:37 +00:00
Jacques Garrigue b56dc4b3df PR#5584: merge open extensible types, extension-patch-4.0.2
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 23:08:45 +00:00
Xavier Leroy b691a28d15 Some updates for SPARC
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14731 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-03 18:20:33 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Jacques Garrigue 48f52f450c merge Leo's patch for PR#6384
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14702 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 02:25:04 +00:00
Jacques Garrigue 6cb386e91c Fix PR#6383: Exception Not_found when using object type in absent module
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14701 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-28 13:29:51 +00:00
Damien Doligez 9639370d40 update to use the git version of camlp5
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14679 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 22:33:52 +00:00
Jacques Garrigue 979fe8b8ad Do not add absolute paths for information added to
the local environment in Env.components_of_module_make.
Fixes the bug reported by Mark Shinwell on caml-devel,
on 2014-04-23. This bug was related to module aliases.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14674 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 09:09:08 +00:00
Xavier Leroy 29b34438e0 - Constant ropagation for float and int32/int64/nativeint arithmetic.
Constant propagation for floats can be turned off with option
  -no-float-const-prop, for codes that change FP rounding modes at
  run-time.
- Clambda / C-- / Mach: represent float constants as FP numbers of type 
  float rather than literals of type string.
- Tested for AMD64; other archs need testing.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14673 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 08:41:13 +00:00
Damien Doligez 07bc0e6580 update expected test results following commit 14660
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14663 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-23 09:05:59 +00:00
Jacques Garrigue 82e2f35a14 Fix PR#6376
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-21 10:38:04 +00:00
Jacques Garrigue 5db6318900 Fix PR#6371
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14608 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-16 06:16:05 +00:00
Damien Doligez 2ffe809f11 fix bug in test program
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14583 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 10:45:42 +00:00
Damien Doligez 7303ac34ca fix some of the whitespace problems in the source
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 10:17:02 +00:00
Damien Doligez 7b52e6477c remove tests that depend on camlp4
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14581 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 07:24:13 +00:00
Jacques Garrigue fb74ef5e51 Fix PR#6365
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14565 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-09 04:01:26 +00:00
Gabriel Scherer 3a0d4ac883 testsuite for primitive bound checking
(Patch by Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14555 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 15:07:33 +00:00
Damien Doligez e8d15e704c merge branch 4.01 from 4.01.0 (revision 14115) to branch closure (revision 14525)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14532 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-04 17:32:35 +00:00
Jacques Garrigue 2699d155a0 Fix PR#6352
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14524 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-03 03:59:17 +00:00
Jacques Garrigue 12a2e9fa03 comment 9644 of PR#6000: principality check for coercion to format
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14523 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-03 02:52:51 +00:00
Damien Doligez f0d0c5808e skip debugger test when dynlink is not available
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14490 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-25 15:41:46 +00:00
Luc Maranget c2a88c27fd #PR6269 Optimized string matching
Noticed that I had to bootstrap to test on ARM, so I commit  a new bootstrap
compiler.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21 17:02:44 +00:00
Gabriel Scherer 9e410c0cfe Shorten syntax for functor signatures (patch by Thomas Gazagnaire)
```
(* Optional naming of parameter implementation *)
module type X = functor (X:S) -> ...
module type X = functor (_:S) -> ...

(* shortening of functor module signatures *)
module type F = functor (X:S) -> functor (Y:S) -> ...
module type F = functor (X:S) (Y:S) -> ...
```

For consistency reasons, this commits also add shortening of functor implementations:

```
(* shortening of functor implementations *)
module F = functor (X:S) -> functor (Y:S) -> ...
module F = functor (X:S) (Y:S) -> ...
```

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 15:21:00 +00:00
Alain Frisch 05982a5fc7 Fix Makefile.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14473 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 15:03:49 +00:00
Alain Frisch 7578b585a1 Also check sharing of immutable constants.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 13:27:50 +00:00
Alain Frisch 8583d7f9d5 Add non-regression test for #5779.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14469 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 13:25:21 +00:00