1 write to _F
Microsoft.CodeAnalysis.CSharp (1)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (1)
38
_F
= factory;
134 references to _F
Microsoft.CodeAnalysis.CSharp (134)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (134)
39
_F
.CurrentFunction = containingMethod;
142
var oldTrySyntax =
_F
.Syntax;
143
_F
.Syntax = tryStatementSyntax;
147
_F
.Syntax = oldTrySyntax;
176
return
_F
.Try((BoundBlock)finalizedRegion, ImmutableArray<BoundCatchBlock>.Empty, rewrittenFinally);
186
var exceptionType =
_F
.SpecialType(SpecialType.System_Object);
187
var pendingExceptionLocal = new SynthesizedLocal(
_F
.CurrentFunction, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax);
188
var finallyLabel =
_F
.GenerateLabel("finallyLabel");
189
var pendingBranchVar = new SynthesizedLocal(
_F
.CurrentFunction, TypeWithAnnotations.Create(
_F
.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax);
191
var catchAll =
_F
.Catch(
_F
.Local(pendingExceptionLocal),
_F
.Block());
193
var catchAndPendException =
_F
.Try(
194
_F
.Block(
196
_F
.HiddenSequencePoint(),
197
_F
.Goto(finallyLabel),
202
BoundBlock syntheticFinallyBlock =
_F
.Block(
203
_F
.HiddenSequencePoint(),
204
_F
.Label(finallyLabel),
206
_F
.HiddenSequencePoint(),
213
if (
_F
.CurrentFunction.IsAsync &&
_F
.CurrentFunction.IsIterator)
216
syntheticFinally =
_F
.ExtractedFinallyBlock(syntheticFinallyBlock);
222
statements.Add(
_F
.HiddenSequencePoint());
225
statements.Add(
_F
.Assignment(
_F
.Local(pendingExceptionLocal),
_F
.Default(pendingExceptionLocal.Type)));
227
statements.Add(
_F
.Assignment(
_F
.Local(pendingBranchVar),
_F
.Default(pendingBranchVar.Type)));
238
var completeTry =
_F
.Block(
276
return
_F
.Block(bodyStatements.ToImmutableAndFree());
287
bodyStatements.Add(
_F
.Label(proxy));
290
bodyStatements.Add(
_F
.Assignment(
_F
.Local(pendingBranchVar),
_F
.Literal(i)));
293
bodyStatements.Add(
_F
.Goto(finallyLabel));
315
var caseStatement =
_F
.SwitchSection(i,
_F
.Goto(parentProxy));
325
pendingValue =
_F
.Local(frame.returnValue);
331
var returnLabel = parent.ProxyReturnIfNeeded(
_F
.CurrentFunction, pendingValue, out returnValue);
335
unpendReturn = new BoundReturnStatement(
_F
.Syntax, RefKind.None, pendingValue, @checked: false);
341
unpendReturn =
_F
.Goto(returnLabel);
345
unpendReturn =
_F
.Block(
346
_F
.Assignment(
347
_F
.Local(returnValue),
349
_F
.Goto(returnLabel));
353
var caseStatement =
_F
.SwitchSection(i, unpendReturn);
357
return
_F
.Switch(
_F
.Local(pendingBranchVar), cases.ToImmutableAndFree());
378
_F
.CurrentFunction,
390
return
_F
.Block(
391
_F
.Assignment(
392
_F
.Local(returnValue),
394
_F
.Goto(
399
return
_F
.Goto(returnLabel);
407
LocalSymbol obj =
_F
.SynthesizedLocal(
_F
.SpecialType(SpecialType.System_Object));
408
var objInit =
_F
.Assignment(
_F
.Local(obj),
_F
.Local(pendingExceptionLocal));
413
return
_F
.Block(
416
_F
.If(
417
_F
.ObjectNotEqual(
418
_F
.Local(obj),
419
_F
.Null(obj.Type)),
426
BoundStatement rethrow =
_F
.Throw(
_F
.Local(obj));
428
var exceptionDispatchInfoCapture =
_F
.WellKnownMethod(WellKnownMember.System_Runtime_ExceptionServices_ExceptionDispatchInfo__Capture, isOptional: true);
429
var exceptionDispatchInfoThrow =
_F
.WellKnownMethod(WellKnownMember.System_Runtime_ExceptionServices_ExceptionDispatchInfo__Throw, isOptional: true);
435
var ex =
_F
.SynthesizedLocal(
_F
.WellKnownType(WellKnownType.System_Exception));
436
var assignment =
_F
.Assignment(
437
_F
.Local(ex),
438
_F
.As(
_F
.Local(obj), ex.Type));
441
rethrow =
_F
.Block(
444
_F
.If(
_F
.ObjectEqual(
_F
.Local(ex),
_F
.Null(ex.Type)), rethrow),
446
_F
.ExpressionStatement(
447
_F
.Call(
448
_F
.StaticCall(
451
_F
.Local(ex)),
481
BoundStatement tryWithCatches =
_F
.Try(rewrittenTry, rewrittenCatches);
486
var handledLabel =
_F
.GenerateLabel("handled");
491
handlers.Add(
_F
.SwitchSection(
493
_F
.Block(
495
_F
.Goto(handledLabel))));
498
tryWithCatches =
_F
.Block(
503
_F
.HiddenSequencePoint(),
504
_F
.Assignment(
505
_F
.Local(currentAwaitCatchFrame.pendingCatch),
506
_F
.Default(currentAwaitCatchFrame.pendingCatch.Type)),
508
_F
.HiddenSequencePoint(),
509
_F
.Switch(
510
_F
.Local(currentAwaitCatchFrame.pendingCatch),
512
_F
.HiddenSequencePoint(),
513
_F
.Label(handledLabel));
551
currentAwaitCatchFrame = _currentAwaitCatchFrame = new AwaitCatchFrame(
_F
, tryStatementSyntax, parentAwaitCatchFrame);
554
var catchType = node.ExceptionTypeOpt ??
_F
.SpecialType(SpecialType.System_Object);
555
var catchTemp =
_F
.SynthesizedLocal(catchType);
557
var storePending =
_F
.AssignmentExpression(
558
_F
.Local(currentAwaitCatchFrame.pendingCaughtException),
559
_F
.Convert(currentAwaitCatchFrame.pendingCaughtException.Type,
560
_F
.Local(catchTemp)));
562
var setPendingCatchNum =
_F
.Assignment(
563
_F
.Local(currentAwaitCatchFrame.pendingCatch),
564
_F
.Literal(currentAwaitCatchFrame.handlers.Count + 1));
583
_F
.Local(catchTemp),
587
body:
_F
.Block(
588
_F
.HiddenSequencePoint(),
589
_F
.ExpressionStatement(storePending),
604
currentAwaitCatchFrame.HoistLocal(local,
_F
);
613
prologueBuilder.Add(
_F
.ExpressionStatement(storePending));
616
prologueBuilder.Add(
_F
.ExpressionStatement(AssignCatchSource((BoundExpression)this.Visit(sourceOpt), currentAwaitCatchFrame)));
623
var newPrologue =
_F
.StatementList(prologueBuilder.ToImmutableAndFree());
629
_F
.Local(catchTemp),
633
body:
_F
.Block(
634
_F
.HiddenSequencePoint(),
641
handlerStatements.Add(
_F
.HiddenSequencePoint());
649
handlerStatements.Add(
_F
.ExpressionStatement(assignSource));
655
var handler =
_F
.Block(
671
assignSource =
_F
.AssignmentExpression(
673
_F
.Convert(
675
_F
.Local(currentAwaitCatchFrame.pendingCaughtException)));
707
var oldContainingSymbol =
_F
.CurrentFunction;
710
_F
.CurrentFunction = node.Symbol;
715
_F
.CurrentFunction = oldContainingSymbol;
723
var oldContainingSymbol =
_F
.CurrentFunction;
726
_F
.CurrentFunction = node.Symbol;
731
_F
.CurrentFunction = oldContainingSymbol;