1 write to _F
Microsoft.CodeAnalysis.CSharp (1)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (1)
39
_F
= factory;
140 references to _F
Microsoft.CodeAnalysis.CSharp (140)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (140)
40
_F
.CurrentFunction = containingMethod;
163
result =
_F
.Block(
165
_F
.Throw(
_F
.Null(
_F
.SpecialType(SpecialType.System_Object)))
179
var oldTrySyntax =
_F
.Syntax;
180
_F
.Syntax = tryStatementSyntax;
184
_F
.Syntax = oldTrySyntax;
213
return
_F
.Try((BoundBlock)finalizedRegion, ImmutableArray<BoundCatchBlock>.Empty, rewrittenFinally);
223
var exceptionType =
_F
.SpecialType(SpecialType.System_Object);
224
var pendingExceptionLocal = new SynthesizedLocal(
_F
.CurrentFunction, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax);
225
var finallyLabel =
_F
.GenerateLabel("finallyLabel");
226
var pendingBranchVar = new SynthesizedLocal(
_F
.CurrentFunction, TypeWithAnnotations.Create(
_F
.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax);
228
var catchAll =
_F
.Catch(
_F
.Local(pendingExceptionLocal),
_F
.Block());
230
var catchAndPendException =
_F
.Try(
231
_F
.Block(
233
_F
.HiddenSequencePoint(),
234
_F
.Goto(finallyLabel),
239
BoundBlock syntheticFinallyBlock =
_F
.Block(
240
_F
.HiddenSequencePoint(),
241
_F
.Label(finallyLabel),
243
_F
.HiddenSequencePoint(),
250
if (
_F
.CurrentFunction.IsAsync &&
_F
.CurrentFunction.IsIterator)
253
syntheticFinally =
_F
.ExtractedFinallyBlock(syntheticFinallyBlock);
259
statements.Add(
_F
.HiddenSequencePoint());
262
statements.Add(
_F
.Assignment(
_F
.Local(pendingExceptionLocal),
_F
.Default(pendingExceptionLocal.Type)));
264
statements.Add(
_F
.Assignment(
_F
.Local(pendingBranchVar),
_F
.Default(pendingBranchVar.Type)));
275
var completeTry =
_F
.Block(
313
return
_F
.Block(bodyStatements.ToImmutableAndFree());
324
bodyStatements.Add(
_F
.Label(proxy));
327
bodyStatements.Add(
_F
.Assignment(
_F
.Local(pendingBranchVar),
_F
.Literal(i)));
330
bodyStatements.Add(
_F
.Goto(finallyLabel));
352
var caseStatement =
_F
.SwitchSection(i,
_F
.Goto(parentProxy));
362
pendingValue =
_F
.Local(frame.returnValue);
368
var returnLabel = parent.ProxyReturnIfNeeded(
_F
.CurrentFunction, pendingValue, out returnValue);
372
unpendReturn = new BoundReturnStatement(
_F
.Syntax, RefKind.None, pendingValue, @checked: false);
378
unpendReturn =
_F
.Goto(returnLabel);
382
unpendReturn =
_F
.Block(
383
_F
.Assignment(
384
_F
.Local(returnValue),
386
_F
.Goto(returnLabel));
390
var caseStatement =
_F
.SwitchSection(i, unpendReturn);
395
return
_F
.Switch(
_F
.Local(pendingBranchVar), cases.ToImmutableAndFree());
416
_F
.CurrentFunction,
428
return
_F
.Block(
429
_F
.Assignment(
430
_F
.Local(returnValue),
432
_F
.Goto(
437
return
_F
.Goto(returnLabel);
445
if (
_F
.Compilation.IsRuntimeAsyncEnabledIn(
_F
.CurrentFunction))
454
LocalSymbol obj =
_F
.SynthesizedLocal(
_F
.SpecialType(SpecialType.System_Object));
455
var objInit =
_F
.Assignment(
_F
.Local(obj),
_F
.Local(pendingExceptionLocal));
458
return
_F
.Block(
467
BoundStatement checkAndThrow =
_F
.If(
468
_F
.ObjectNotEqual(
469
_F
.Local(obj),
470
_F
.Null(obj.Type)),
479
BoundStatement rethrow =
_F
.Throw(
_F
.Local(obj));
481
var exceptionDispatchInfoCapture =
_F
.WellKnownMethod(WellKnownMember.System_Runtime_ExceptionServices_ExceptionDispatchInfo__Capture, isOptional: true);
482
var exceptionDispatchInfoThrow =
_F
.WellKnownMethod(WellKnownMember.System_Runtime_ExceptionServices_ExceptionDispatchInfo__Throw, isOptional: true);
488
var ex =
_F
.SynthesizedLocal(
_F
.WellKnownType(WellKnownType.System_Exception));
489
var assignment =
_F
.Assignment(
490
_F
.Local(ex),
491
_F
.As(
_F
.Local(obj), ex.Type));
494
rethrow =
_F
.Block(
497
_F
.If(
_F
.ObjectEqual(
_F
.Local(ex),
_F
.Null(ex.Type)), rethrow),
499
_F
.ExpressionStatement(
500
_F
.Call(
501
_F
.StaticCall(
504
_F
.Local(ex)),
534
BoundStatement tryWithCatches =
_F
.Try(rewrittenTry, rewrittenCatches);
539
var handledLabel =
_F
.GenerateLabel("handled");
544
handlers.Add(
_F
.SwitchSection(
546
_F
.Block(
548
_F
.Goto(handledLabel))));
551
tryWithCatches =
_F
.Block(
556
_F
.HiddenSequencePoint(),
557
_F
.Assignment(
558
_F
.Local(currentAwaitCatchFrame.pendingCatch),
559
_F
.Default(currentAwaitCatchFrame.pendingCatch.Type)),
561
_F
.HiddenSequencePoint(),
562
_F
.Switch(
563
_F
.Local(currentAwaitCatchFrame.pendingCatch),
565
_F
.HiddenSequencePoint(),
566
_F
.Label(handledLabel));
611
currentAwaitCatchFrame = _currentAwaitCatchFrame = new AwaitCatchFrame(
_F
, tryStatementSyntax, parentAwaitCatchFrame);
614
var catchType = node.ExceptionTypeOpt ??
_F
.SpecialType(SpecialType.System_Object);
615
var catchTemp =
_F
.SynthesizedLocal(catchType);
617
var storePending =
_F
.AssignmentExpression(
618
_F
.Local(currentAwaitCatchFrame.pendingCaughtException),
619
_F
.Convert(currentAwaitCatchFrame.pendingCaughtException.Type,
620
_F
.Local(catchTemp)));
622
var setPendingCatchNum =
_F
.Assignment(
623
_F
.Local(currentAwaitCatchFrame.pendingCatch),
624
_F
.Literal(currentAwaitCatchFrame.handlers.Count + 1));
643
_F
.Local(catchTemp),
647
body:
_F
.Block(
648
_F
.HiddenSequencePoint(),
649
_F
.ExpressionStatement(storePending),
664
currentAwaitCatchFrame.HoistLocal(local,
_F
);
673
prologueBuilder.Add(
_F
.ExpressionStatement(storePending));
676
prologueBuilder.Add(
_F
.ExpressionStatement(AssignCatchSource((BoundExpression)this.Visit(sourceOpt), currentAwaitCatchFrame)));
683
var newPrologue =
_F
.StatementList(prologueBuilder.ToImmutableAndFree());
689
_F
.Local(catchTemp),
693
body:
_F
.Block(
694
_F
.HiddenSequencePoint(),
701
handlerStatements.Add(
_F
.HiddenSequencePoint());
709
handlerStatements.Add(
_F
.ExpressionStatement(assignSource));
715
var handler =
_F
.Block(
731
assignSource =
_F
.AssignmentExpression(
733
_F
.Convert(
735
_F
.Local(currentAwaitCatchFrame.pendingCaughtException)));
767
var oldContainingSymbol =
_F
.CurrentFunction;
771
_F
.CurrentFunction = node.Symbol;
784
_F
.CurrentFunction = oldContainingSymbol;
793
var oldContainingSymbol =
_F
.CurrentFunction;
797
_F
.CurrentFunction = node.Symbol;
804
_F
.CurrentFunction = oldContainingSymbol;