EnterSSA traverses function expressions
Joe Savona committed
Jun 8, 2023 at 14:02 UTC
638e45c9280861e7a59d4e18d258330acdb4876b
2 files changed
+5
-2
compiler/forget/packages/babel-plugin-react-forget/src/Inference/AnalyseFunctions.ts
+1
-2
@@ -17,7 +17,7 @@ import {
17
ReactiveScopeDependency,
18
} from "../HIR";
19
import { constantPropagation } from "../Optimization";
20
-import { eliminateRedundantPhi, enterSSA } from "../SSA";
20
+import { eliminateRedundantPhi } from "../SSA";
21
import { inferTypes } from "../TypeInference";
22
import { logHIRFunction } from "../Utils/logger";
23
import { inferMutableRanges } from "./InferMutableRanges";
@@ -89,7 +89,6 @@ export default function analyseFunctions(func: HIRFunction): void {
89
}
90
91
function lower(func: HIRFunction): void {
92
- enterSSA(func);
92
eliminateRedundantPhi(func);
93
constantPropagation(func);
94
inferTypes(func);
compiler/forget/packages/babel-plugin-react-forget/src/SSA/EnterSSA.ts
+4
@@ -232,6 +232,10 @@ export default function enterSSA(func: HIRFunction): void {
232
for (const instr of block.instructions) {
233
mapInstructionLValues(instr, (lvalue) => builder.definePlace(lvalue));
234
mapInstructionOperands(instr, (place) => builder.getPlace(place));
235
+
236
+ if (instr.value.kind === "FunctionExpression") {
237
+ enterSSA(instr.value.loweredFunc);
238
+ }
239
}
240
241
mapTerminalOperands(block.terminal, (place) => builder.getPlace(place));