From 60137a8b6436df4eb6f2379cc90756a545b45134 Mon Sep 17 00:00:00 2001 From: mofeiZ <34200447+mofeiZ@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:04:38 -0500 Subject: [PATCH] [rhir][cleanup] remove DeclKind (replaced by pruneNonReactiveDependencies) DeclKind is no longer read / needed due to pruneNonReactiveDependencies pass. --- .../src/ReactiveScopes/PropagateScopeDependencies.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts b/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts index eddad56535..556ace5e92 100644 --- a/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts +++ b/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts @@ -34,14 +34,12 @@ export function propagateScopeDependencies(fn: ReactiveFunction): void { const context = new Context(); if (fn.id !== null) { context.declare(fn.id, { - kind: DeclKind.Const, id: makeInstructionId(0), scope: null, }); } for (const param of fn.params) { context.declare(param.identifier, { - kind: DeclKind.Dynamic, id: makeInstructionId(0), scope: null, }); @@ -49,14 +47,8 @@ export function propagateScopeDependencies(fn: ReactiveFunction): void { visit(context, fn.body); } -enum DeclKind { - Const = "Const", - Dynamic = "Dynamic", -} - type DeclMap = Map; type Decl = { - kind: DeclKind; id: InstructionId; scope: ReactiveScope | null; }; @@ -193,7 +185,6 @@ class Context { if ( currentScope != null && currentDeclaration !== undefined && - currentDeclaration.kind !== DeclKind.Const && currentDeclaration.id < currentScope.range.start && (currentDeclaration.scope == null || !this.#isScopeActive(currentDeclaration.scope)) @@ -402,7 +393,6 @@ function visitInstruction(context: Context, instr: ReactiveInstruction): void { context.visitReassignment(lvalue); } context.declare(lvalue.place.identifier, { - kind: DeclKind.Dynamic, id: instr.id, scope: context.currentScope, });