From 6efac286770f8b104aea68bf84ae28c8286a24b2 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 14 Dec 2022 16:42:54 -0800 Subject: [PATCH] Prune unnecessary labels in output --- compiler/forget/src/HIR/Pipeline.ts | 2 + compiler/forget/src/HIR/PruneUnusedLabels.ts | 83 +++++++++++++++++++ .../_bug_conditional-break-labeled.expect.md | 2 +- .../fixtures/hir/alias-while.expect.md | 2 +- .../fixtures/hir/complex-while.expect.md | 4 +- .../fixtures/hir/component.expect.md | 8 +- .../fixtures/hir/conditional-break.expect.md | 10 +-- .../hir/conditional-on-mutable.expect.md | 8 +- .../hir/dependencies-outputs.expect.md | 4 +- .../fixtures/hir/dependencies.expect.md | 4 +- .../fixtures/hir/extend-scopes-if.expect.md | 4 +- ...reeze-possibly-mutable-arguments.expect.md | 2 +- .../hir/independent-across-if.expect.md | 2 +- .../hir/interdependent-across-if.expect.md | 2 +- .../fixtures/hir/inverted-if.expect.md | 2 +- .../fixtures/hir/logical-expression.expect.md | 6 +- .../hir/mutable-lifetime-loops.expect.md | 12 +-- .../mutable-lifetime-with-aliasing.expect.md | 10 +-- .../hir/mutable-liverange-loop.expect.md | 12 +-- ...g-scopes-interleaved-by-terminal.expect.md | 2 +- ...ng-scopes-shadowing-within-block.expect.md | 4 +- .../hir/overlapping-scopes-while.expect.md | 2 +- .../overlapping-scopes-within-block.expect.md | 4 +- .../fixtures/hir/reactive-scopes-if.expect.md | 2 +- .../fixtures/hir/reactive-scopes.expect.md | 2 +- .../hir/reassignment-conditional.expect.md | 2 +- .../reassignment-separate-scopes.expect.md | 2 +- .../__tests__/fixtures/hir/simple.expect.md | 2 +- .../fixtures/hir/ssa-call-jsx-2.expect.md | 2 +- .../hir/ssa-complex-multiple-if.expect.md | 4 +- .../hir/ssa-complex-single-if.expect.md | 2 +- .../hir/ssa-for-trivial-update.expect.md | 2 +- .../__tests__/fixtures/hir/ssa-for.expect.md | 2 +- .../fixtures/hir/ssa-if-else.expect.md | 2 +- .../fixtures/hir/ssa-multiple-phis.expect.md | 6 +- .../ssa-nested-loops-no-reassign.expect.md | 6 +- .../hir/ssa-nested-partial-phi.expect.md | 4 +- .../ssa-nested-partial-reassignment.expect.md | 2 +- .../hir/ssa-objectexpression-phi.expect.md | 2 +- ...a-property-alias-alias-mutate-if.expect.md | 2 +- .../hir/ssa-property-alias-if.expect.md | 2 +- .../ssa-property-alias-mutate-if.expect.md | 2 +- ...-property-alias-mutate-inside-if.expect.md | 2 +- .../fixtures/hir/ssa-return.expect.md | 2 +- .../fixtures/hir/ssa-shadowing.expect.md | 2 +- .../fixtures/hir/ssa-sibling-phis.expect.md | 6 +- .../fixtures/hir/ssa-simple-phi.expect.md | 2 +- .../fixtures/hir/ssa-single-if.expect.md | 2 +- .../fixtures/hir/ssa-throw.expect.md | 2 +- .../hir/ssa-while-no-reassign.expect.md | 2 +- .../fixtures/hir/ssa-while.expect.md | 2 +- .../__tests__/fixtures/hir/switch.expect.md | 2 +- .../type-args-test-binary-operator.expect.md | 2 +- .../hir/type-binary-operator.expect.md | 2 +- .../type-test-field-load-binary-op.expect.md | 2 +- .../type-test-return-type-inference.expect.md | 2 +- .../fixtures/hir/while-break.expect.md | 2 +- .../hir/while-conditional-continue.expect.md | 4 +- compiler/forget/src/index.ts | 2 + 59 files changed, 184 insertions(+), 97 deletions(-) create mode 100644 compiler/forget/src/HIR/PruneUnusedLabels.ts diff --git a/compiler/forget/src/HIR/Pipeline.ts b/compiler/forget/src/HIR/Pipeline.ts index 34a2b0ee26..6a32076958 100644 --- a/compiler/forget/src/HIR/Pipeline.ts +++ b/compiler/forget/src/HIR/Pipeline.ts @@ -23,6 +23,7 @@ import { inferTypes } from "./InferTypes"; import { logHIRFunction } from "./logger"; import { printReactiveFunction } from "./PrintReactiveFunction"; import { propagateScopeDependencies } from "./PropagateScopeDependencies"; +import { pruneUnusedLabels } from "./PruneUnusedLabels"; export type CompilerFlags = { eliminateRedundantPhi: boolean; @@ -89,6 +90,7 @@ export default function ( if (flags.codegen) { const reactiveFunction = buildReactiveFunction(ir); + pruneUnusedLabels(reactiveFunction); flattenReactiveLoops(reactiveFunction); propagateScopeDependencies(reactiveFunction); const scopes = printReactiveFunction(reactiveFunction); diff --git a/compiler/forget/src/HIR/PruneUnusedLabels.ts b/compiler/forget/src/HIR/PruneUnusedLabels.ts new file mode 100644 index 0000000000..666f04a1f9 --- /dev/null +++ b/compiler/forget/src/HIR/PruneUnusedLabels.ts @@ -0,0 +1,83 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { assertExhaustive } from "../Common/utils"; +import { + BlockId, + ReactiveBasicBlock, + ReactiveFunction, + ReactiveTerminal, +} from "./HIR"; + +/** + * Prunes terminal labels that are never explicitly jumped to. + */ +export function pruneUnusedLabels(fn: ReactiveFunction): void { + const labels: Labels = new Set(); + visitBlock(labels, fn.body); +} + +type Labels = Set; + +function visitBlock(labels: Labels, block: ReactiveBasicBlock): void { + for (const item of block) { + if (item.kind === "terminal") { + // first visit the terminal's contents, which is the only place that can + // reference the terminal's label + visitTerminal(labels, item.terminal); + // if the label wasn't referenced by a break/continue, we can prune it + if (item.label !== null && !labels.has(item.label)) { + item.label = null; + } + } else if (item.kind === "block") { + visitBlock(labels, item.instructions); + } + } +} + +function visitTerminal(labels: Labels, terminal: ReactiveTerminal): void { + switch (terminal.kind) { + case "break": + case "continue": { + if (terminal.label !== null) { + labels.add(terminal.label); + } + break; + } + case "for": { + visitBlock(labels, terminal.loop); + break; + } + case "if": { + visitBlock(labels, terminal.consequent); + if (terminal.alternate !== null) { + visitBlock(labels, terminal.alternate); + } + break; + } + case "return": + case "throw": { + break; + } + case "switch": { + for (const case_ of terminal.cases) { + visitBlock(labels, case_.block!); + } + break; + } + case "while": { + visitBlock(labels, terminal.loop); + break; + } + default: { + assertExhaustive( + terminal, + `Unexpected terminal kind '${(terminal as any).kind}'` + ); + } + } +} diff --git a/compiler/forget/src/__tests__/fixtures/hir/_bug_conditional-break-labeled.expect.md b/compiler/forget/src/__tests__/fixtures/hir/_bug_conditional-break-labeled.expect.md index 7e70e51c75..6789d5df9f 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/_bug_conditional-break-labeled.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/_bug_conditional-break-labeled.expect.md @@ -69,7 +69,7 @@ function Component$0(props$3) { const a$4 = []; a$4.push(props$3.a); - bb2: if (props$3.b) { + if (props$3.b) { a$4.push(props$3.d); return a$4; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/alias-while.expect.md b/compiler/forget/src/__tests__/fixtures/hir/alias-while.expect.md index 341dab9869..c0c11f8efb 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/alias-while.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/alias-while.expect.md @@ -92,7 +92,7 @@ function foo$0(cond$7) { b$9 = {}; c$10 = {}; - bb2: while (cond$7) { + while (cond$7) { const z$13 = a$8; a$8 = b$9; b$9 = c$10; diff --git a/compiler/forget/src/__tests__/fixtures/hir/complex-while.expect.md b/compiler/forget/src/__tests__/fixtures/hir/complex-while.expect.md index fbc5d1a45a..bc73a27367 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/complex-while.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/complex-while.expect.md @@ -62,9 +62,9 @@ function foo( ```javascript function foo$0(a$4, b$5, c$6) { - bb1: if (a$4) { + if (a$4) { while (b$5) { - bb7: if (c$6) { + if (c$6) { break; } } diff --git a/compiler/forget/src/__tests__/fixtures/hir/component.expect.md b/compiler/forget/src/__tests__/fixtures/hir/component.expect.md index cf20cc5304..510abef4a4 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/component.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/component.expect.md @@ -189,21 +189,21 @@ function Component$0(props$29) { } else { } - bb2: for (let i$36 = 0; i$36 < items$30.length; i$36 = i$36 + 1, i$36) { + for (let i$36 = 0; i$36 < items$30.length; i$36 = i$36 + 1, i$36) { const item$40 = items$30.at(i$36); - bb9: if (item$40 == null) { + if (item$40 == null) { } else { } - bb6: if (seen$33.has(item$40)) { + if (seen$33.has(item$40)) { continue; } seen$33.add(item$40); renderedItems$32.push(
{item$40}
); - bb12: if (renderedItems$32.length >= max$35) { + if (renderedItems$32.length >= max$35) { break; } } diff --git a/compiler/forget/src/__tests__/fixtures/hir/conditional-break.expect.md b/compiler/forget/src/__tests__/fixtures/hir/conditional-break.expect.md index 2da39867af..b4e0ae00a0 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/conditional-break.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/conditional-break.expect.md @@ -124,7 +124,7 @@ function Component$0(props$4) { a_DEBUG$5 = []; a_DEBUG$5.push(props$4.a); - bb1: if (props$4.b) { + if (props$4.b) { return null; } @@ -191,7 +191,7 @@ function Component$0(props$3) { a$4 = []; a$4.push(props$3.a); - bb1: if (props$3.b) { + if (props$3.b) { a$4.push(props$3.c); } @@ -262,7 +262,7 @@ function Component$0(props$4) { a$5 = []; a$5.push(props$4.a); - bb1: if (props$4.b) { + if (props$4.b) { a$5.push(props$4.c); return null; } @@ -332,7 +332,7 @@ function Component$0(props$3) { a$4 = []; a$4.push(props$3.a); - bb1: if (props$3.b) { + if (props$3.b) { a$4.push(props$3.c); return a$4; } @@ -400,7 +400,7 @@ function Component$0(props$3) { const a$4 = []; a$4.push(props$3.a); - bb2: if (props$3.b) { + if (props$3.b) { a$4.push(props$3.d); return a$4; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/conditional-on-mutable.expect.md b/compiler/forget/src/__tests__/fixtures/hir/conditional-on-mutable.expect.md index 70e3f6f5fe..7f5d039411 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/conditional-on-mutable.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/conditional-on-mutable.expect.md @@ -92,11 +92,11 @@ function Component$0(props$6) { a$7 = []; const b$8 = []; - bb1: if (b$8) { + if (b$8) { a$7.push(props$6.p0); } - bb3: if (props$6.p1) { + if (props$6.p1) { b$8.push(props$6.p2); } @@ -188,11 +188,11 @@ function Component$0(props$8) { a$9 = []; const b$10 = []; - bb1: if (mayMutate$4(b$10)) { + if (mayMutate$4(b$10)) { a$9.push(props$8.p0); } - bb3: if (props$8.p1) { + if (props$8.p1) { b$10.push(props$8.p2); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/dependencies-outputs.expect.md b/compiler/forget/src/__tests__/fixtures/hir/dependencies-outputs.expect.md index 3663aad4ec..b9c400127b 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/dependencies-outputs.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/dependencies-outputs.expect.md @@ -94,11 +94,11 @@ function foo$0(a$6, b$7) { if (c_2 || c_3) { const y$10 = []; - bb1: if (x$8.length) { + if (x$8.length) { y$10.push(x$8); } - bb3: if (b$7) { + if (b$7) { y$10.push(b$7); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/dependencies.expect.md b/compiler/forget/src/__tests__/fixtures/hir/dependencies.expect.md index 15dc3e671c..41848763ae 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/dependencies.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/dependencies.expect.md @@ -88,7 +88,7 @@ function foo$0(x$6, y$7, z$8) { if (c_3 || c_4) { items2$10 = []; - bb1: if (x$6) { + if (x$6) { items2$10.push(y$7); } @@ -99,7 +99,7 @@ function foo$0(x$6, y$7, z$8) { items2$10 = $[5]; } - bb3: if (y$7) { + if (y$7) { items$9.push(x$6); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/extend-scopes-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/extend-scopes-if.expect.md index 1e63ced36a..e23268703c 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/extend-scopes-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/extend-scopes-if.expect.md @@ -87,7 +87,7 @@ function foo$0(a$7, b$8, c$9) { if (c_0 || c_1 || c_2) { const x$10 = []; - bb1: if (a$7) { + if (a$7) { if (b$8) { if (c$9) { x$10.push(0); @@ -101,7 +101,7 @@ function foo$0(a$7, b$8, c$9) { } else { } - bb7: if (a$7.length) { + if (a$7.length) { return a$7; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/hooks-freeze-possibly-mutable-arguments.expect.md b/compiler/forget/src/__tests__/fixtures/hir/hooks-freeze-possibly-mutable-arguments.expect.md index 26a03d7c49..b542caa100 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/hooks-freeze-possibly-mutable-arguments.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/hooks-freeze-possibly-mutable-arguments.expect.md @@ -86,7 +86,7 @@ function Component$0(props$7) { if (c_0 || c_1) { a$11 = undefined; - bb1: if (cond$8) { + if (cond$8) { a$11 = x$9; } else { a$11 = []; diff --git a/compiler/forget/src/__tests__/fixtures/hir/independent-across-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/independent-across-if.expect.md index 45b33281da..0d1fb0af6f 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/independent-across-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/independent-across-if.expect.md @@ -178,7 +178,7 @@ function Component$0(props$8) { a$9 = compute$3(props$8.a); const b$10 = compute$3(props$8.b); - bb1: if (props$8.c) { + if (props$8.c) { mutate$5(a$9); mutate$5(b$10); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/interdependent-across-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/interdependent-across-if.expect.md index 0dd2e1d943..efb11d82f3 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/interdependent-across-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/interdependent-across-if.expect.md @@ -148,7 +148,7 @@ function Component$0(props$8) { a$9 = compute$3(props$8.a); b$10 = compute$3(props$8.b); - bb1: if (props$8.c) { + if (props$8.c) { foo$5(a$9, b$10); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/inverted-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/inverted-if.expect.md index b540b008f1..fa1c4915eb 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/inverted-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/inverted-if.expect.md @@ -64,7 +64,7 @@ function foo$0(a$5, b$6, c$7) { if (c_0 || c_1 || c_2) { const y$8 = []; - bb1: if (a$5) { + if (a$5) { if (b$6) { y$8.push(c$7); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/logical-expression.expect.md b/compiler/forget/src/__tests__/fixtures/hir/logical-expression.expect.md index 62865d74a7..2a08c2b369 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/logical-expression.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/logical-expression.expect.md @@ -79,7 +79,7 @@ function And$0() { if (c_1) { t2$6 = undefined; - bb1: if (t0$5) { + if (t0$5) { t2$6 = g$4(); } else { t2$6 = t0$5; @@ -155,7 +155,7 @@ function Or$0() { if (c_1) { t2$6 = undefined; - bb1: if (t0$5) { + if (t0$5) { t2$6 = t0$5; } else { t2$6 = g$4(); @@ -236,7 +236,7 @@ function QuestionQuestion$0(props$8) { if (c_1) { t2$12 = undefined; - bb1: if (t0$9 != null) { + if (t0$9 != null) { t2$12 = t0$9; } else { t2$12 = g$7(); diff --git a/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-loops.expect.md b/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-loops.expect.md index ae96275d8c..f52bbbc11b 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-loops.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-loops.expect.md @@ -184,7 +184,7 @@ function Component$0(props$12) { let b$20 = {}; let c$22 = {}; let d$24 = {}; - bb2: while (true) { + while (true) { const z$19 = a$18; a$18 = b$20; b$20 = c$22; @@ -192,21 +192,21 @@ function Component$0(props$12) { d$24 = z$19; mutate$7(a$18, b$20); - bb4: if (cond$8(a$18)) { + if (cond$8(a$18)) { break; } } - bb7: if (a$18) { + if (a$18) { } - bb9: if (b$20) { + if (b$20) { } - bb11: if (c$22) { + if (c$22) { } - bb13: if (d$24) { + if (d$24) { } mutate$7(d$24, null); diff --git a/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-with-aliasing.expect.md b/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-with-aliasing.expect.md index 17ecf712d0..d532cb7e35 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-with-aliasing.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-with-aliasing.expect.md @@ -157,19 +157,19 @@ function Component$0(props$10) { x$15.b = b$12; const y$16 = mutate$8(x$15, d$14); - bb1: if (a$11) { + if (a$11) { } - bb3: if (b$12) { + if (b$12) { } - bb5: if (c$13) { + if (c$13) { } - bb7: if (d$14) { + if (d$14) { } - bb9: if (y$16) { + if (y$16) { } mutate$8(x$15, null); diff --git a/compiler/forget/src/__tests__/fixtures/hir/mutable-liverange-loop.expect.md b/compiler/forget/src/__tests__/fixtures/hir/mutable-liverange-loop.expect.md index 4b6e9e6dff..cab058c48e 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/mutable-liverange-loop.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/mutable-liverange-loop.expect.md @@ -173,24 +173,24 @@ function Component$0(props$11) { const d$15 = {}; - bb2: while (true) { + while (true) { mutate$6(a$12, b$13); - bb4: if (cond$7(a$12)) { + if (cond$7(a$12)) { break; } } - bb7: if (a$12) { + if (a$12) { } - bb9: if (b$13) { + if (b$13) { } - bb11: if (c$14) { + if (c$14) { } - bb13: if (d$15) { + if (d$15) { } mutate$6(d$15, null); diff --git a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-interleaved-by-terminal.expect.md b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-interleaved-by-terminal.expect.md index 3ab4c7a018..50ec72a315 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-interleaved-by-terminal.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-interleaved-by-terminal.expect.md @@ -61,7 +61,7 @@ function foo$0(a$6, b$7, c$8) { const x$9 = []; const y$10 = []; - bb1: if (x$9) { + if (x$9) { } y$10.push(a$6); diff --git a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-shadowing-within-block.expect.md b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-shadowing-within-block.expect.md index deb85038e3..1c2a121eea 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-shadowing-within-block.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-shadowing-within-block.expect.md @@ -83,7 +83,7 @@ function foo$0(a$8, b$9, c$10) { if (c_0 || c_1 || c_2) { x$11 = []; - bb1: if (a$8) { + if (a$8) { const c_4 = $[4] !== b$9; const c_5 = $[5] !== c$10; let y$12; @@ -91,7 +91,7 @@ function foo$0(a$8, b$9, c$10) { if (c_4 || c_5) { y$12 = []; - bb3: if (b$9) { + if (b$9) { y$12.push(c$10); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-while.expect.md b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-while.expect.md index 0782dfb646..9969ac9b97 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-while.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-while.expect.md @@ -68,7 +68,7 @@ function foo$0(a$6, b$7, c$8) { const x$9 = []; const y$10 = []; - bb2: while (c$8) { + while (c$8) { y$10.push(b$7); x$9.push(a$6); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-within-block.expect.md b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-within-block.expect.md index 918ab87271..1bca98e145 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-within-block.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-within-block.expect.md @@ -75,10 +75,10 @@ function foo$0(a$6, b$7, c$8) { if (c_0 || c_1 || c_2) { x$9 = []; - bb1: if (a$6) { + if (a$6) { const y$10 = []; - bb3: if (b$7) { + if (b$7) { y$10.push(c$8); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes-if.expect.md index de75cfb57b..0933bb486b 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes-if.expect.md @@ -80,7 +80,7 @@ function foo$0(a$8, b$9, c$10) { if (c_0 || c_1 || c_2) { x$11 = []; - bb1: if (a$8) { + if (a$8) { const c_4 = $[4] !== b$9; let y$12; diff --git a/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes.expect.md b/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes.expect.md index e56d0ef294..66c819ef55 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/reactive-scopes.expect.md @@ -74,7 +74,7 @@ function f$0(a$8, b$9) { if (c_0 || c_1) { x$10 = []; - bb1: if (a$8.length === 1) { + if (a$8.length === 1) { if (b$9) { x$10.push(b$9); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/reassignment-conditional.expect.md b/compiler/forget/src/__tests__/fixtures/hir/reassignment-conditional.expect.md index 456b86ca40..003eec98b9 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/reassignment-conditional.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/reassignment-conditional.expect.md @@ -78,7 +78,7 @@ function Component$0(props$6) { x$7.push(props$6.p0); const y$8 = x$7; - bb1: if (props$6.p1) { + if (props$6.p1) { x$7 = []; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/reassignment-separate-scopes.expect.md b/compiler/forget/src/__tests__/fixtures/hir/reassignment-separate-scopes.expect.md index 7be4b3dc1e..ee81bf0ae9 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/reassignment-separate-scopes.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/reassignment-separate-scopes.expect.md @@ -125,7 +125,7 @@ function foo$0(a$13, b$14, c$15) { if (c_0) { x$16 = []; - bb1: if (a$13) { + if (a$13) { x$16.push(a$13); } diff --git a/compiler/forget/src/__tests__/fixtures/hir/simple.expect.md b/compiler/forget/src/__tests__/fixtures/hir/simple.expect.md index 571db14c1d..40c4671785 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/simple.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/simple.expect.md @@ -58,7 +58,7 @@ function foo( ```javascript function foo$0(x$8, y$9) { const $ = React.useMemoCache(); - bb1: if (x$8) { + if (x$8) { const c_0 = $[0] !== y$9; let t1$11; diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-call-jsx-2.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-call-jsx-2.expect.md index b48a0ca24b..b3897f97cc 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-call-jsx-2.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-call-jsx-2.expect.md @@ -109,7 +109,7 @@ function Component$0(props$10) { } else { } - bb1: if (foo$4()) { + if (foo$4()) { const c_2 = $[2] !== a$11; if (c_2) { diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-multiple-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-multiple-if.expect.md index 251a865728..96dd669d3b 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-multiple-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-multiple-if.expect.md @@ -80,11 +80,11 @@ function foo$0() { x$7 = 1; const y$8 = 2; - bb1: if (y$8 === 2) { + if (y$8 === 2) { x$7 = 3; } - bb3: if (y$8 === 3) { + if (y$8 === 3) { x$7 = 5; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-single-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-single-if.expect.md index e9abf6f090..0112c87c2e 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-single-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-complex-single-if.expect.md @@ -63,7 +63,7 @@ function foo$0() { x$5 = 1; const y$6 = 2; - bb1: if (y$6 === 2) { + if (y$6 === 2) { x$5 = 3; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-for-trivial-update.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-for-trivial-update.expect.md index 0ea3c97a07..296d569752 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-for-trivial-update.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-for-trivial-update.expect.md @@ -75,7 +75,7 @@ function foo$0() { if (true) { x$6 = 1; - bb2: for (const i$7 = 0; i$7 < 10; i$7) { + for (const i$7 = 0; i$7 < 10; i$7) { x$6 = x$6 + 1; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-for.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-for.expect.md index ad2dd961f9..6455540177 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-for.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-for.expect.md @@ -79,7 +79,7 @@ function foo$0() { if (true) { x$7 = 1; - bb2: for (let i$8 = 0; i$8 < 10; i$8 = i$8 + 1, i$8) { + for (let i$8 = 0; i$8 < 10; i$8 = i$8 + 1, i$8) { x$7 = x$7 + 1; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-if-else.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-if-else.expect.md index f7f1cfd83e..7142853232 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-if-else.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-if-else.expect.md @@ -58,7 +58,7 @@ function foo( function foo$0() { const x$5 = 1; const y$6 = 2; - bb1: if (y$6) { + if (y$6) { const z$7 = x$5 + y$6; } else { const z$8 = x$5; diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-multiple-phis.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-multiple-phis.expect.md index 337c975d75..d2b5b98747 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-multiple-phis.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-multiple-phis.expect.md @@ -119,8 +119,8 @@ function foo$0(a$9, b$10, c$11, d$12) { if (c_0 || c_1 || c_2 || c_3) { x$18 = undefined; - bb1: if (true) { - bb3: if (true) { + if (true) { + if (true) { x$18 = a$9; } else { x$18 = b$10; @@ -128,7 +128,7 @@ function foo$0(a$9, b$10, c$11, d$12) { x$18; } else { - bb7: if (true) { + if (true) { x$18 = c$11; } else { x$18 = d$12; diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-loops-no-reassign.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-loops-no-reassign.expect.md index bd8c08e4ed..12890207a8 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-loops-no-reassign.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-loops-no-reassign.expect.md @@ -87,9 +87,9 @@ function foo( ```javascript function foo$0(a$6, b$7, c$8) { const x$9 = 0; - bb2: while (a$6) { - bb5: while (b$7) { - bb8: while (c$8) { + while (a$6) { + while (b$7) { + while (c$8) { x$9 + 1; } } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-phi.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-phi.expect.md index 9569ead3ab..9f61e81e71 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-phi.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-phi.expect.md @@ -69,8 +69,8 @@ function foo$0(a$5, b$6, c$7) { if (c_0 || c_1 || c_2) { const x$8 = a$5; - bb1: if (b$6) { - bb3: if (c$7) { + if (b$6) { + if (c$7) { x$8 = c$7; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-reassignment.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-reassignment.expect.md index b4d860c119..9fba07f3f9 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-reassignment.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-reassignment.expect.md @@ -76,7 +76,7 @@ function foo$0(a$7, b$8, c$9, d$10, e$11) { if (c_0 || c_1 || c_2 || c_3) { x$12 = null; - bb1: if (a$7) { + if (a$7) { x$12 = b$8; } else { if (c$9) { diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-objectexpression-phi.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-objectexpression-phi.expect.md index 889383e0e9..28b34ee5e4 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-objectexpression-phi.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-objectexpression-phi.expect.md @@ -75,7 +75,7 @@ function foo$0() { x$6 = 1; let y$7 = 2; - bb1: if (x$6 > 1) { + if (x$6 > 1) { x$6 = 2; } else { y$7 = 3; diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-alias-mutate-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-alias-mutate-if.expect.md index 3f9eaa92ab..7cecf3a318 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-alias-mutate-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-alias-mutate-if.expect.md @@ -75,7 +75,7 @@ function foo$0(a$7) { const b$8 = {}; x$9 = b$8; - bb1: if (a$7) { + if (a$7) { const y$10 = {}; x$9.y = y$10; } else { diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-if.expect.md index d96b7ecf9a..b5f90a53d2 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-if.expect.md @@ -72,7 +72,7 @@ function foo$0(a$5) { if (c_0) { x$6 = {}; - bb1: if (a$5) { + if (a$5) { if (true) { const y$7 = {}; } else { diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-if.expect.md index b7c8647f0f..8f33db2205 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-if.expect.md @@ -71,7 +71,7 @@ function foo$0(a$6) { if (c_0) { x$7 = {}; - bb1: if (a$6) { + if (a$6) { const y$8 = {}; x$7.y = y$8; } else { diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-inside-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-inside-if.expect.md index eb7b304610..2e4f48973b 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-inside-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-inside-if.expect.md @@ -73,7 +73,7 @@ function foo$0(a$6) { if (c_0) { x$7 = {}; - bb1: if (a$6) { + if (a$6) { const y$8 = {}; x$7.y = y$8; mutate$4(y$8); diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-return.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-return.expect.md index 3e8133c3ef..b051310aef 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-return.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-return.expect.md @@ -57,7 +57,7 @@ function foo$0() { if (true) { x$4 = 1; - bb1: if (x$4 === 1) { + if (x$4 === 1) { x$4 = 2; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-shadowing.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-shadowing.expect.md index a408a6f2a8..37d03e4e23 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-shadowing.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-shadowing.expect.md @@ -92,7 +92,7 @@ function Foo$0(cond$5) { if (c_0) { str$6 = ""; - bb1: if (cond$5) { + if (cond$5) { const str$7 = "other test"; log$4(str$7); } else { diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-sibling-phis.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-sibling-phis.expect.md index 64c1323ae7..434fa4d7fc 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-sibling-phis.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-sibling-phis.expect.md @@ -115,7 +115,7 @@ function foo( function foo$0(a$9, b$10, c$11, d$12) { const $ = React.useMemoCache(); const x$13 = 0; - bb1: if (true) { + if (true) { const c_0 = $[0] !== a$9; const c_1 = $[1] !== b$10; let x$16; @@ -123,7 +123,7 @@ function foo$0(a$9, b$10, c$11, d$12) { if (c_0 || c_1) { x$16 = undefined; - bb3: if (true) { + if (true) { x$16 = a$9; } else { x$16 = b$10; @@ -145,7 +145,7 @@ function foo$0(a$9, b$10, c$11, d$12) { if (c_3 || c_4) { x$20 = undefined; - bb7: if (true) { + if (true) { x$20 = c$11; } else { x$20 = d$12; diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-simple-phi.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-simple-phi.expect.md index 89d4df4fba..4f3648a606 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-simple-phi.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-simple-phi.expect.md @@ -71,7 +71,7 @@ function foo$0() { if (true) { y$8 = undefined; - bb1: if (y$5 > 1) { + if (y$5 > 1) { y$8 = 1; } else { y$8 = 2; diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-single-if.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-single-if.expect.md index 5252950eab..9e0f53ebda 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-single-if.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-single-if.expect.md @@ -50,7 +50,7 @@ function foo( function foo$0() { const x$4 = 1; const y$5 = 2; - bb1: if (y$5) { + if (y$5) { const z$6 = x$4 + y$5; } } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-throw.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-throw.expect.md index a8ea84eaf4..74daa3b3b4 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-throw.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-throw.expect.md @@ -56,7 +56,7 @@ function foo$0() { if (true) { x$4 = 1; - bb1: if (x$4 === 1) { + if (x$4 === 1) { x$4 = 2; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-while-no-reassign.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-while-no-reassign.expect.md index 36641969a8..46eb7778de 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-while-no-reassign.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-while-no-reassign.expect.md @@ -58,7 +58,7 @@ function foo( ```javascript function foo$0() { const x$5 = 1; - bb2: while (x$5 < 10) { + while (x$5 < 10) { x$5 + 1; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/ssa-while.expect.md b/compiler/forget/src/__tests__/fixtures/hir/ssa-while.expect.md index 5d95ec44a5..7ca584a42b 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/ssa-while.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/ssa-while.expect.md @@ -64,7 +64,7 @@ function foo$0() { if (true) { x$5 = 1; - bb2: while (x$5 < 10) { + while (x$5 < 10) { x$5 = x$5 + 1; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/switch.expect.md b/compiler/forget/src/__tests__/fixtures/hir/switch.expect.md index e6caad23d1..9cf32c6749 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/switch.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/switch.expect.md @@ -103,7 +103,7 @@ function Component$0(props$8) { x$9 = []; let y$10 = undefined; - bb1: switch (props$8.p0) { + switch (props$8.p0) { case true: { x$9.push(props$8.p2); x$9.push(props$8.p3); diff --git a/compiler/forget/src/__tests__/fixtures/hir/type-args-test-binary-operator.expect.md b/compiler/forget/src/__tests__/fixtures/hir/type-args-test-binary-operator.expect.md index a8d5db67d8..12c1195d6c 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/type-args-test-binary-operator.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/type-args-test-binary-operator.expect.md @@ -47,7 +47,7 @@ function component( ```javascript function component$0(a$5, b$6) { - bb1: if (a$5 > b$6) { + if (a$5 > b$6) { if (true) { const m$8 = {}; } else { diff --git a/compiler/forget/src/__tests__/fixtures/hir/type-binary-operator.expect.md b/compiler/forget/src/__tests__/fixtures/hir/type-binary-operator.expect.md index 753ec5987a..b7cdd51d5e 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/type-binary-operator.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/type-binary-operator.expect.md @@ -73,7 +73,7 @@ function component$0() { b$8 = $[1]; } - bb1: if (a$7 > b$8) { + if (a$7 > b$8) { if (true) { const m$10 = {}; } else { diff --git a/compiler/forget/src/__tests__/fixtures/hir/type-test-field-load-binary-op.expect.md b/compiler/forget/src/__tests__/fixtures/hir/type-test-field-load-binary-op.expect.md index 7c330b5dc8..2ddc19a314 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/type-test-field-load-binary-op.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/type-test-field-load-binary-op.expect.md @@ -100,7 +100,7 @@ function component$0() { const u$13 = x$12.u; const v$14 = x$12.v; - bb1: if (u$13 > v$14) { + if (u$13 > v$14) { } const y$16 = x$12.u; diff --git a/compiler/forget/src/__tests__/fixtures/hir/type-test-return-type-inference.expect.md b/compiler/forget/src/__tests__/fixtures/hir/type-test-return-type-inference.expect.md index de4c0edc16..d47678cc17 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/type-test-return-type-inference.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/type-test-return-type-inference.expect.md @@ -79,7 +79,7 @@ function component$0() { y$8 = $[1]; } - bb1: if (x$7 > y$8) { + if (x$7 > y$8) { if (true) { const z$10 = {}; } else { diff --git a/compiler/forget/src/__tests__/fixtures/hir/while-break.expect.md b/compiler/forget/src/__tests__/fixtures/hir/while-break.expect.md index 3c7c61ca88..331ae1a636 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/while-break.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/while-break.expect.md @@ -45,7 +45,7 @@ function foo( ```javascript function foo$0(a$3, b$4) { - bb2: while (a$3) { + while (a$3) { break; } return b$4; diff --git a/compiler/forget/src/__tests__/fixtures/hir/while-conditional-continue.expect.md b/compiler/forget/src/__tests__/fixtures/hir/while-conditional-continue.expect.md index 7bd4f75fe4..121911b256 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/while-conditional-continue.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/while-conditional-continue.expect.md @@ -66,8 +66,8 @@ function foo( ```javascript function foo$0(a$5, b$6, c$7, d$8) { - bb2: while (a$5) { - bb4: if (b$6) { + while (a$5) { + if (b$6) { continue; } c$7(); diff --git a/compiler/forget/src/index.ts b/compiler/forget/src/index.ts index d19f065e26..20faed6542 100644 --- a/compiler/forget/src/index.ts +++ b/compiler/forget/src/index.ts @@ -40,6 +40,7 @@ import { leaveSSA } from "./HIR/LeaveSSA"; import printHIR, { printFunction } from "./HIR/PrintHIR"; import { printReactiveFunction } from "./HIR/PrintReactiveFunction"; import { propagateScopeDependencies } from "./HIR/PropagateScopeDependencies"; +import { pruneUnusedLabels } from "./HIR/PruneUnusedLabels"; function parseFunctions( source: string @@ -81,6 +82,7 @@ export const HIR = { printFunction, printHIR, printReactiveFunction, + pruneUnusedLabels, }; export default BabelPlugin;