era-compiler-solidity icon indicating copy to clipboard operation
era-compiler-solidity copied to clipboard

refac: decouple LLVM specifics from YUL parser

Open sayon opened this issue 1 year ago • 1 comments

What ❔

Parameterize parser with previously LLVM-specific details (i.e. function attributes).

Why ❔

LLVM-specific logic has to be decoupled from the parser so that parser can be decoupled from the compiler and reused in other contexts.

sayon avatar Aug 10 '24 12:08 sayon

Codecov Report

Attention: Patch coverage is 73.96509% with 522 lines in your changes missing coverage. Please review.

Project coverage is 53.03%. Comparing base (1d861cb) to head (e94cd66). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
era-yul/src/yul/printer.rs 55.35% 125 Missing :warning:
...ser/statement/expression/function_call/verbatim.rs 2.08% 47 Missing :warning:
era-yul/src/yul/visitor/mod.rs 0.00% 41 Missing :warning:
era-yul/src/yul/parser/statement/mod.rs 53.52% 33 Missing :warning:
...y/src/yul/parser/statement/variable_declaration.rs 23.68% 29 Missing :warning:
era-yul/src/yul/parser/statement/assignment.rs 39.58% 29 Missing :warning:
...ty/src/yul/parser/statement/function_definition.rs 46.66% 24 Missing :warning:
era-yul/src/yul/parser/type.rs 12.50% 21 Missing :warning:
...l/parser/statement/expression/function_call/mod.rs 54.54% 20 Missing :warning:
era-yul/src/util/counter.rs 0.00% 18 Missing :warning:
... and 24 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
+ Coverage   52.59%   53.03%   +0.43%     
==========================================
  Files         106      129      +23     
  Lines       14761    15346     +585     
==========================================
+ Hits         7764     8138     +374     
- Misses       6997     7208     +211     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 10 '24 12:08 codecov[bot]

It looks like there are still 2 parsers: in both new and original crate. Did you want an intermediate review? :)

Yes, that would be fantastic!

I have left the dialect-specific code (including the LLVM IR generation) in the era-compiler-solidity crate; the dialect-independent code is in yul-syntax-tools (that I will rename).

I will fix the things you have pinpointed and ping you again.

sayon avatar Aug 28 '24 12:08 sayon

It looks like there are still 2 parsers: in both new and original crate. Did you want an intermediate review? :)

Yes, that would be fantastic!

I have left the dialect-specific code (including the LLVM IR generation) in the era-compiler-solidity crate; the dialect-independent code is in yul-syntax-tools (that I will rename).

I will fix the things you have pinpointed and ping you again.

Sure. I've pointed out what I could catch, but let's continue when you remove Yul structures and parsing logic from era-compiler-solidity, as that's the most important part.

hedgar2017 avatar Aug 28 '24 12:08 hedgar2017

@hedgar2017 ready for review

sayon avatar Aug 29 '24 07:08 sayon