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));
298
Debug.Assert(
_factory
.TopLevelMethod is not null);
299
Debug.Assert(
_factory
.CurrentFunction is not null);
301
var isStateMachine =
_factory
.CurrentFunction.IsAsync ||
_factory
.CurrentFunction.IsIterator;
303
var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(
_factory
.CurrentFunction.ParameterCount);
305
foreach (var parameter in
_factory
.CurrentFunction.Parameters)
312
var parameterLogger = GetLocalOrParameterStoreLogger(parameter.Type, parameter, refAssignmentSourceIsLocal: null,
_factory
.Syntax);
315
prologueBuilder.Add(
_factory
.ExpressionStatement(
_factory
.Call(receiver:
_factory
.Local(_scope.ContextVariable), parameterLogger,
316
MakeStoreLoggerArguments(parameterLogger.Parameters[0], parameter, parameter.Type,
_factory
.Parameter(parameter), refAssignmentSourceIndex: null,
_factory
.Literal((ushort)parameter.Ordinal)))));
325
prologue =
_factory
.StatementList(prologueBuilder.ToImmutableAndFree());
331
new[] {
_factory
.MethodDefIndex(
_factory
.TopLevelMethod) }),
334
new[] {
_factory
.MethodDefIndex(
_factory
.TopLevelMethod),
_factory
.MethodDefIndex(
_factory
.CurrentFunction) }),
337
new[] {
_factory
.MethodDefIndex(
_factory
.TopLevelMethod),
_factory
.StateMachineInstanceId() }),
340
new[] {
_factory
.MethodDefIndex(
_factory
.TopLevelMethod),
_factory
.MethodDefIndex(
_factory
.CurrentFunction),
_factory
.StateMachineInstanceId() }),
343
var entryLogger = GetWellKnownMethodSymbol(entryOverload,
_factory
.Syntax);
345
_factory
.Assignment(
_factory
.Local(_scope.ContextVariable),
_factory
.Call(receiver: null, entryLogger, entryArgs)) :
_factory
.NoOp(NoOpStatementFlavor.Default);
347
var 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);
351
instrumentation =
_factory
.CombineInstrumentation(instrumentation, _scope.ContextVariable, instrumentationPrologue, instrumentationEpilogue);
369
refAssignmentSourceIndex =
_factory
.LocalId(rightLocal.LocalSymbol);
374
refAssignmentSourceIndex =
_factory
.ParameterId(rightParameter.ParameterSymbol);
400
return
_factory
.Sequence(new[]
402
_factory
.Call(
403
receiver:
_factory
.Local(_scope.ContextVariable),
415
indexExpression =
_factory
.LocalId(localSymbol);
425
indexExpression =
_factory
.ParameterId(parameterSymbol);
445
return 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));
459
return ImmutableArray.Create(addressOf,
_factory
.Sizeof(targetType), index);
470
toString =
_factory
.Literal("");
476
toString =
_factory
.Call(value, toStringMethod);
482
return ImmutableArray.Create(
_factory
.Convert(parameter.Type, value), index);
488
LocalSymbol local =>
_factory
.Local(local),
489
ParameterSymbol param =>
_factory
.Parameter(param),
523
var targetIndex =
_factory
.LocalId(targetSymbol);
531
var logCallStatement =
_factory
.ExpressionStatement(
532
_factory
.Call(
533
receiver:
_factory
.Local(_scope.ContextVariable),
537
rewrittenFilterPrologue =
_factory
.StatementList(
567
temp =
_factory
.StoreToTemp(invocation, out var store);
595
builder.Add(
_factory
.Call(
596
receiver:
_factory
.Local(_scope.ContextVariable),
603
return
_factory
.Sequence(ImmutableArray.Create(temp.LocalSymbol), builder.ToImmutableAndFree(), temp);
609
return
_factory
.Sequence(ImmutableArray<LocalSymbol>.Empty, builder.ToImmutableAndFree(), lastExpression);