@@ -847,14 +847,14 @@ and IlxGenEnv =
847847 withinSEH: bool
848848
849849 /// Are we inside of a recursive let binding, while loop, or a for loop?
850- inLoop : bool
850+ isInLoop : bool
851851 }
852852
853853 override __.ToString () = " <IlxGenEnv>"
854854
855- let SetInLoop inLoop eenv =
856- if eenv.inLoop = inLoop then eenv
857- else { eenv with inLoop = inLoop }
855+ let SetIsInLoop isInLoop eenv =
856+ if eenv.isInLoop = isInLoop then eenv
857+ else { eenv with isInLoop = isInLoop }
858858
859859let ReplaceTyenv tyenv ( eenv : IlxGenEnv ) = { eenv with tyenv = tyenv }
860860
@@ -1911,9 +1911,9 @@ let CodeGenThen cenv mgbuf (entryPointInfo, methodName, eenv, alreadyUsedArgs, c
19111911 let innerVals = entryPointInfo |> List.map ( fun ( v , kind ) -> ( v, ( kind, start)))
19121912
19131913 (* Call the given code generator *)
1914- codeGenFunction cgbuf { eenv with withinSEH = false
1915- liveLocals = IntMap.empty()
1916- innerVals = innerVals }
1914+ codeGenFunction cgbuf { eenv with withinSEH= false
1915+ liveLocals= IntMap.empty()
1916+ innerVals = innerVals}
19171917
19181918 let locals , maxStack , lab2pc , code , exnSpecs , hasSequencePoints = cgbuf.Close()
19191919
@@ -3535,7 +3535,7 @@ and GenTryFinally cenv cgbuf eenv (bodyExpr, handlerExpr, m, resty, spTry, spFin
35353535//--------------------------------------------------------------------------
35363536
35373537and GenForLoop cenv cgbuf eenv ( spFor , v , e1 , dir , e2 , loopBody , m ) sequel =
3538- let eenv = SetInLoop true eenv
3538+ let eenv = SetIsInLoop true eenv
35393539 let g = cenv.g
35403540
35413541 // The JIT/NGen eliminate array-bounds checks for C# loops of form:
@@ -3626,7 +3626,7 @@ and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel =
36263626//--------------------------------------------------------------------------
36273627
36283628and GenWhileLoop cenv cgbuf eenv ( spWhile , e1 , e2 , m ) sequel =
3629- let eenv = SetInLoop true eenv
3629+ let eenv = SetIsInLoop true eenv
36303630 let finish = CG.GenerateDelayMark cgbuf " while_finish"
36313631 let startTest = CG.GenerateMark cgbuf " startTest"
36323632
@@ -5193,7 +5193,7 @@ and GenLetRecFixup cenv cgbuf eenv (ilxCloSpec: IlxClosureSpec, e, ilField: ILFi
51935193
51945194/// Generate letrec bindings
51955195and GenLetRecBindings cenv ( cgbuf : CodeGenBuffer ) eenv ( allBinds : Bindings , m ) =
5196- let eenv = SetInLoop true eenv
5196+ let eenv = SetIsInLoop true eenv
51975197 // Fix up recursion for non-toplevel recursive bindings
51985198 let bindsPossiblyRequiringFixup =
51995199 allBinds |> List.filter ( fun b ->
@@ -5443,7 +5443,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec, rhsExpr, _)) s
54435443 let storage = StorageForVal cenv.g m vspec eenv
54445444 match storage, rhsExpr with
54455445 // locals are zero-init, no need to initialize them, except if you are in a loop and the local is mutable.
5446- | Local (_, realloc, _), Expr.Const ( Const.Zero, _, _) when not realloc && not ( eenv.inLoop && vspec.IsMutable) ->
5446+ | Local (_, realloc, _), Expr.Const ( Const.Zero, _, _) when not realloc && not ( eenv.isInLoop && vspec.IsMutable) ->
54475447 CommitStartScope cgbuf startScopeMarkOpt
54485448 | _ ->
54495449 GenBindingRhs cenv cgbuf eenv SPSuppress vspec rhsExpr
@@ -7578,7 +7578,7 @@ let GetEmptyIlxGenEnv (ilg: ILGlobals) ccu =
75787578 innerVals = []
75797579 sigToImplRemapInfo = [] (* "module remap info" *)
75807580 withinSEH = false
7581- inLoop = false }
7581+ isInLoop = false }
75827582
75837583type IlxGenResults =
75847584 { ilTypeDefs: ILTypeDef list
0 commit comments