Conversation
|
ping |
e7bd3d6 to
e5a4b21
Compare
mshinwell
left a comment
There was a problem hiding this comment.
This looks fine to me modulo various minor comments. However since I've been working with @gretay-js on this project, another reviewer with commit access should please have a brief look through the code, and confirm that the approach is reasonable.
|
Mark Shinwell (2019/11/26 05:17 -0800):
I'm surprised we need a shell script to check the existence of the
`.cmir` files, but I'm not very familiar with `ocamltest`. I suggest
asking @shindere if he could review these few parts of the diff.
I confirm that the shell script is indeed needed, yes.
One thing, though:
I don't think `ocamlopt_byte_exit_status = "0"` is required because
that's what is expected by default.
As far as tests are ocncerned the rest looks okay to me, meaning it's
done as nicely as ocamltest permits. :)
|
fixed, thanks! |
|
@mshinwell @shindere Thank you for the reviews! I addressed all review comments so far in 1200de9. |
|
The changes are fine, and I'm happy with the whole thing now. It would be appreciated if someone else can sign off on this as described above, thanks. |
|
I've rebased it today and the CI is happy. Can this be considered for merging please? It has been waiting for another reviewer to sign it off. |
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26)
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file Update .depend
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file Update .depend
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file Update .depend
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file Update .depend
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file Update .depend
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file Update .depend
ocaml#8938 from upstream trunk (cherry-pick 4353c75) ocaml#9090 from upstream trunk (cherry-pick fe7c8ed) ocaml#9097 from upstream trunk (cherry-pick 6daaf62) ocaml#8939 from gretay-js/save-linear (cherry-pick 1200de9) ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26) Add linear_format to dune file Update .depend
c84ec94 to
fc3326e
Compare
ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26)
ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26)
ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26)
ocaml#9003 from gretay-js/start-from-emit (cherry-pick 21d5d26)
let-def
left a comment
There was a problem hiding this comment.
The changes look fine to me too.
|
I'm happy to merge if I happen to remember to do it in a few hours after the CI has finished. Feel free to ping me if I don't. I added the "merge-me" label, meaning that anyone else will feel encouraged to merge once the CI comes back green. |
|
Thank you! |
|
@gasche , it's all green ready for you :) |
This PR adds command line option to marshal the compiler's intermediate representation of each compilation unit to a separate file. Currently, it is only implemented for saving the Linear IR.
This provides a convenient way for an external tool to get a hold of an intermediate representation and manipulate it using compiler-libs. It is analogous to the way ppx tools handle parse trees, but lets us access IRs down the compilation pipeline. There is no alternative way of doing it, as far as I can see, since the removal of compiler hooks in #2276
Adding this capability has previously been discussed, for example: #1945 (comment), #1945 (comment)
Following the conventions established for other compilation articfacts, the IR will be saved to a file named <output_prefix>.cmir-linear. The format is defined in linear_format.ml.
The option is named "-save-ir-after " and supports only "scheduling" pass in this PR.
I have another patch that supports "-save-ir-after parsing" and "-save-ir-after typing" by invoking existing functionality in the compiler. It seems redundant with other command line options and I don't have a way to test it, but happy to add it on for completeness if needed. The passes "parsing" and "typing" were already defined in Clflags.Compiler_passes for use with command line option "-stop-after ".
This PR is on top of PR #8938 in which I propose to add "scheduling" to the existing "-stop-after" option. The only new commit here to review is in 8ea2eb9