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
a59ec52 to
371647c
Compare
ea36743 to
a3ef44a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
…ions from an AST FunctionName
a3ef44a to
7b51864
Compare
cameel
left a comment
There was a problem hiding this comment.
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.
| 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.
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.
Ahhh yeah, passing it as cref now, missed that earlier.
dda6ecd to
f8fbcbd
Compare
cameel
left a comment
There was a problem hiding this comment.
Two more places where you could use the new YulString constructor.
Depends on