From a261d407443faa4a95ee8f2b0fbf5e8e046d17ca Mon Sep 17 00:00:00 2001 From: Son Ho Date: Fri, 28 Oct 2022 12:39:24 +0200 Subject: Move the AssignGlobal case from statement to rvalue --- compiler/Substitute.ml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'compiler/Substitute.ml') diff --git a/compiler/Substitute.ml b/compiler/Substitute.ml index 5e5858de..bc5febdc 100644 --- a/compiler/Substitute.ml +++ b/compiler/Substitute.ml @@ -233,6 +233,7 @@ let rvalue_substitute (tsubst : T.TypeVarId.id -> T.ety) (rv : E.rvalue) : | E.BinaryOp (binop, op1, op2) -> E.BinaryOp (binop, op_subst op1, op_subst op2) | E.Discriminant p -> E.Discriminant (p_subst p) + | E.Global _ -> (* Globals don't have type parameters *) rv | E.Aggregate (kind, ops) -> let ops = List.map op_subst ops in let kind = @@ -285,9 +286,6 @@ and raw_statement_substitute (tsubst : T.TypeVarId.id -> T.ety) let p = place_substitute tsubst p in let rvalue = rvalue_substitute tsubst rvalue in A.Assign (p, rvalue) - | A.AssignGlobal g -> - (* Globals don't have type parameters *) - A.AssignGlobal g | A.FakeRead p -> let p = place_substitute tsubst p in A.FakeRead p -- cgit v1.2.3