Improve compilation time for toplevel include(struct ... end : sig ... end)#832
Merged
alainfrisch merged 2 commits intoocaml:trunkfrom Dec 21, 2016
Merged
Improve compilation time for toplevel include(struct ... end : sig ... end)#832alainfrisch merged 2 commits intoocaml:trunkfrom
alainfrisch merged 2 commits intoocaml:trunkfrom
Conversation
Member
|
thanks for the quick fix. |
Contributor
Author
|
Does anyone want to review this? |
Contributor
Author
Contributor
|
I'm not sure I'm the best qualified to review this (except for having introduced my share of bugs in this part of the compiler). |
Contributor
Author
…. end) This is intended to fix MPR#7357, which uses the natural way of specifying an inline signature for a unit without using an external .mli file. The trick is similar than the one applied for compiling module X = (struct ... end : sig ... end) Identifiers of the inner structure are "lifted" as extra fields to the top-level structure.
f40adff to
d978244
Compare
Contributor
Author
|
Rebased and added a Changelog. |
camlspotter
pushed a commit
to camlspotter/ocaml
that referenced
this pull request
Oct 17, 2017
…. end) (ocaml#832) * Improve compilation time for toplevel include(struct ... end : sig ... end) This is intended to fix MPR#7357, which uses the natural way of specifying an inline signature for a unit without using an external .mli file. The trick is similar than the one applied for compiling module X = (struct ... end : sig ... end) Identifiers of the inner structure are "lifted" as extra fields to the top-level structure. * Changelog.
ctk21
added a commit
to ocaml-multicore/ocaml
that referenced
this pull request
Jan 7, 2022
Fix reachable words, part deux
sadiqj
pushed a commit
to sadiqj/ocaml
that referenced
this pull request
Jan 7, 2022
Fix reachable words, part deux
stedolan
pushed a commit
to stedolan/ocaml
that referenced
this pull request
Sep 21, 2022
EmileTrotignon
pushed a commit
to EmileTrotignon/ocaml
that referenced
this pull request
Jan 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is intended to fix MPR#7357, which uses the natural way of specifying an inline signature for a unit without using an external .mli file.
The trick is similar to the one applied for compiling
module X = (struct ... end : sig ... end). Identifiers of the inner structure are "lifted" as extra fields of the top-level structure.I'd argue this special case is relevant since it corresponds to the natural way of restricting a unit's signature without specifying an external .mli file. For instance, the change would be beneficial to #217 or to people using that encoding manually.
The trick is currently not applied to
include (struct .... end); it would not be difficult to do so, but there is no real reason to use that form anyway (except perhaps to simplify code generators, or to customize warnings locally in a section), and one might argue that simplifying that to just the inner structure should be done earlier in the compilation process.A minor point: I'm not sure about the call to
Translattribute.check_attribute_on_module. In the current version, attributes on the include structure item are considered, not attributes on the either of the two module expression (the Tmod_structure and Tmod_constraint nodes). This is similar to what was done for the Tstr_module cases (starting from 58d6da1), but it does not look right to me. @chambart Can you comment?