Exemplo n.º 1
0
        public override void EmitStatement(EmitContext ec)
        {
            if (resolved == null)
            {
                return;
            }

            //
            // Emit sequence symbol info even if we are in compiler generated
            // block to allow debugging field initializers when constructor is
            // compiler generated
            //
            if (ec.HasSet(BuilderContext.Options.OmitDebugInfo) && ec.HasMethodSymbolBuilder)
            {
                using (ec.With(BuilderContext.Options.OmitDebugInfo, false)) {
                    ec.Mark(loc);
                }
            }

            if (resolved != this)
            {
                resolved.EmitStatement(ec);
            }
            else
            {
                base.EmitStatement(ec);
            }
        }
Exemplo n.º 2
0
        protected override void DoEmit(EmitContext ec)
        {
            if (statement != null)
            {
                statement.EmitStatement(ec);
                if (unwind_protect)
                {
                    ec.Emit(OpCodes.Leave, ec.CreateReturnLabel());
                }
                else
                {
                    ec.Emit(OpCodes.Ret);
                }
                return;
            }

            base.DoEmit(ec);
        }