Commit Graph

9754 Commits (0875b3c630e9ddb711c7d8cf6f0f5c0a751ef926)

Author SHA1 Message Date
Mark Shinwell 0875b3c630 update Changes for -no-naked-pointers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14793 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 10:37:15 +00:00
Mark Shinwell 520fad7d1c Jacques forgot a crucial detail
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14792 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 08:40:54 +00:00
Mark Shinwell 881ec04f39 no-naked-pointers patch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14791 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 07:29:24 +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
Jacques Garrigue d2194b72fe comment out Ctype.local_non_recursive_abbrev
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14789 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 07:48:55 +00:00
Jacques Garrigue 4365e3888e fix man pages: should be open!
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14788 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 00:25:57 +00:00
Jacques Garrigue ccce272966 commit o_and_opens.diff
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14787 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 00:17:05 +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 4a87d8f8c8 update Changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14785 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:26:43 +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 286fbaa0c1 bootstrap
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14783 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:59 +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
Gabriel Scherer cc6b2ca107 expose Printexc.format_backtrace_slot to facilitate testing
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14781 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:55 +00:00
Gabriel Scherer 4f913f2498 reinstate the deprecated primitive caml_get_exception_backtrace
Jacques-Henri initially removed the primitive, which is deprecated
since 4.01, but I suspect there still are uses in the wild. I guess we
should wait for a few more versions.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14780 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:53 +00:00
Gabriel Scherer ebd3778122 factor the pointers-into-ints cleverness through pair of macros
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14779 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:52 +00:00
Gabriel Scherer 0b50a80ab2 cleanup cmp_ev_info
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14778 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:50 +00:00
Gabriel Scherer 3fe8311b50 typos
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14777 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:49 +00:00
Gabriel Scherer 1fdea57c4c Printexc: OCaml-friendly access to individual backtrace slots
(Patch by Jacques-Henri Jourdan)

There are several changes:

- `raw_backtrace` is no longer an abstract type, but rather an
  `raw_backtrace_slot array`, where `raw_backtrace_slot` is a new
  abstract type. `raw_backtrace_slot` elements are hashable and
  comparable. At runtime, values of this type contain either
  a bytecode pointer or a frame_descr pointer. In order to prevent the
  GC from walking through this pointer, the low-order bit is set to
  1 when stored in the array.

- The old `loc_info` type is know public, renamed into `backtrace_slot`:

      type backtrace_slot =
        | Known_location of bool   (* is_raise *)
                          * string (* filename *)
                          * int    (* line number *)
                          * int    (* start char *)
                          * int    (* end char *)
        | Unknown_location of bool (*is_raise*)

- new primitive :

    val convert_raw_backtrace_slot: raw_backtrace_slot -> backtrace_slot

  Rather than returning an option, it raises Failure when it is not
  possible to get the debugging information. It seems more idiomatic,
  especially because the exceptional case cannot appear only for a part
  of the executable.

- the caml_convert_raw_backtrace primitive is removed; it is more
  difficult to implement in the C side because of the new exception
  interface described above.

- In the bytecode runtime, the events are no longer deserialized once
  for each conversion, but once and for all at the first conversion,
  and stored in a global array (*outside* the OCaml heap), sorted by
  program counter value. I believe this information should not take
  much memory in practice (it uses the same order of magnitude memory
  as the bytecode executable). It also makes location lookup much more
  efficient, as a dichomoty is used instead of linear search as
  previously.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14776 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10 19:19:47 +00:00
Jacques Garrigue eb2b1f64b1 indentation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14775 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 19:40:19 +00:00
Jacques Garrigue 7869662411 disable Clflags.transparent_modules when narrowing unbound identifier error
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14774 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 19:35:54 +00:00
Mark Shinwell 2b6b5a5b32 add Changes note for the patch in rev 14772
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14773 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 15:36:36 +00:00
Mark Shinwell 9419b6c909 fixed bug in native caml_raise_with_string, and synced code in byterun/fail.c for that function
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14772 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 15:33:02 +00:00
Fabrice Le Fessant c5cc4fca02 small re-ordering of declarations, to match comments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14771 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 12:22:35 +00:00
Fabrice Le Fessant 457958a9e6 Add reset functions to make modules reentrant when used through compiler-libs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14770 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 12:01:21 +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
Gabriel Scherer e34fa841a0 [minor] Makefile: fix the hard-bootstrap recipe
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14768 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-08 13:34:46 +00:00
Gabriel Scherer bfb5d9e404 fix .depend for parallel make
Damien introduced a dependency from asmcomp/ to typing/env.ml, which
breaks parallel build.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14767 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-08 13:06:33 +00:00
Mark Shinwell a9cc0281e5 cycle detection in the toplevel printer (Leo White, https://github.com/ocaml/ocaml/pull/23/)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14766 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-08 08:31:45 +00:00
Mark Shinwell fbe19a85ca fixes to Travis CI script from Anil
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14765 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-08 07:35:18 +00:00
Xavier Leroy 44ac495ee3 Follow-up to r14763: use caml_stat_free instead of plain free.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14764 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-08 07:10:56 +00:00
Xavier Leroy 4fde43407f Eradicate one more sprintf().
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14763 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 17:56:53 +00:00
Alain Frisch bfccd68ecc Protocol to allow ppx processors to report warnings to the compiler (reported as warning 22).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14762 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 14:52:19 +00:00
Damien Doligez bdeeab69eb fix various things
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14761 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 14:05:19 +00:00
Damien Doligez f27debba97 add small precision about -warn-error
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14760 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 14:04:47 +00:00
Alain Frisch f0ef09de26 Expose a Typemod.type_interface (currently an alias of Typemod.transl_signature) by symmetry with type_implementation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14759 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 12:46:00 +00:00
Alain Frisch 36b25ec2f6 Minor tweak to raw dump of parsetree/typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14758 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 11:14:57 +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 9961e6a1c2 #6399: protocol (based on a built-in ocaml.error extension node) to let ppx tools send located errors to be reported by the compiler (patch by Peter Zotov).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 08:26:17 +00:00
Jacques Garrigue 1ce29d9bfc re-commit Leo's weak-dependencies pull request
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 00:34:20 +00:00
Gabriel Scherer 3dd57a94e3 PR#6397: fix infix (+=) operators after open types merge
(Patch by Leo White)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14754 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 19:57:38 +00:00
Alain Frisch 7e2333051a ocaml.warnerror built-in attribute.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14753 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 16:17:09 +00:00
Alain Frisch 0736512709 Revise behavior of ocaml.warning attribute: when used as a floating attribute (in a signature or structure), the scope is restricted to the current signature/structure instead of being global. Also support the new floating attributes in classes, with the same behavior.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14752 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 16:07:44 +00:00
Alain Frisch 110e97d400 When the payload of the ocaml.deprecated attribute is a string, report it as part of the warning message.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14751 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 14:39:51 +00:00
Alain Frisch 85a176334e Recognize both prefixed and unprefixed built-in attributes (e.g. ocaml.deprecated or deprecated).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14750 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 14:32:32 +00:00
Alain Frisch 27e9e78637 Accept a fully empty pattern matching. This can be generated by Camlp4 using its revised syntax, and this seems to be used in the wild.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14749 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 17:19:49 +00:00
Fabrice Le Fessant b1943e1ac7 Remove FIRST_UNIMPLEMENTED_OP from interp.c
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14748 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 13:59:25 +00:00
Alain Frisch f8efbbfc0d Whitespace.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14747 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 13:04:01 +00:00
Alain Frisch 8e25b47153 Changelog.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14746 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 13:03:33 +00:00
Alain Frisch fa3224ec87 Indent + comment.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14744 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:54:34 +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