Skip to content

Conversation

ekpyron
Copy link
Collaborator

@ekpyron ekpyron commented Aug 15, 2024

Just quickly written and not urgent - but before @clonker gets back to the actual YulName->ID replacement an FYI that the weird special names in the UnusedStoreEliminator can easily be removed.

@ekpyron ekpyron requested a review from clonker August 15, 2024 15:43
@ekpyron ekpyron force-pushed the removeSpecialYulStrings branch 3 times, most recently from 59a72a3 to ef00aef Compare August 15, 2024 15:47
@ekpyron ekpyron added the 🟡 PR review label label Aug 15, 2024
@ekpyron ekpyron force-pushed the removeSpecialYulStrings branch from ef00aef to 33b818c Compare August 15, 2024 17:16
Copy link

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Aug 30, 2024
@ekpyron ekpyron removed the stale The issue/PR was marked as stale because it has been open for too long. label Sep 2, 2024
Copy link

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Sep 16, 2024
@ekpyron ekpyron removed the stale The issue/PR was marked as stale because it has been open for too long. label Sep 16, 2024
Copy link

github-actions bot commented Oct 1, 2024

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Oct 1, 2024
@clonker clonker removed the stale The issue/PR was marked as stale because it has been open for too long. label Oct 1, 2024
Copy link

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Oct 16, 2024
@clonker clonker removed the stale The issue/PR was marked as stale because it has been open for too long. label Oct 16, 2024
@ekpyron ekpyron force-pushed the removeSpecialYulStrings branch from 33b818c to 9288e93 Compare October 22, 2024 14:42
@ekpyron ekpyron marked this pull request as ready for review October 22, 2024 14:42
std::set<Statement const*>& activeStorageStores() { return m_activeStores["s"_yulname]; }
std::set<Statement const*>& activeMemoryStores() { return m_activeStores[UnusedStoreEliminatorKey::Memory]; }
std::set<Statement const*>& activeStorageStores() { return m_activeStores[UnusedStoreEliminatorKey::Storage]; }
std::optional<u256> lengthValue(OperationLength const& _length) const
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd give it a name more resembling the knowledge base function it replaces. lengthValue() sounds a bit plain and it might be too easy to not realize it's not doing something much simpler.

Suggested change
std::optional<u256> lengthValue(OperationLength const& _length) const
std::optional<u256> lengthValueIfKnownConstant(OperationLength const& _length) const

Copy link
Member

Choose a reason for hiding this comment

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

I think it's also fine like it is, the implementation is concise and right there - although I am not opposed to the longer name, either.

Copy link
Collaborator

Choose a reason for hiding this comment

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

When you read the code, you see the name, not the implementation and it should reflect important things about the function. IMO in this case it does not.

Copy link
Collaborator Author

@ekpyron ekpyron Oct 31, 2024

Choose a reason for hiding this comment

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

We should also stop renaming and refactoring random stuff in PRs just because they happen to appear in the diff. It's not a new name introduced in the PR - if you're bothered by it, feel free to create a PR to rename it (even though I'd say the current name is fine), but it has nothing to do with what this PR does.

Copy link
Collaborator Author

@ekpyron ekpyron Oct 31, 2024

Choose a reason for hiding this comment

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

oh damn, it actually is new :-D sorry, I didn't see it properly on my phone :-) (and thought this PR actually doesn't add anything :-))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd still keep the name. The return type makes things pretty clear anyways

@ekpyron ekpyron merged commit 4087482 into develop Oct 31, 2024
73 checks passed
@ekpyron ekpyron deleted the removeSpecialYulStrings branch October 31, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants