-
Notifications
You must be signed in to change notification settings - Fork 22
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
Define built-ins contexts (for Yul built-in functions) and synthetically build the stack graph for the built-ins #1203
base: main
Are you sure you want to change the base?
Conversation
|
f5c37a6
to
aa7fd27
Compare
…ing `BuiltInContext` This version is very broken but it represents most of the initial changes to `definitions.rs`
… enable `jump`/`jumpi`
... and remove parsing and processing Solidity generated files with the built-in definitions.
This PR introduces several changes to how built-ins are defined and processed. We define different built-in contexts to separate built-in symbols available in Solidity and Yul. Also, the part of the stack graph that contains all definitions of built-ins is now built directly into the stack graph, without generating a Solidity file and the processing it as a system file. This allows much faster initialization of the Bindings Graph and most symbol mangling is no longer needed since we're not required to parse the built-ins file anymore.
In addition, all Yul built-ins are no longer defined in the grammar as special keywords and instead are treated as normal identifiers and bound to built-in definitions using the regular binding rules.
NB: I'm not totally happy with how the code to build the built-ins stack graph is being generated (with Rust), but I took a stab at using Jinja templates for it and the partial results were getting comparatively too complicated.