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 analysis #714

Merged
merged 15 commits into from
Mar 15, 2024
Merged

Dead code analysis #714

merged 15 commits into from
Mar 15, 2024

Conversation

robrix
Copy link
Contributor

@robrix robrix commented Mar 11, 2024

Run it like so:

deadCodeFlowInsensitive Analysis.Syntax.eval Analysis.Syntax.subterms [Analysis.File.File (Analysis.Reference.Reference "" (Source.Span.Span (Source.Span.Pos 0 0) (Source.Span.Pos 1 1))) (Analysis.Syntax.String (Data.String.fromString ""))]

to get a result like so:

( fromList []
, …
, …
)

which shows us (by its exclusion) that the entire input program is live.

@robrix robrix marked this pull request as ready for review March 15, 2024 14:36
@robrix robrix requested a review from a team as a code owner March 15, 2024 14:36
@robrix
Copy link
Contributor Author

robrix commented Mar 15, 2024

NB: we currently evaluate function bodies at their definition sites, which means that all code ends up appearing live. I'm switching focus to another part of the system for the moment, so I'm postponing that issue to another PR.

@robrix robrix merged commit fe4a775 into main Mar 15, 2024
2 checks passed
@robrix robrix deleted the all-code-dies-not-all-code-truly-lives branch March 15, 2024 17:58
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