-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Remove special yul strings from UnusedStoreEliminator #15337
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
Conversation
59a72a3
to
ef00aef
Compare
ef00aef
to
33b818c
Compare
This pull request is stale because it has been open for 14 days with no activity. |
This pull request is stale because it has been open for 14 days with no activity. |
This pull request is stale because it has been open for 14 days with no activity. |
This pull request is stale because it has been open for 14 days with no activity. |
33b818c
to
9288e93
Compare
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 |
There was a problem hiding this comment.
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.
std::optional<u256> lengthValue(OperationLength const& _length) const | |
std::optional<u256> lengthValueIfKnownConstant(OperationLength const& _length) const |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :-))
There was a problem hiding this comment.
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
9288e93
to
cbfe4a1
Compare
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.