Open SirLynix opened 2 years ago
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.
std::shared_ptr<const Ast::ConstantValueExpression>
The end result should be that running constant propagation (or even sanitization) on a already processed AST should return the same AST.
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)
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.