Commit Graph

15 Commits (b91a90a4a7bc4cf84ece5c0a712eee81e063c803)

Author SHA1 Message Date
Leandro Ostera b91a90a4a7
Fix linting errors 2020-11-06 09:20:45 +01:00
Leandro Ostera 1b085d3840
Rename Typedtree.t to Typedtree.implementation 2020-11-05 21:19:44 +01:00
Leandro Ostera ee2f3b428c
Move typed_impl to Typedtree.t 2020-11-05 19:06:12 +01:00
Leandro Ostera f6e428acf2
Introduce typed_impl record 2020-11-05 18:29:45 +01:00
Leandro Ostera 3a125b8c3c
Expose module signature when typing implementation
While working on a new backend for OCaml to generate Erlang sources, I
found the need to read the .cmi file back into a `Types.signature`
value.

@Drup spotted that I was reading the file and pointed out this value was
already being read during the type checking process.

A quick check at the `Typedtree.module_coercion` showed us that it would
be difficul to extract the same information that is readily available in
the signature value.

This change will expose the signature value directly, so other backends
relying on this signature information do not need to do the extra work
of reading it again.
2020-11-05 17:33:19 +01:00
Gabriel Scherer 95bdcd3856 Compile_common: turn `init` into continuation-passing `with_info`
I think this clarifies the fact that the `info` value is a resource that
has a limited lifetime. The new API lets us create (and close) the ppf_dump
directly from `Compile_common.with_info`, simplifying the API for user.
2019-01-05 12:12:20 +01:00
Gabriel Scherer c6d95c9ef6 Compile_common.init: make ppf_dump a labelled argument 2019-01-04 18:51:14 +01:00
Gabriel Scherer a75fc10076 driver/compile_common: refactor interface/implementation entry points 2019-01-04 18:09:44 +01:00
Gabriel Scherer c1e37d0446 driver/compile_common: store 'native' as part of the 'info' structure 2019-01-04 18:09:44 +01:00
Gabriel Scherer 35829b6b2a driver/compile_common: whitespace refactoring 2019-01-04 18:09:41 +01:00
Gabriel Scherer 3123ecaaf9 driver/compile_common: rename init_path -> native
The previous label name made little sense to me, and in fact
I thought it meant that the boolean indicates whether the path should
be initialized or not.
2019-01-04 18:08:42 +01:00
Gabriel Scherer 2ef45b3621 driver: consistently use _ as word separator 2019-01-04 17:56:12 +01:00
Valentin Gatien-Baron c93d080f13 Compile_common.implementation 2018-08-04 16:08:54 +02:00
Gabriel Scherer ebc34d5115 compile_common: remove wrap_compilation
wrap_compilation makes the compilation pipeline non-modular by
exposing a split between two fixed passes, a frontend and a backend,
in a .mli interface. I need a finer-grained interface for a feature
I've been using in my Menhir-parser branch, and it is likely that
other users also will need to be finer-grained than that.

This PR pushes the error/ressource handling contained with
wrap_compilation into its producers (note: this change assume that
only typecheck_impl needs Stypes.dump, and that only the optcompile
backend may generate `obj` and `cmx` files), so that the logic in
"wrap" becomes very simple, and then inlines it in the two users in
{opt,}compile.ml.
2018-08-04 16:07:51 +02:00
Drup abc0b7e3ed Add compile_common.ml which contains the basic compilation pipeline.
Factorize the part from compile.ml and optcompile.ml.
2018-07-27 15:07:43 +02:00