1 instantiation of LocalRewriter
Microsoft.CodeAnalysis.CSharp (1)
Lowering\LocalRewriter\LocalRewriter.cs (1)
144var localRewriter = new LocalRewriter(compilation, method, methodOrdinal, statement, containingType, factory, previousSubmissionFields, allowOmissionOfConditionalCalls, diagnostics);
53 references to LocalRewriter
Microsoft.CodeAnalysis.CSharp (53)
Binder\Binder.ValueChecks.cs (2)
4530return !LocalRewriter.ShouldUseRuntimeHelpersCreateSpan(expr, elementType.Type); 4550if (LocalRewriter.ShouldUseRuntimeHelpersCreateSpan(expr, ((NamedTypeSymbol)parameter.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type))
CodeGen\EmitExpression.cs (1)
442LocalRewriter.CanChangeValueBetweenReads(receiver, localsMayBeAssignedOrCaptured: false) ||
CodeGen\EmitStatement.cs (1)
535LocalRewriter.CanChangeValueBetweenReads(receiver, localsMayBeAssignedOrCaptured: false) ||
Compiler\MethodCompiler.cs (1)
1390var loweredBody = LocalRewriter.Rewrite(
Lowering\InitializerRewriter.cs (1)
115Debug.Assert(LocalRewriter.IsFieldOrPropertyInitializer(boundStatement));
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
237public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\CompoundInstrumenter.cs (2)
84public override void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 89public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
186public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\Instrumenter.cs (5)
17/// It provides a set of APIs that are called by <see cref="LocalRewriter"/> to instrument 20/// - rewritten bound node created by the <see cref="LocalRewriter"/> for the original node. 62public virtual void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 74public virtual void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation) 103Debug.Assert(LocalRewriter.IsFieldOrPropertyInitializer(original));
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (2)
274public override void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) 284public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (1)
67public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (1)
57public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\LocalRewriter\LocalRewriter.cs (1)
144var localRewriter = new LocalRewriter(compilation, method, methodOrdinal, statement, containingType, factory, previousSubmissionFields, allowOmissionOfConditionalCalls, diagnostics);
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
56LocalRewriter localRewriter,
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (2)
26protected readonly LocalRewriter _localRewriter; 30public PatternLocalRewriter(SyntaxNode node, LocalRewriter localRewriter, bool generateInstrumentation)
Lowering\LocalRewriter\LocalRewriter_BasePatternSwitchLocalRewriter.cs (1)
41LocalRewriter localRewriter,
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
1342(LocalRewriter rewriter, bool forceLambdaSpilling, ArrayBuilder<BoundAssignmentOperator> storesToTemps) arg = (rewriter: this, forceLambdaSpilling, storesToTemps); 1345static (BoundExpression element, ref (LocalRewriter rewriter, bool forceLambdaSpilling, ArrayBuilder<BoundAssignmentOperator> storesToTemps) arg) =>
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (8)
707private delegate BoundStatement? GetForEachStatementAsForPreamble(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind); 708private delegate BoundExpression GetForEachStatementAsForItem<TArg>(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, BoundLocal boundArrayVar, BoundLocal boundPositionVar, TArg arg); 709private delegate BoundExpression GetForEachStatementAsForLength<TArg>(LocalRewriter rewriter, SyntaxNode syntax, BoundLocal boundArrayVar, TArg arg); 715getItem: static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, BoundLocal boundArrayVar, BoundLocal boundPositionVar, (MethodSymbol indexerGet, MethodSymbol lengthGet) arg) => 724getLength: static (LocalRewriter rewriter, SyntaxNode syntax, BoundLocal boundArrayVar, (MethodSymbol indexerGet, MethodSymbol lengthGet) arg) => 746return static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind) => 767return static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, BoundLocal boundArrayVar, BoundLocal boundPositionVar, object? _) => 793return static (LocalRewriter rewriter, SyntaxNode syntax, BoundLocal boundArrayVar, object? _) =>
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (2)
97LocalRewriter localRewriter) : base(node, localRewriter, generateInstrumentation: false) 158public IsPatternExpressionLinearLocalRewriter(BoundIsPatternExpression node, LocalRewriter localRewriter)
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (2)
605(LocalRewriter rewriter, ArrayBuilder<BoundExpression> sideeffects, ArrayBuilder<LocalSymbol>? temps) elementArg = (rewriter: this, sideeffects, temps); 608static (BoundExpression element, ref (LocalRewriter rewriter, ArrayBuilder<BoundExpression> sideeffects, ArrayBuilder<LocalSymbol>? temps) elementArg) =>
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (2)
28public static BoundStatement Rewrite(LocalRewriter localRewriter, BoundSwitchStatement node) 64private SwitchStatementLocalRewriter(BoundSwitchStatement node, LocalRewriter localRewriter)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
495LocalRewriter self,
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (3)
259private readonly LocalRewriter _rewriter; 264public InterpolationHandlerResult(ImmutableArray<BoundStatement> statements, BoundLocal handlerTemp, LocalSymbol outTemp, LocalRewriter rewriter) 273public InterpolationHandlerResult(ImmutableArray<BoundExpression> expressions, BoundLocal handlerTemp, LocalSymbol? outTemp, LocalRewriter rewriter)
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (2)
29private SwitchExpressionLocalRewriter(BoundConvertedSwitchExpression node, LocalRewriter localRewriter) 35public static BoundExpression Rewrite(LocalRewriter localRewriter, BoundConvertedSwitchExpression node)
Lowering\SpillSequenceSpiller.cs (2)
1074if (!receiver.Type.IsReferenceType && LocalRewriter.CanBePassedByReference(receiver)) 1328Debug.Assert(whenNullOpt == null || !LocalRewriter.ReadIsSideeffecting(whenNullOpt));
Lowering\SyntheticBoundNodeFactory.cs (4)
1001if (LocalRewriter.ReadIsSideeffecting(part)) 1800LocalRewriter.UnsafeGetNullableMethod(syntax, expression.Type, CodeAnalysis.SpecialMember.System_Nullable_T_get_HasValue, Compilation, Diagnostics)); 1829if (LocalRewriter.NullableNeverHasValue(nullable)) 1834BoundExpression nonNullValue = LocalRewriter.NullableAlwaysHasValue(nullable);
Operations\CSharpOperationFactory_Methods.cs (1)
302if (LocalRewriter.CanSkipRewriting(arguments, methodOrIndexer, argsToParamsOpt, invokedAsExtensionMethod, true, out _))