Skip to content
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

Duplicate AST nodes only when required #12

Open
SirLynix opened this issue Jun 21, 2022 · 1 comment
Open

Duplicate AST nodes only when required #12

SirLynix opened this issue Jun 21, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@SirLynix
Copy link
Contributor

Currently, the AST is fully duplicated for every compilation step, when only minor changes are required (or even if no change is required at all).

We should prevent this by making every AST shared_ptr const (ex: std::shared_ptr<const Ast::ConstantValueExpression>) and cloning only changing parts.

The end result should be that running constant propagation (or even sanitization) on a already processed AST should return the same AST.

@SirLynix SirLynix added the enhancement New feature or request label Jun 21, 2022
@SirLynix
Copy link
Contributor Author

SirLynix commented Aug 3, 2024

This is currently worked on, on the multipass branch.

The approach is to directly update the AST using multiple transformers and clone it only when required (importing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant