private static BoundStatement ConstructDirectNullCheck(ParameterSymbol parameter, SyntheticBoundNodeFactory factory) { BoundExpression paramIsNullCondition; var loweredLeft = factory.Parameter(parameter); if (loweredLeft.Type.IsNullableType()) { paramIsNullCondition = factory.Not(factory.MakeNullableHasValue(loweredLeft.Syntax, loweredLeft)); } else { // Examples of how we might get here: // int* // delegate*<...> // T where T : int? (via some indirection) Debug.Assert(parameter.Type.IsPointerOrFunctionPointer() || (parameter.Type.IsNullableTypeOrTypeParameter() && !parameter.Type.IsNullableType())); paramIsNullCondition = factory.MakeNullCheck(loweredLeft.Syntax, loweredLeft, BinaryOperatorKind.Equal); } var argumentName = ImmutableArray.Create <BoundExpression>(factory.StringLiteral(parameter.Name)); BoundObjectCreationExpression ex = factory.New(factory.WellKnownMethod(WellKnownMember.System_ArgumentNullException__ctorString), argumentName); BoundThrowStatement throwArgNullStatement = factory.Throw(ex); return(factory.HiddenSequencePoint(factory.If(paramIsNullCondition, throwArgNullStatement))); }
public virtual BoundStatement InstrumentThrowStatement( BoundThrowStatement original, BoundStatement rewritten ) { return(InstrumentStatement(original, rewritten)); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { BoundSpillSequenceBuilder builder = null; BoundExpression expression = VisitExpression(ref builder, node.ExpressionOpt); return(UpdateStatement(builder, node.Update(expression))); }
public override BoundStatement InstrumentThrowStatement( BoundThrowStatement original, BoundStatement rewritten ) { return(Previous.InstrumentThrowStatement(original, rewritten)); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { if (node.ExpressionOpt != null || _currentAwaitCatchFrame == null) { return(base.VisitThrowStatement(node)); } return(Rethrow(_currentAwaitCatchFrame.pendingCaughtException)); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { EnterStatement(node); BoundSpillSequenceBuilder builder = null; BoundExpression expression = VisitExpression(ref builder, node.ExpressionOpt); return(UpdateStatement(builder, node.Update(expression), substituteTemps: true)); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { var result = (BoundStatement)base.VisitThrowStatement(node); if (this.Instrument && !node.WasCompilerGenerated) { result = _instrumenter.InstrumentThrowStatement(node, result); } return result; }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { var result = (BoundStatement)base.VisitThrowStatement(node); if (this.Instrument && !node.WasCompilerGenerated) { result = _instrumenter.InstrumentThrowStatement(node, result); } return(result); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { BoundExpression expressionOpt = (BoundExpression)this.Visit(node.ExpressionOpt); if (expressionOpt == null || expressionOpt.Kind != BoundKind.SpillSequence) { return(node.Update(expressionOpt)); } var spill = (BoundSpillSequence)expressionOpt; return(RewriteSpillSequenceAsBlock(spill, node.Update(spill.Value))); }
public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) { return Previous.InstrumentThrowStatement(original, rewritten); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { BoundSpillSequence2 ss = null; BoundExpression expression = VisitExpression(ref ss, node.ExpressionOpt); return UpdateStatement(ss, node.Update(expression)); }
public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) { return(AddSequencePoint(base.InstrumentThrowStatement(original, rewritten))); }
public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) { return(AddDynamicAnalysis(original, base.InstrumentThrowStatement(original, rewritten))); }
public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) { return AddSequencePoint(base.InstrumentThrowStatement(original, rewritten)); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { if (node.ExpressionOpt != null || _currentAwaitCatchFrame == null) { return base.VisitThrowStatement(node); } return Rethrow(_currentAwaitCatchFrame.pendingCaughtException); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { BoundExpression expressionOpt = (BoundExpression)this.Visit(node.ExpressionOpt); if (expressionOpt == null || expressionOpt.Kind != BoundKind.SpillSequence) { return node.Update(expressionOpt); } var spill = (BoundSpillSequence)expressionOpt; return RewriteSpillSequenceAsBlock(spill, node.Update(spill.Value)); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { return(AddSequencePoint((BoundStatement)base.VisitThrowStatement(node))); }
public override BoundNode VisitThrowStatement(BoundThrowStatement node) { return AddSequencePoint((BoundStatement)base.VisitThrowStatement(node)); }
public virtual BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) { return InstrumentStatement(original, rewritten); }
public override BoundStatement InstrumentThrowStatement(BoundThrowStatement original, BoundStatement rewritten) { return AddDynamicAnalysis(original, base.InstrumentThrowStatement(original, rewritten)); }