protected override void EndImpl() { if (_test == null) { throw new InvalidOperationException("Loop condition has not been initialized"); } if (_iter != null) { if (_iterUsed) { G.IL.MarkLabel(_lbIter); } _iter.Emit(G); } G.IL.MarkLabel(_lbTest); var lbFalse = new OptionalLabel(G.IL); if (_endUsed) { lbFalse = _lbEnd; } Label?lbLoopCopy = _lbLoop; _test.EmitBranch(G, lbLoopCopy, lbFalse); if (lbFalse.IsLabelExist) { G.IL.MarkLabel(lbFalse.Value); } G.IsReachable = true; }
protected override void BeginImpl() { g.BeforeStatement(); lbLoop = g.il.DefineLabel(); lbTest = g.il.DefineLabel(); if (init != null) { init.Emit(g); } g.il.Emit(OpCodes.Br, lbTest); g.il.MarkLabel(lbLoop); }
protected override void BeginImpl() { G.BeforeStatement(); _lbLoop = G.IL.DefineLabel(); _lbTest = G.IL.DefineLabel(); if (_init != null) { _init.Emit(G); } G.IL.Emit(OpCodes.Br, _lbTest); G.IL.MarkLabel(_lbLoop); }
protected override void EndImpl() { if (iter != null) { if (iterUsed) { g.il.MarkLabel(lbIter); } iter.Emit(g); } g.il.MarkLabel(lbTest); test.EmitBranch(g, BranchSet.Normal, lbLoop); if (endUsed) { g.il.MarkLabel(lbEnd); } g.reachable = true; }
protected override void EndImpl() { if (_iter != null) { if (_iterUsed) { G.IL.MarkLabel(_lbIter); } _iter.Emit(G); } G.IL.MarkLabel(_lbTest); _test.EmitBranch(G, BranchSet.Normal, _lbLoop); if (_endUsed) { G.IL.MarkLabel(_lbEnd); } G._reachable = true; }