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

refactor: Remove add_op/node_after and move_after #620

Closed
wants to merge 4 commits into from

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Oct 23, 2023

We only use these in a couple of places, and we never need to - we're always adding after the last sibling of a parent that we have handy anyway.

The _before versions are much more widely used, but maybe we only need one rather than both?

Note this run without the last commit: clippy --all-targets complains that add_op is unused, even though it is used. But it's not that hard to remove...

@acl-cqc acl-cqc changed the title Refactor: Remove add_op/node_after and move_after refactor: Remove add_op/node_after and move_after Oct 23, 2023
@acl-cqc acl-cqc requested review from ss2165 and aborgna-q October 23, 2023 14:39
Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

I don't really see a motivation to drop these. Yes, we mostly only add _before in hugr, but the footprint of this is minimal.

Outside of tests, these are used for manipulating basic blocks where the exit has to be last, or ordering conditional branches. Any of these could have a use for _after at some point.

@acl-cqc
Copy link
Contributor Author

acl-cqc commented Oct 24, 2023

I don't really see a motivation to drop these. Yes, we mostly only add _before in hugr, but the footprint of this is minimal.

Outside of tests, these are used for manipulating basic blocks where the exit has to be last, or ordering conditional branches. Any of these could have a use for _after at some point.

Yeah, ok, was trying to drain the swamp ;-), but as you say this is only really chipping around the edges, and #622 is much more the right direction; can probably do more after that. Ta :)

@acl-cqc acl-cqc closed this Oct 24, 2023
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