1 write to _F
Microsoft.CodeAnalysis.CSharp (1)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (1)
36
_F
= factory;
131 references to _F
Microsoft.CodeAnalysis.CSharp (131)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (131)
37
_F
.CurrentFunction = containingMethod;
164
return
_F
.Try((BoundBlock)finalizedRegion, ImmutableArray<BoundCatchBlock>.Empty, rewrittenFinally);
174
var exceptionType =
_F
.SpecialType(SpecialType.System_Object);
175
var pendingExceptionLocal = new SynthesizedLocal(
_F
.CurrentFunction, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax);
176
var finallyLabel =
_F
.GenerateLabel("finallyLabel");
177
var pendingBranchVar = new SynthesizedLocal(
_F
.CurrentFunction, TypeWithAnnotations.Create(
_F
.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax);
179
var catchAll =
_F
.Catch(
_F
.Local(pendingExceptionLocal),
_F
.Block());
181
var catchAndPendException =
_F
.Try(
182
_F
.Block(
184
_F
.HiddenSequencePoint(),
185
_F
.Goto(finallyLabel),
190
BoundBlock syntheticFinallyBlock =
_F
.Block(
191
_F
.HiddenSequencePoint(),
192
_F
.Label(finallyLabel),
194
_F
.HiddenSequencePoint(),
201
if (
_F
.CurrentFunction.IsAsync &&
_F
.CurrentFunction.IsIterator)
204
syntheticFinally =
_F
.ExtractedFinallyBlock(syntheticFinallyBlock);
210
statements.Add(
_F
.HiddenSequencePoint());
213
statements.Add(
_F
.Assignment(
_F
.Local(pendingExceptionLocal),
_F
.Default(pendingExceptionLocal.Type)));
215
statements.Add(
_F
.Assignment(
_F
.Local(pendingBranchVar),
_F
.Default(pendingBranchVar.Type)));
226
var completeTry =
_F
.Block(
263
return
_F
.Block(bodyStatements.ToImmutableAndFree());
274
bodyStatements.Add(
_F
.Label(proxy));
277
bodyStatements.Add(
_F
.Assignment(
_F
.Local(pendingBranchVar),
_F
.Literal(i)));
280
bodyStatements.Add(
_F
.Goto(finallyLabel));
302
var caseStatement =
_F
.SwitchSection(i,
_F
.Goto(parentProxy));
312
pendingValue =
_F
.Local(frame.returnValue);
318
var returnLabel = parent.ProxyReturnIfNeeded(
_F
.CurrentFunction, pendingValue, out returnValue);
322
unpendReturn = new BoundReturnStatement(
_F
.Syntax, RefKind.None, pendingValue, @checked: false);
328
unpendReturn =
_F
.Goto(returnLabel);
332
unpendReturn =
_F
.Block(
333
_F
.Assignment(
334
_F
.Local(returnValue),
336
_F
.Goto(returnLabel));
340
var caseStatement =
_F
.SwitchSection(i, unpendReturn);
344
return
_F
.Switch(
_F
.Local(pendingBranchVar), cases.ToImmutableAndFree());
365
_F
.CurrentFunction,
377
return
_F
.Block(
378
_F
.Assignment(
379
_F
.Local(returnValue),
381
_F
.Goto(
386
return
_F
.Goto(returnLabel);
394
LocalSymbol obj =
_F
.SynthesizedLocal(
_F
.SpecialType(SpecialType.System_Object));
395
var objInit =
_F
.Assignment(
_F
.Local(obj),
_F
.Local(pendingExceptionLocal));
400
return
_F
.Block(
403
_F
.If(
404
_F
.ObjectNotEqual(
405
_F
.Local(obj),
406
_F
.Null(obj.Type)),
413
BoundStatement rethrow =
_F
.Throw(
_F
.Local(obj));
415
var exceptionDispatchInfoCapture =
_F
.WellKnownMethod(WellKnownMember.System_Runtime_ExceptionServices_ExceptionDispatchInfo__Capture, isOptional: true);
416
var exceptionDispatchInfoThrow =
_F
.WellKnownMethod(WellKnownMember.System_Runtime_ExceptionServices_ExceptionDispatchInfo__Throw, isOptional: true);
422
var ex =
_F
.SynthesizedLocal(
_F
.WellKnownType(WellKnownType.System_Exception));
423
var assignment =
_F
.Assignment(
424
_F
.Local(ex),
425
_F
.As(
_F
.Local(obj), ex.Type));
428
rethrow =
_F
.Block(
431
_F
.If(
_F
.ObjectEqual(
_F
.Local(ex),
_F
.Null(ex.Type)), rethrow),
433
_F
.ExpressionStatement(
434
_F
.Call(
435
_F
.StaticCall(
438
_F
.Local(ex)),
462
BoundStatement tryWithCatches =
_F
.Try(rewrittenTry, rewrittenCatches);
467
var handledLabel =
_F
.GenerateLabel("handled");
472
handlers.Add(
_F
.SwitchSection(
474
_F
.Block(
476
_F
.Goto(handledLabel))));
479
tryWithCatches =
_F
.Block(
484
_F
.HiddenSequencePoint(),
485
_F
.Assignment(
486
_F
.Local(currentAwaitCatchFrame.pendingCatch),
487
_F
.Default(currentAwaitCatchFrame.pendingCatch.Type)),
489
_F
.HiddenSequencePoint(),
490
_F
.Switch(
491
_F
.Local(currentAwaitCatchFrame.pendingCatch),
493
_F
.HiddenSequencePoint(),
494
_F
.Label(handledLabel));
520
currentAwaitCatchFrame = _currentAwaitCatchFrame = new AwaitCatchFrame(
_F
, tryStatementSyntax);
523
var catchType = node.ExceptionTypeOpt ??
_F
.SpecialType(SpecialType.System_Object);
524
var catchTemp =
_F
.SynthesizedLocal(catchType);
526
var storePending =
_F
.AssignmentExpression(
527
_F
.Local(currentAwaitCatchFrame.pendingCaughtException),
528
_F
.Convert(currentAwaitCatchFrame.pendingCaughtException.Type,
529
_F
.Local(catchTemp)));
531
var setPendingCatchNum =
_F
.Assignment(
532
_F
.Local(currentAwaitCatchFrame.pendingCatch),
533
_F
.Literal(currentAwaitCatchFrame.handlers.Count + 1));
552
_F
.Local(catchTemp),
556
body:
_F
.Block(
557
_F
.HiddenSequencePoint(),
558
_F
.ExpressionStatement(storePending),
573
currentAwaitCatchFrame.HoistLocal(local,
_F
);
582
prologueBuilder.Add(
_F
.ExpressionStatement(storePending));
585
prologueBuilder.Add(
_F
.ExpressionStatement(AssignCatchSource((BoundExpression)this.Visit(sourceOpt), currentAwaitCatchFrame)));
592
var newPrologue =
_F
.StatementList(prologueBuilder.ToImmutableAndFree());
598
_F
.Local(catchTemp),
602
body:
_F
.Block(
603
_F
.HiddenSequencePoint(),
610
handlerStatements.Add(
_F
.HiddenSequencePoint());
618
handlerStatements.Add(
_F
.ExpressionStatement(assignSource));
624
var handler =
_F
.Block(
640
assignSource =
_F
.AssignmentExpression(
642
_F
.Convert(
644
_F
.Local(currentAwaitCatchFrame.pendingCaughtException)));
674
var oldContainingSymbol =
_F
.CurrentFunction;
677
_F
.CurrentFunction = node.Symbol;
682
_F
.CurrentFunction = oldContainingSymbol;
690
var oldContainingSymbol =
_F
.CurrentFunction;
693
_F
.CurrentFunction = node.Symbol;
698
_F
.CurrentFunction = oldContainingSymbol;