-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Treat builtins separately in Yul AST #15347
Conversation
d93fc88
to
5f7b564
Compare
340ffbc
to
b69030d
Compare
a5e3f71
to
52e9e4b
Compare
39fdd32
to
dec3a9d
Compare
dec3a9d
to
7370d5a
Compare
d73a5bf
to
ec2536e
Compare
01fe1a4
to
108cf86
Compare
03b01c1
to
4938075
Compare
This comment was marked as resolved.
This comment was marked as resolved.
…ions from an AST FunctionName
a3ef44a
to
7b51864
Compare
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.
Even with parts extracted into prerequisite PRs this is still a ton of code, but finally I managed to get through it all.
And it actually looks good. I didn't find any serious problems. Only a few minor things that would be good to clean up before we merge. Some of them, like CommonOptions::dialect()
or YulName(string_view)
or making Dialect
a class, could also be done separately rather than directly in this PR.
void InlinableExpressionFunctionFinder::checkAllowed(FunctionName _name) | ||
{ | ||
// disallowed function names can only ever be user-defined `yul::Identifier`s, not builtins | ||
if (std::holds_alternative<Identifier>(_name) && m_disallowedIdentifiers.count(std::get<Identifier>(_name).name)) |
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.
void InlinableExpressionFunctionFinder::checkAllowed(FunctionName _name) | |
{ | |
// disallowed function names can only ever be user-defined `yul::Identifier`s, not builtins | |
if (std::holds_alternative<Identifier>(_name) && m_disallowedIdentifiers.count(std::get<Identifier>(_name).name)) | |
void InlinableExpressionFunctionFinder::checkAllowed(FunctionName const& _name) | |
{ | |
// disallowed function names can only ever be user-defined `yul::Identifier`s, not builtins | |
if (std::holds_alternative<Identifier>(_name) && m_disallowedIdentifiers.count(std::get<Identifier>(_name).name) != 0) |
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.
There's also the spacing and const&
. No need to make a copy of the whole AST node.
It sucks that github does not highlight all the differences in the snippet.
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.
Ahhh yeah, passing it as cref now, missed that earlier.
dda6ecd
to
f8fbcbd
Compare
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.
Two more places where you could use the new YulString
constructor.
90174d8
to
fca7d33
Compare
fca7d33
to
8994d85
Compare
Depends on