EmitBranch() protected method

protected EmitBranch ( CodeGen g, OptionalLabel labelTrue, OptionalLabel labelFalse ) : void
g CodeGen
labelTrue OptionalLabel
labelFalse OptionalLabel
return void
            protected override void BeginImpl()
            {
                g.BeforeStatement();

                lbSkip = g.il.DefineLabel();
                condition.EmitBranch(g, BranchSet.Inverse, lbSkip);
            }
Esempio n. 2
0
            protected override void BeginImpl()
            {
                G.BeforeStatement();

                _lbSkip = G.IL.DefineLabel();
                _condition.EmitBranch(G, BranchSet.Inverse, _lbSkip);
            }
            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();

                _lbSkip  = G.IL.DefineLabel();
                _lbBegin = new OptionalLabel(G.IL);
                _condition.EmitBranch(G, _lbBegin, _lbSkip);
                if (_lbBegin.IsLabelExist)
                {
                    G.IL.MarkLabel(_lbBegin.Value);
                }
            }
            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;
            }
Esempio n. 6
0
            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;
            }
Esempio n. 7
0
 protected internal override void EmitBranch(CodeGen g, OptionalLabel labelTrue, OptionalLabel labelFalse)
 {
     OperandExtensions.SetLeakedState(this, false);
     _operand.EmitBranch(g, labelTrue, labelFalse);
 }