Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead code elimination of some unused references #1510

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Conversation

vouillon
Copy link
Member

If we have some code like the following where f and g are not used otherwise, neither f nor g have to be considered live.

let f = ref None
....
let () = f := Some g

More generally, an assignment Set_field (x, _, y) will not mark x as live and will mark y as live only if x is live.

@hhugo
Copy link
Member

hhugo commented Sep 15, 2023

x-ref ocaml-community/yojson#168 which is working around the current limitation.

@hhugo hhugo merged commit 170d15e into master Sep 15, 2023
@hhugo hhugo deleted the improved-dead-code branch September 15, 2023 08:53
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