Commit Graph

2339 Commits (72ea849d2a16de0abb42afd85c014cb136822e1f)

Author SHA1 Message Date
Mark Shinwell 72ea849d2a
Move some middle-end files around (#2281)
* Various file moves in the middle end: this is the first stage of improving separation between the middle end and backend.
* Creation of file_formats/ directory (with associated file moves) to hold the definitions of compilation artifact formats.
* Creation of lambda/ directory (with associated file moves) to hold Lambda language definition files, transformation passes and construction passes from Typedtree.
* Disable (hopefully temporarily) dynlink, debugger and ocamldoc for the dune build.
2019-04-01 17:18:47 +01:00
Nicolás Ojeda Bär e07213c768
Merge pull request #8539 from ILikePizza555/tast_iterator2
Replace TypedtreeIter with Tast_iterator
2019-03-28 09:48:00 +01:00
Nicolás Ojeda Bär 07c96cde78
Update typing/tast_iterator.ml
Co-Authored-By: ILikePizza555 <avrisaac555@gmail.com>
2019-03-27 14:24:22 -07:00
Isaac Avram 4edd549623
Marged structure_item with iter_str_desc 2019-03-27 12:20:29 -07:00
Florian Angeletti 8e5e3c0ed4
Improved error message for illegal permutations (#8546)
* illegal permutation: more explanations and tests
2019-03-27 19:04:24 +01:00
Isaac Avram c1d52ada37
Adjusted indentation 2019-03-27 01:31:43 -07:00
Isaac Avram 35e339ed86 Removed eol whitespace 2019-03-26 15:57:51 -07:00
Isaac Avram 01e124edb7 Fixed indentation in tast_iterator.ml 2019-03-26 14:42:29 -07:00
Isaac Avram efa1380916 Fixed copyright name and year 2019-03-26 14:38:02 -07:00
Isaac Avram a48ce29a71 Updated copyright 2019-03-26 07:49:16 -07:00
Gabriel Scherer 8eee50d272
Merge pull request #8545 from gasche/fix-debugger-persistent-env
Expose Persistent_env.Error and catch it from the debugger
2019-03-26 10:56:21 +01:00
Thomas Refis 87eedfa931 type_let: update some comment as suggested during review 2019-03-26 11:16:25 +08:00
Matthew Ryan c33e46d69b Use newtype names as the underlying variable names (#2277)
* Use newtype names as the corresponding name when they are valid
2019-03-26 08:22:21 +09:00
Isaac Avram 2e1a5acac5 Added copyright to tast_iterator.ml 2019-03-25 13:50:11 -07:00
Isaac Avram 87f999734b Merge remote-tracking branch 'origin/trunk' into tast_iterator2 2019-03-25 13:49:04 -07:00
Gabriel Scherer d5f8a9f948 Expose Persistent_env.Error and catch it from the debugger
The debugger reimplements its own error-reporting logic without using
the reporter-registration mechanism of the compiler, so it needs to be
adapted after the split between `Env` and `Persistent_env` in #2228.

(Interestingly, this forced me to expose the `Error of error`
exception in the Persistent_signature, which was not the case
before. It was probably a mistake to not expose an exception value
that can be raised by (correctly-written) consumers of the module.)

I noticed the issue while inspecting a testsuite failure (#8544).

Before this patch:

```
$ cat tests/tool-debugger/find-artifacts/_ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/debuggee.byte.output
Loading program... done.
Breakpoint: 1
10   <|b|>print x;
Uncaught exception: Persistent_env.Error(_)
```

After:
```
$ cat tests/tool-debugger/find-artifacts/_ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/debuggee.byte.output
Loading program... done.
Breakpoint: 1
10   <|b|>print x;
Debugger [version 4.09.0+dev0-2019-01-18] environment error:
 The files /usr/local/lib/ocaml/stdlib.cmi
 and [...]_ocamltest/tests/tool-debugger/find-artifacts/debuggee/ocamlc.byte/out/blah.cmi
 make inconsistent assumptions over interface Stdlib
```
2019-03-25 16:04:52 +01:00
Thomas Refis 784a39f94e type_let: be more careful generalizing parts of the pattern 2019-03-25 10:21:36 +08:00
Isaac Avram 66c24d65f9 Replaced opt with Option.iter 2019-03-24 10:11:53 -07:00
Isaac Avram c66ce594e7 Made global open into a local one in parmatch 2019-03-24 10:05:49 -07:00
Isaac Avram c7dd0bcae8 Code cleanup: Fixed alignment of match expressions 2019-03-24 09:56:11 -07:00
Isaac Avram cf80edf40b Updated to conform to style guide 2019-03-23 19:32:27 -07:00
Isaac Avram 83fd65b050 Fixed compiler errors in typing/parmatch.ml 2019-03-23 19:12:44 -07:00
Isaac Avram 8bd9c7b294 Fixed typos, syntax errors, and compiler errors in tast_iterator.
Fixed typo in tast_iterator.ml

Fixed type of opt in tast_iterator

Added more missing semicolons

Fixed compiler errors

Fixed compiler warnings
2019-03-23 19:12:43 -07:00
Isaac Avram ab1a24b934 Removed typedtreeIter 2019-03-23 19:12:35 -07:00
Isaac Avram 194ef2cdac Updated parmatch to use tast_iterator 2019-03-23 19:12:12 -07:00
Isaac Avram 239f81b364 Added tast_iterator implementation 2019-03-23 19:10:59 -07:00
Isaac Avram 285bda3237 Added tast_iterator.ml 2019-03-23 18:58:44 -07:00
Isaac Avram e5b332b6e8 Updating definitions of tast_iterator. 2019-03-23 18:57:23 -07:00
Isaac Avram 52ae633d47 Implemented iterator record type
Copied from tast_mapper.mli and replaced "mapper" with "iterator".
Replaced matches of /->(\S*);/ with "-> unit;"
2019-03-21 13:12:34 -07:00
Isaac Avram fc925fd3f9 Added tast_iterator.mli 2019-03-21 13:01:38 -07:00
Mark Shinwell 36c163248d Remove support for compiler plugins (#2276)
After consultation on the core developers' list I am proposing this patch to remove support for compiler plugins.

The main motivations for removing compiler plugins are:
- They are a potential security risk.
 - They increase the complexity of the build system and make maintenance of the Dynlink libraries more difficult (although actually, this complexity could probably be reduced after #2268 is merged).
 - Many applications of plugins should be able to be expressed by building custom compiler drivers that link against compilerlibs.

* Remove compiler plugins and hooks
* Add new function Dynlink.unsafe_get_global_symbol but keep it outside the documented API.
* Remove otherlibs/dynlink/nodynlink.ml
* Update Changes
2019-03-13 11:46:37 +01:00
Jules Aguillon d926fdb9f8 Add hint on numeric operator type clash 2019-03-11 01:58:52 +01:00
Jules Aguillon e1ca14da22 Refactor report_error to return a Location.error 2019-03-10 23:48:17 +01:00
Pierre Roux ed74b5b237 Enforce precision in printf %F 2019-03-09 12:03:43 +01:00
Gabriel Scherer 0c9b121661
Merge pull request #2301 from Julow/warning_int_literal
Hint on type error on int literal
2019-03-08 19:03:06 +01:00
Jules Aguillon 6794943b32 Implements on patterns 2019-03-08 16:37:49 +01:00
Jules Aguillon 9ab5efc1ec Add hint on int literals where expecting int32 or int64 literal 2019-03-08 16:37:49 +01:00
Jules Aguillon 109f0b2b34 Add the explain function to Ctype.Unification_trace 2019-03-08 16:37:49 +01:00
Mark Shinwell d47ba6ec18
Functorize Consistbl (with some background info on Compilation_unit.t) (#2286) 2019-03-07 16:19:51 +00:00
Florian Angeletti 00c18be73c MPR#7937: avoid Unify in extract_concrete_typedecl (#2287) 2019-03-07 16:06:00 +09:00
Gabriel Scherer 56c6786d5c value letrec: fix a bug in analysis of inner mutually-recursive bindings
Jeremy Yallop and myself found this bug while trying to prove the
soudness of the analysis.
2019-03-01 12:48:26 +01:00
Florian Angeletti e0a11fe2e3
Merge pull request #2269 from Octachron/bugfix_self_closed
restore the error message for closing a self type
2019-02-28 20:15:31 +01:00
David Allsopp 1626a018d8 Remove unnecessary executable bit from sources (#2270)
Various files which seem to have acquired Git executable bits.
File contents are unchanged; only permissions are changed.
2019-02-28 16:29:26 +01:00
Florian Angeletti c8a15cf006 bugfix: restore "self cannot be closed" error message 2019-02-27 14:06:51 +01:00
Thomas Refis d29455fcd4 enforce that every call to save_desc is necessarily followed by cleanup_types (#2261) 2019-02-25 09:48:50 +00:00
Thomas Refis 3a7c692274 Subst.signature: call cleanup_types exactly once. (#2261) 2019-02-25 09:48:28 +00:00
Gabriel Scherer 96518644f5 fix dune build
(dune seems to choke on some 4.08 features that were used in the Env
codebase already. It's not a bad idea to ensure that the compiler
codebase works well with 4.07.)
2019-02-20 22:40:58 +01:00
Gabriel Scherer e82a28af60 env refactoring: use a custom ADT for missing pers_struct entries
The hope is that a tailor-made algebraic datatype is more readable /
less confusing than using ('a option) directly -- one may confuse
getting None when looking in a table with the Not_found case.

(Suggested by Jérémie Dimino)
2019-02-18 17:03:16 +01:00
Gabriel Scherer 61ca6599f0 env refactoring: move current_unit in a submodule
(suggested by Jérémie Dimino)
2019-02-18 17:03:15 +01:00
Gabriel Scherer 93f0ce31bb env refactoring: separate the cmi/crc handling into a persistent_env module
Persistent_env is a new module that handles the relation between the
type-checking state and the "persistent" typing information laying in
.cmi files on the filesystem. In particular, it handles the collection
and production of CRC information for the .cmi files being read and
written to the filesystem; the using modules (in our case, only Env)
are in charge of turning the cmi files into higher-level information
(components and signatures).

Persistent_env exposes a type `'a t` of a persistent environment,
which acts as a mutable store of `'a` values. There is no global state
in the module itself: while Env (and thus the OCaml type-checker) uses
a single global persistent environment, it should be possible to
create several independent environments to represent, for example,
several independent type-checking sessions.
2019-02-18 17:02:47 +01:00