Dump location mappings between intermediate representations (cmm, lambda...) and source code.#155
Conversation
6c6ec7e to
c6554bc
Compare
|
As discussed, can we try to rearrange the code so that this doesn't touch the |
|
Done! I had to duplicate printast (which I've moved in a new subdirectory printer/ where future printers will go). I also had to duplicate compile_common.ml. I've also remove the compiler flags -- location can be dumped if and only activated by calling |
xclerc
left a comment
There was a problem hiding this comment.
(I am pretty sure I don't understand enough of
Format, and its semantic tags, to have anything
useful to say...)
representations Add clflag to dump locations mapping Add location tracker formatter Prepare location tracker for actually tracking things Use tracking formatter in cmm Track locations in printast Install optmaindriver Expose more things in location_tracker_formatter Remove changes from ocaml/ Only keep changes in printer
gretay-js
left a comment
There was a problem hiding this comment.
The new printer/printcmm_with_locations.ml is almost a duplicate of backend/printcmm.ml . It would be better to update Printcmm to work with and without location tracking, if possible, and use printer only for frontend ASTs.
|
I agree -- I moved the location tracking bit back to backend/printcmm.ml. It can be turned on/off using |
…bda...) and source code. (#155) Add printers able to track mappings between source code and intermediate representations
6c5197b Merge pull request oxcaml#166 from mshinwell/merge-flambda-backend-2023-04-28 0c3dcf9 Fix for ocamldoc 09b9e1c Fix for -zero-alloc-check 71e5e07 Compilation fixes after merge bf66257 Merge flambda-backend changes a2556fc Add `[%exclave]` support (oxcaml#51) ebe9576 Add data race freedom proposal (oxcaml#161) 3f3fc49 Merge pull request oxcaml#159 from riaqn/merge-backend 6c635dc minor changes after merge 99a0d85 Merge flambda-backend changes 2642463 Include the modes of values in debugging information (oxcaml#153) 4ecc8a4 Remove i386 CI check (oxcaml#155) git-subtree-dir: ocaml git-subtree-split: 6c5197b
bba15422dbf Accept changed test, fix dune file 2f0a6b48399 Layouts version 1 6c5197b Merge pull request oxcaml#166 from mshinwell/merge-flambda-backend-2023-04-28 0c3dcf9 Fix for ocamldoc 09b9e1c Fix for -zero-alloc-check 71e5e07 Compilation fixes after merge bf66257 Merge flambda-backend changes a2556fc Add `[%exclave]` support (oxcaml#51) ebe9576 Add data race freedom proposal (oxcaml#161) 3f3fc49 Merge pull request oxcaml#159 from riaqn/merge-backend 6c635dc minor changes after merge 99a0d85 Merge flambda-backend changes 2642463 Include the modes of values in debugging information (oxcaml#153) 4ecc8a4 Remove i386 CI check (oxcaml#155) git-subtree-dir: ocaml git-subtree-split: bba15422dbf736511e37db6ea3e952905ff406ed
REVERT: 6c5197b Merge pull request oxcaml#166 from mshinwell/merge-flambda-backend-2023-04-28 REVERT: 0c3dcf9 Fix for ocamldoc REVERT: 09b9e1c Fix for -zero-alloc-check REVERT: 71e5e07 Compilation fixes after merge REVERT: bf66257 Merge flambda-backend changes REVERT: a2556fc Add `[%exclave]` support (oxcaml#51) REVERT: ebe9576 Add data race freedom proposal (oxcaml#161) REVERT: 3f3fc49 Merge pull request oxcaml#159 from riaqn/merge-backend REVERT: 6c635dc minor changes after merge REVERT: 99a0d85 Merge flambda-backend changes REVERT: 2642463 Include the modes of values in debugging information (oxcaml#153) REVERT: 4ecc8a4 Remove i386 CI check (oxcaml#155) git-subtree-dir: ocaml git-subtree-split: a7d005a
e3076d2 Unboxed types v1 (oxcaml#139) e68c72d update HACKING.jst.adoc (oxcaml#165) 6c5197b Merge pull request oxcaml#166 from mshinwell/merge-flambda-backend-2023-04-28 0c3dcf9 Fix for ocamldoc 09b9e1c Fix for -zero-alloc-check 71e5e07 Compilation fixes after merge bf66257 Merge flambda-backend changes a2556fc Add `[%exclave]` support (oxcaml#51) ebe9576 Add data race freedom proposal (oxcaml#161) 3f3fc49 Merge pull request oxcaml#159 from riaqn/merge-backend 6c635dc minor changes after merge 99a0d85 Merge flambda-backend changes 2642463 Include the modes of values in debugging information (oxcaml#153) 4ecc8a4 Remove i386 CI check (oxcaml#155) git-subtree-dir: ocaml git-subtree-split: e3076d2
|
This PR doesnt have tests, which is slightly sad as we are going to add more things to |
This PR adds a [-dlocations-mapping] flag that when used in conjunction with [-dump-into-file] and some of [-dcmm, -dflambda/ ...] will create a binary file ..dump.map holding mapping information of locations between .ml and ..dump.
These information is stored as a list of (label, location in source, location in file). No filtering is done on these so the list may include locations which are not coming from the source code but for something that has been inlined.
The implementation in itself is based on formatter:
Tracking_formatter.createon a formatter will enhance this formatter to track locations while its being used to print some irslet with_location_mapping ?label ~dbg ppf fcan they be used to store a mapping betweendbgand what will be printed when invokingf ().Right now I've only implemented tracking for
cmmas a proof of concept.