private BoundStatement RewriteSpillSequenceAsBlock(BoundSpillSequence spillSequence, BoundStatement value)
 {
     return(F.SpillBlock(
                spillSequence.Locals,
                spillSequence.SpillTemps,
                spillSequence.Statements.Append(value)));
 }
Example #2
0
 public override BoundNode VisitSpillSequence(BoundSpillSequence node)
 {
     AddAll(node.Locals);
     base.VisitSpillSequence(node);
     RemoveAll(node.Locals);
     return(null);
 }
        public override BoundNode VisitSpillSequence(BoundSpillSequence node)
        {
            ReadOnlyArray <BoundStatement> statements = this.VisitList(node.Statements);
            BoundExpression value = (BoundExpression)this.Visit(node.Value);
            TypeSymbol      type  = this.VisitType(node.Type);

            return(node.Update(node.Locals, node.SpillTemps, node.SpillFields, statements, value, type));
        }
Example #4
0
        public override BoundNode VisitSpillSequence(BoundSpillSequence node)
        {
            var builder = new BoundSpillSequenceBuilder();

            // Ensure later errors (e.g. in async rewriting) are associated with the correct node.
            _F.Syntax = node.Syntax;

            builder.AddStatements(VisitList(node.SideEffects));
            builder.AddLocals(node.Locals);
            var value = VisitExpression(ref builder, node.Value);

            return(builder.Update(value));
        }
        private BoundStatement RewriteSpillSequenceAsBlock(BoundSpillSequence spillSequence)
        {
            var awaitStatements = spillSequence.Statements;

            if (spillSequence.Value != null)
            {
                awaitStatements = awaitStatements.Append(F.ExpressionStatement(spillSequence.Value));
            }

            return(F.SpillBlock(
                       spillSequence.Locals,
                       spillSequence.SpillTemps,
                       awaitStatements));
        }
        public override BoundNode VisitSpillSequence(BoundSpillSequence node)
        {
            ReadOnlyArray <BoundStatement> statements = (ReadOnlyArray <BoundStatement>) this.VisitList(node.Statements);
            BoundExpression value = (BoundExpression)this.Visit(node.Value);
            TypeSymbol      type  = this.VisitType(node.Type);

            if (value.Kind != BoundKind.SpillSequence)
            {
                return(node.Update(node.Locals, node.SpillTemps, node.SpillFields, statements, value, type));
            }

            var valAwait = (BoundSpillSequence)value;

            return(node.Update(
                       node.Locals.Concat(valAwait.Locals),
                       node.SpillTemps.Concat(valAwait.SpillTemps),
                       node.SpillFields,
                       statements.Concat(valAwait.Statements),
                       valAwait.Value,
                       valAwait.Type));
        }
 private static BoundSpillSequence RewriteSpillSequence(BoundSpillSequence spill, BoundExpression value)
 {
     return(spill.Update(spill.Locals, spill.SpillTemps, spill.SpillFields, spill.Statements, value, value.Type));
 }
Example #8
0
 internal void AddSpill(BoundSpillSequence spill)
 {
     locals.AddRange(spill.Locals);
     temps.AddRange(spill.SpillTemps);
     statements.AddRange(spill.Statements);
 }
 public override BoundNode VisitSpillSequence(BoundSpillSequence node)
 {
     throw Contract.Unreachable;
 }
        private BoundNode SpillAssignmentOperator(BoundAssignmentOperator node, BoundExpression left, BoundSpillSequence right)
        {
            var spillBuilder    = new SpillBuilder();
            var spilledLeftNode = SpillLValue(left, spillBuilder);
            var innerSpill      = node.Update(spilledLeftNode, right.Value, node.RefKind, node.Type);

            spillBuilder.AddSpill(right);
            return(spillBuilder.BuildSequenceAndFree(F, innerSpill));
        }