aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
6.2k stars 3.67k forks source link

[Feature Request][move-compiler-v2] abstract and share module/function iteration for AST passes #12403

Open brmataptos opened 9 months ago

brmataptos commented 9 months ago

🚀 Feature Request

All the AST passes other than inlining share a common pattern of iteration over target functions and generation of updates which could be abstracted to reduce the distinct code to maintain. This includes the new Lambda-lifting pass.

Inlining is a little trickier, as it needs to iterate over the functions in a particular order.

Analysis passes are easier, as they don't modify functions but perhaps they can also be in the same framework.

brmataptos commented 9 months ago

@wrwg