From 7d4373031930622ede219de532cc7ad8fe2479ec Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 22 Mar 2023 14:36:49 -0700 Subject: [PATCH] [be] Remove stale global handling code I forgot to remove this when i made globals explicit. --- .../src/Inference/InferReferenceEffects.ts | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/compiler/forget/src/Inference/InferReferenceEffects.ts b/compiler/forget/src/Inference/InferReferenceEffects.ts index 4ce8b283ff..2ee5516aa3 100644 --- a/compiler/forget/src/Inference/InferReferenceEffects.ts +++ b/compiler/forget/src/Inference/InferReferenceEffects.ts @@ -689,7 +689,6 @@ function inferBlock( state.isDefined(instrValue.receiver), "[InferReferenceEffects] Internal error: receiver of PropertyCall should have been defined by corresponding PropertyLoad" ); - state.reference(instrValue.property, Effect.Read); const signature = getFunctionCallSignature( @@ -744,17 +743,6 @@ function inferBlock( break; } case "PropertyLoad": { - if (!state.isDefined(instrValue.object)) { - // TODO @josephsavona: improve handling of globals - const value: InstructionValue = { - kind: "Primitive", - loc: instrValue.loc, - value: undefined, - }; - state.initialize(value, ValueKind.Frozen); - state.define(instrValue.object, value); - } - state.reference(instrValue.object, Effect.Read); const lvalue = instr.lvalue; lvalue.effect = Effect.Mutate; @@ -784,17 +772,6 @@ function inferBlock( continue; } case "ComputedLoad": { - if (!state.isDefined(instrValue.object)) { - // TODO @josephsavona: improve handling of globals - const value: InstructionValue = { - kind: "Primitive", - loc: instrValue.loc, - value: undefined, - }; - state.initialize(value, ValueKind.Frozen); - state.define(instrValue.object, value); - } - state.reference(instrValue.object, Effect.Read); state.reference(instrValue.property, Effect.Read); const lvalue = instr.lvalue;