shuosc / Come

A C like language and its compiler
The Unlicense
6 stars 3 forks source link

Structural Analysis #56

Open longfangsong opened 3 months ago

longfangsong commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently the wasm code gen is worked in a very unnature way.

And the code is very very very ugly.

Describe the solution you'd like

Instead of using current complex algorithm, use Structural Analysis based way instead.

We should start from creating a structural analysis analysis pass.

Ref Advanced Compiler Design & Implementation, Chapter 7.7, P202

Describe alternatives you've considered Just refactor the current code generating.

longfangsong commented 2 months ago

59 added the analysis, but need to use it to replace the scc based code gen process.