dillon1000/react

Commit

[rust] enter_ssa recurses into function expressions

Updates `enter_ssa()` to recurse into function expressions. In the TS compiler 
we use a single Builder instance and copy (references to) the function 
expression's blocks into the builder. That type of sharing just does not play 
nicely with Rust. But... we don't need to do that! We already know the context 
variables of the function expression, so we can lookup each of them to find 
their re-mapped identifier, and set that as the starting state for the entry 
block of the function expression. That lets us use normal recursion and 
otherwise not share any information between the outer and inner builders. 

Of course to make this work we actually have to populate Function.context, but 
the algorithm _should_ work.
Browse files
Changed paths3 files
First-parent comparison
M compiler/forget/crates/build-hir/src/build.rs ModifiedM compiler/forget/crates/hir-ssa/src/enter.rs ModifiedM compiler/forget/crates/hir/src/function.rs Modified
Patch

Files changed

Rendering syntax-highlighted changes…