Skip to content

Add conditional printing to Flambda_cmx_format#2

Merged
lukemaurer merged 2 commits intolukemaurer:objinfo-no-codefrom
lthls:cmx-printing
Jun 28, 2024
Merged

Add conditional printing to Flambda_cmx_format#2
lukemaurer merged 2 commits intolukemaurer:objinfo-no-codefrom
lthls:cmx-printing

Conversation

@lthls
Copy link
Copy Markdown

@lthls lthls commented Jun 27, 2024

I saw your PR (oxcaml#2737) and thought it was a shame that we didn't make the -no-code and -no-approx work properly, so here is a proposal (on top of your branch) to make it more fine-grained.

Copy link
Copy Markdown
Owner

@lukemaurer lukemaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, thanks! I just had one thought and then I guess the easiest is just to merge this into the other PR?

@lthls
Copy link
Copy Markdown
Author

lthls commented Jun 28, 2024

This is a PR targeting the branch from which you submitted your PR, so if you merge it the original PR will be updated directly.

@lukemaurer
Copy link
Copy Markdown
Owner

This is a PR targeting the branch from which you submitted your PR, so if you merge it the original PR will be updated directly.

Okay yeah, that's what I was thinking. Merging

@lukemaurer lukemaurer merged commit 9089f6c into lukemaurer:objinfo-no-code Jun 28, 2024
lukemaurer added a commit that referenced this pull request Jun 28, 2024
This exercises the separate `-no-approx` implementation from
#2.
mshinwell pushed a commit to oxcaml/oxcaml that referenced this pull request Jul 5, 2024
…o` (#2737)

* Implement `-no-approx` and `-no-code` in flambda-backend `ocamlobjinfo`

The old `-no-approx` and `-no-code` options are currently parsed but ignored.
This is inconvenient, since the output for an flambda2 .cmx can be screenfuls
long even for relatively small modules.

This PR implements `-no-approx` by just suppressing .cmx export information
altogether (roughly equivalent to what the old one did).

Also implements `-no-code` by doing exactly the same thing as
`-no-approx`. (Which does indeed mean there's no code.)

* Also suppress zero-alloc info

It's not as noisy as the full export info but it does make tests more sensitive.

* Add conditional printing to Flambda_cmx_format

* Better condition

* Add a test case with `-no-code` but not `-no-approx`

This exercises the separate `-no-approx` implementation from
lukemaurer#2.

---------

Co-authored-by: Vincent Laviron <vincent.laviron@gmail.com>
Ekdohibs pushed a commit to Ekdohibs/flambda-backend that referenced this pull request Jul 5, 2024
…o` (oxcaml#2737)

* Implement `-no-approx` and `-no-code` in flambda-backend `ocamlobjinfo`

The old `-no-approx` and `-no-code` options are currently parsed but ignored.
This is inconvenient, since the output for an flambda2 .cmx can be screenfuls
long even for relatively small modules.

This PR implements `-no-approx` by just suppressing .cmx export information
altogether (roughly equivalent to what the old one did).

Also implements `-no-code` by doing exactly the same thing as
`-no-approx`. (Which does indeed mean there's no code.)

* Also suppress zero-alloc info

It's not as noisy as the full export info but it does make tests more sensitive.

* Add conditional printing to Flambda_cmx_format

* Better condition

* Add a test case with `-no-code` but not `-no-approx`

This exercises the separate `-no-approx` implementation from
lukemaurer#2.

---------

Co-authored-by: Vincent Laviron <vincent.laviron@gmail.com>
mshinwell pushed a commit to ocaml-flambda/ocaml-jst that referenced this pull request Jul 15, 2024
…kend `ocamlobjinfo` (#2737)

* Implement `-no-approx` and `-no-code` in flambda-backend `ocamlobjinfo`

The old `-no-approx` and `-no-code` options are currently parsed but ignored.
This is inconvenient, since the output for an flambda2 .cmx can be screenfuls
long even for relatively small modules.

This PR implements `-no-approx` by just suppressing .cmx export information
altogether (roughly equivalent to what the old one did).

Also implements `-no-code` by doing exactly the same thing as
`-no-approx`. (Which does indeed mean there's no code.)

* Also suppress zero-alloc info

It's not as noisy as the full export info but it does make tests more sensitive.

* Add conditional printing to Flambda_cmx_format

* Better condition

* Add a test case with `-no-code` but not `-no-approx`

This exercises the separate `-no-approx` implementation from
lukemaurer/flambda-backend#2.

---------

Co-authored-by: Vincent Laviron <vincent.laviron@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants