dillon1000/react

Commit

Value block reassignment uses StoreLocal

As part of removing Instruction.lvalue we need to ensure that it is only used to 
represent that instruction's value — the InstructionKind should always be Const. 
The one place where we violated this was for value blocks, specifically 
ConditionalExpression and LogicalExpression. For both of those, we generate a 
single temporary place to represent the expression result. Then the consequent 
and alternate branch ended in a `LoadLocal` that reassigned that temporary (in 
the lvalue) to the result of that branch. 

This PR changes to use StoreLocal instead, and updates the recently added 
validation pass to ensure that all identifiers that appear in an 
Instruction.lvalue are only ever assigned once.
Browse files
Changed paths4 files
First-parent comparison
M compiler/forget/src/CompilerPipeline.ts ModifiedM compiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/HIR/ValidateConsistentIdentifiers.ts ModifiedM compiler/forget/src/ReactiveScopes/BuildReactiveFunction.ts Modified
Patch

Files changed

Rendering syntax-highlighted changes…