1 write to _factory
Microsoft.CodeAnalysis.CSharp (1)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
140_factory = factory;
69 references to _factory
Microsoft.CodeAnalysis.CSharp (69)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (69)
148_factory, 269=> (MethodSymbol?)Binder.GetWellKnownTypeMember(_factory.Compilation, overload, _diagnostics, syntax: syntax, isOptional: false); 272=> (MethodSymbol?)Binder.GetSpecialTypeMember(_factory.Compilation, overload, _diagnostics, syntax: syntax); 280_scope.Open(_factory.SynthesizedLocal(_contextType, original.Syntax, kind: SynthesizedLocalKind.LocalStoreTracker)); 298Debug.Assert(_factory.TopLevelMethod is not null); 299Debug.Assert(_factory.CurrentFunction is not null); 301var isStateMachine = _factory.CurrentFunction.IsAsync || _factory.CurrentFunction.IsIterator; 303var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(_factory.CurrentFunction.ParameterCount); 305foreach (var parameter in _factory.CurrentFunction.Parameters) 312var parameterLogger = GetLocalOrParameterStoreLogger(parameter.Type, parameter, refAssignmentSourceIsLocal: null, _factory.Syntax); 315prologueBuilder.Add(_factory.ExpressionStatement(_factory.Call(receiver: _factory.Local(_scope.ContextVariable), parameterLogger, 316MakeStoreLoggerArguments(parameterLogger.Parameters[0], parameter, parameter.Type, _factory.Parameter(parameter), refAssignmentSourceIndex: null, _factory.Literal((ushort)parameter.Ordinal))))); 325prologue = _factory.StatementList(prologueBuilder.ToImmutableAndFree()); 331new[] { _factory.MethodDefIndex(_factory.TopLevelMethod) }), 334new[] { _factory.MethodDefIndex(_factory.TopLevelMethod), _factory.MethodDefIndex(_factory.CurrentFunction) }), 337new[] { _factory.MethodDefIndex(_factory.TopLevelMethod), _factory.StateMachineInstanceId() }), 340new[] { _factory.MethodDefIndex(_factory.TopLevelMethod), _factory.MethodDefIndex(_factory.CurrentFunction), _factory.StateMachineInstanceId() }), 343var entryLogger = GetWellKnownMethodSymbol(entryOverload, _factory.Syntax); 345_factory.Assignment(_factory.Local(_scope.ContextVariable), _factory.Call(receiver: null, entryLogger, entryArgs)) : _factory.NoOp(NoOpStatementFlavor.Default); 347var returnLogger = GetWellKnownMethodSymbol(WellKnownMember.Microsoft_CodeAnalysis_Runtime_LocalStoreTracker__LogReturn, _factory.Syntax); 349_factory.ExpressionStatement(_factory.Call(receiver: _factory.Local(_scope.ContextVariable), returnLogger)) : _factory.NoOp(NoOpStatementFlavor.Default); 351instrumentation = _factory.CombineInstrumentation(instrumentation, _scope.ContextVariable, instrumentationPrologue, instrumentationEpilogue); 369refAssignmentSourceIndex = _factory.LocalId(rightLocal.LocalSymbol); 374refAssignmentSourceIndex = _factory.ParameterId(rightParameter.ParameterSymbol); 400return _factory.Sequence(new[] 402_factory.Call( 403receiver: _factory.Local(_scope.ContextVariable), 415indexExpression = _factory.LocalId(localSymbol); 425indexExpression = _factory.ParameterId(parameterSymbol); 445return ImmutableArray.Create(_factory.Sequence(new[] { value }, refAssignmentSourceIndex), index); 456(BoundExpression)new BoundAddressOfOperator(_factory.Syntax, value, isManaged: false, parameter.Type) : 457_factory.Sequence(new[] { value }, new BoundAddressOfOperator(_factory.Syntax, VariableRead(targetSymbol), isManaged: false, parameter.Type)); 459return ImmutableArray.Create(addressOf, _factory.Sizeof(targetType), index); 470toString = _factory.Literal(""); 476toString = _factory.Call(value, toStringMethod); 482return ImmutableArray.Create(_factory.Convert(parameter.Type, value), index); 488LocalSymbol local => _factory.Local(local), 489ParameterSymbol param => _factory.Parameter(param), 523var targetIndex = _factory.LocalId(targetSymbol); 531var logCallStatement = _factory.ExpressionStatement( 532_factory.Call( 533receiver: _factory.Local(_scope.ContextVariable), 537rewrittenFilterPrologue = _factory.StatementList( 567temp = _factory.StoreToTemp(invocation, out var store); 595builder.Add(_factory.Call( 596receiver: _factory.Local(_scope.ContextVariable), 603return _factory.Sequence(ImmutableArray.Create(temp.LocalSymbol), builder.ToImmutableAndFree(), temp); 609return _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, builder.ToImmutableAndFree(), lastExpression);