1 write to _semanticModel
Microsoft.CodeAnalysis.CSharp (1)
Operations\CSharpOperationFactory.cs (1)
24
_semanticModel
= semanticModel;
185 references to _semanticModel
Microsoft.CodeAnalysis.CSharp (185)
Operations\CSharpOperationFactory.cs (175)
325
return new NoneOperation(children,
_semanticModel
, boundNode.Syntax, type: type, constantValue, isImplicit: isImplicit);
356
_semanticModel
,
368
_semanticModel
,
425
return new PlaceholderOperation(PlaceholderKind.Unspecified,
_semanticModel
, syntax, type, isImplicit);
437
return new DeconstructionAssignmentOperation(target, value,
_semanticModel
, syntax, type, isImplicit);
451
return new InvalidOperation(children,
_semanticModel
, syntax, type, constantValue, isImplicit);
458
return new InvocationOperation(targetMethod.GetPublicSymbol(), constrainedToType.GetPublicSymbol(), receiver, isVirtual, arguments,
_semanticModel
, syntax, type, isImplicit);
481
return new InvalidOperation(children,
_semanticModel
, syntax, type, constantValue: null, isImplicit);
486
return new FunctionPointerInvocationOperation(pointer, arguments,
_semanticModel
, syntax, type, isImplicit);
493
_semanticModel
,
504
var invalidOperation = OperationFactory.CreateInvalidOperation(
_semanticModel
, boundAttribute.Syntax, GetIOperationChildren(boundAttribute), isImplicit: true);
505
return new AttributeOperation(invalidOperation,
_semanticModel
, boundAttribute.Syntax, isAttributeImplicit);
512
initializer = new ObjectOrCollectionInitializerOperation(namedArguments,
_semanticModel
, boundAttribute.Syntax, boundAttribute.GetPublicTypeSymbol(), isImplicit: true);
516
var objectCreationOperation = new ObjectCreationOperation(boundAttribute.Constructor.GetPublicSymbol(), initializer, DeriveArguments(boundAttribute),
_semanticModel
, boundAttribute.Syntax, boundAttribute.GetPublicTypeSymbol(), boundAttribute.ConstantValueOpt, isImplicit: true);
517
return new AttributeOperation(objectCreationOperation,
_semanticModel
, boundAttribute.Syntax, isAttributeImplicit);
566
return new DeclarationExpressionOperation(localReference,
_semanticModel
, declarationExpressionSyntax, type, isImplicit: false);
569
return new LocalReferenceOperation(local, isDeclaration,
_semanticModel
, syntax, type, constantValue, isImplicit);
587
return new DeclarationExpressionOperation(fieldAccess,
_semanticModel
, declarationExpressionSyntax, type, isImplicit: false);
592
return new FieldReferenceOperation(field, isDeclaration, instance,
_semanticModel
, syntax, type, constantValue, isImplicit);
621
return new PropertyReferenceOperation(property, constrainedToType.GetPublicSymbol(), arguments, instance,
_semanticModel
, syntax, type, isImplicit);
634
return new InvalidOperation(children,
_semanticModel
, syntax, type, constantValue: null, isImplicit);
640
return new PropertyReferenceOperation(property.GetPublicSymbol(), constrainedToType.GetPublicSymbol(), arguments, instance,
_semanticModel
, syntax, type, isImplicit);
651
return new EventReferenceOperation(@event, constrainedToType.GetPublicSymbol(), instance,
_semanticModel
, syntax, type, isImplicit);
662
return new EventAssignmentOperation(eventReference, handlerValue, adds,
_semanticModel
, syntax, type, isImplicit);
671
return new ParameterReferenceOperation(parameter,
_semanticModel
, syntax, type, isImplicit);
680
return new LiteralOperation(
_semanticModel
, syntax, type, constantValue, isImplicit);
688
return new Utf8StringOperation(boundNode.Value,
_semanticModel
, syntax, type, isImplicit);
698
return new AnonymousObjectCreationOperation(initializers,
_semanticModel
, syntax, type, isImplicit);
714
return new InvalidOperation(children,
_semanticModel
, syntax, type, constantValue, isImplicit);
727
return new AnonymousObjectCreationOperation(initializers,
_semanticModel
, syntax, type, isImplicit);
733
return new ObjectCreationOperation(constructor.GetPublicSymbol(), initializer, arguments,
_semanticModel
, syntax, type, constantValue, isImplicit);
744
return new WithOperation(operand, constructor.GetPublicSymbol(), initializer,
_semanticModel
, syntax, type, isImplicit);
756
return new DynamicObjectCreationOperation(initializer, arguments, argumentNames, argumentRefKinds,
_semanticModel
, syntax, type, isImplicit);
785
return new DynamicInvocationOperation(operation, arguments, argumentNames, argumentRefKinds,
_semanticModel
, syntax, type, isImplicit);
828
return new DynamicIndexerAccessOperation(operation, arguments, argumentNames, argumentRefKinds,
_semanticModel
, syntax, type, isImplicit);
837
return new ObjectOrCollectionInitializerOperation(initializers,
_semanticModel
, syntax, type, isImplicit);
846
return new ObjectOrCollectionInitializerOperation(initializers,
_semanticModel
, syntax, type, isImplicit);
864
return new DynamicIndexerAccessOperation(operation, arguments, argumentNames, argumentRefKinds,
_semanticModel
, syntax, type, isImplicit);
872
return new FieldReferenceOperation(field.GetPublicSymbol(), isDeclaration, createReceiver(),
_semanticModel
, syntax, type, constantValue: null, isImplicit);
875
return new EventReferenceOperation(eventSymbol.GetPublicSymbol(), constrainedToType: null, createReceiver(),
_semanticModel
, syntax, type, isImplicit);
890
return new InvalidOperation(children,
_semanticModel
, syntax, type, constantValue: null, isImplicit);
900
return new PropertyReferenceOperation(property.GetPublicSymbol(), constrainedToType: null, arguments, createReceiver(),
_semanticModel
, syntax, type, isImplicit);
920
return new DynamicMemberReferenceOperation(instanceReceiver, memberName, typeArguments, containingType,
_semanticModel
, syntax, type, isImplicit);
936
return new InvalidOperation(children,
_semanticModel
, syntax, type, constantValue, isImplicit);
940
return new InvocationOperation(addMethod.GetPublicSymbol(), constrainedToType: null, receiver, isVirtual, arguments,
_semanticModel
, syntax, type, isImplicit);
971
return new DynamicMemberReferenceOperation(instance, memberName, typeArguments, containingType,
_semanticModel
, syntaxNode, type, isImplicit);
981
return new DynamicInvocationOperation(operation, arguments, argumentNames: ImmutableArray<string?>.Empty, argumentRefKinds: ImmutableArray<RefKind>.Empty,
_semanticModel
, syntax, type, isImplicit);
1000
return new AnonymousFunctionOperation(symbol, body,
_semanticModel
, syntax, isImplicit);
1012
return new LocalFunctionOperation(symbol, body, ignoredBody,
_semanticModel
, syntax, isImplicit);
1039
_semanticModel
, syntax, type, boundConversion.WasCompilerGenerated);
1054
return new DelegateCreationOperation(target,
_semanticModel
, syntax, type, isImplicit);
1124
return new DelegateCreationOperation(target,
_semanticModel
, syntax, type, isImplicit);
1134
return new ConversionOperation(operand, conversion, isTryCast, isChecked,
_semanticModel
, syntax, type, constantValue, isImplicit);
1148
return new ConversionOperation(operand, conversion, isTryCast, isChecked,
_semanticModel
, syntax, type, constantValue: null, isImplicit);
1157
return new DelegateCreationOperation(target,
_semanticModel
, syntax, type, isImplicit);
1168
return new MethodReferenceOperation(methodSymbol.GetPublicSymbol(), constrainedToType.GetPublicSymbol(), isVirtual, instance,
_semanticModel
, bindingSyntax, bindingType, isImplicit);
1180
return new IsTypeOperation(value, typeOperand, isNegated,
_semanticModel
, syntax, type, isImplicit);
1191
return new SizeOfOperation(typeOperand,
_semanticModel
, syntax, type, constantValue, isImplicit);
1201
return new TypeOfOperation(typeOperand,
_semanticModel
, syntax, type, isImplicit);
1212
return new ArrayCreationOperation(dimensionSizes, arrayInitializer,
_semanticModel
, syntax, type, isImplicit);
1220
return new ArrayInitializerOperation(elementValues,
_semanticModel
, syntax, isImplicit);
1228
IMethodSymbol? constructMethod = getConstructMethod((CSharpCompilation)
_semanticModel
.Compilation, expr).GetPublicSymbol();
1233
_semanticModel
,
1279
_semanticModel
,
1289
return new DefaultValueOperation(
_semanticModel
, syntax, type: null, constantValue, isImplicit);
1298
return new DefaultValueOperation(
_semanticModel
, syntax, type, constantValue, isImplicit);
1307
return new InstanceReferenceOperation(referenceKind,
_semanticModel
, syntax, type, isImplicit);
1316
return new InstanceReferenceOperation(referenceKind,
_semanticModel
, syntax, type, isImplicit);
1341
return new SimpleAssignmentOperation(isRef, target, value,
_semanticModel
, syntax, type, constantValue, isImplicit);
1352
return new MemberInitializerOperation(initializedMember, initializer,
_semanticModel
, syntax, type, isImplicit);
1371
target, value,
_semanticModel
, syntax, type, isImplicit);
1398
operationKind,
_semanticModel
, syntax, type, isImplicit);
1410
return new InvalidOperation(children,
_semanticModel
, syntax, type, constantValue: null, isImplicit);
1419
return new TypeParameterObjectCreationOperation(initializer,
_semanticModel
, syntax, type, isImplicit);
1428
return new NoPiaObjectCreationOperation(initializer,
_semanticModel
, syntax, type, isImplicit);
1444
_semanticModel
, syntax, type, constantValue, isImplicit);
1503
_semanticModel
, syntax, type, constantValue, isImplicit);
1533
_semanticModel
, syntax, type, constantValue, isImplicit);
1569
return new TupleBinaryOperation(operatorKind, left, right,
_semanticModel
, syntax, type, isImplicit);
1582
return new ConditionalOperation(condition, whenTrue, whenFalse, isRef,
_semanticModel
, syntax, type, constantValue, isImplicit);
1601
return new CoalesceOperation(value, whenNull, valueConversion,
_semanticModel
, syntax, type, constantValue, isImplicit);
1612
return new CoalesceAssignmentOperation(target, value,
_semanticModel
, syntax, type, isImplicit);
1621
return new AwaitOperation(awaitedValue,
_semanticModel
, syntax, type, isImplicit);
1632
return new ArrayElementReferenceOperation(arrayReference, indices,
_semanticModel
, syntax, type, isImplicit);
1645
return new ArrayElementReferenceOperation(instance, ImmutableArray.Create(argument),
_semanticModel
, syntax, type, isImplicit);
1654
return new ImplicitIndexerReferenceOperation(instance, argument, lengthSymbol, indexerSymbol,
_semanticModel
, syntax, type, isImplicit);
1665
return new InlineArrayAccessOperation(arrayReference, argument,
_semanticModel
, syntax, type, isImplicit);
1675
return new NameOfOperation(argument,
_semanticModel
, syntax, type, constantValue, isImplicit);
1684
return new ThrowOperation(expression,
_semanticModel
, syntax, type, isImplicit);
1693
return new AddressOfOperation(reference,
_semanticModel
, syntax, type, isImplicit);
1702
return new InstanceReferenceOperation(referenceKind,
_semanticModel
, syntax, type, isImplicit);
1713
return new ConditionalAccessOperation(operation, whenNotNull,
_semanticModel
, syntax, type, isImplicit);
1721
return new ConditionalAccessInstanceOperation(
_semanticModel
, syntax, type, isImplicit);
1730
return new FieldInitializerOperation(initializedFields, boundFieldEqualsValue.Locals.GetPublicSymbols(), value,
_semanticModel
, syntax, isImplicit);
1739
return new PropertyInitializerOperation(initializedProperties, boundPropertyEqualsValue.Locals.GetPublicSymbols(), value,
_semanticModel
, syntax, isImplicit);
1748
return new ParameterInitializerOperation(parameter, boundParameterEqualsValue.Locals.GetPublicSymbols(), value,
_semanticModel
, syntax, isImplicit);
1757
return new BlockOperation(operations, locals,
_semanticModel
, syntax, isImplicit);
1766
return new BranchOperation(target, branchKind,
_semanticModel
, syntax, isImplicit);
1775
return new BranchOperation(target, branchKind,
_semanticModel
, syntax, isImplicit);
1783
return new ReturnOperation(returnedValue, OperationKind.YieldBreak,
_semanticModel
, syntax, isImplicit);
1792
return new BranchOperation(target, branchKind,
_semanticModel
, syntax, isImplicit);
1799
return new EmptyOperation(
_semanticModel
, syntax, isImplicit);
1835
result = new ConditionalOperation(condition, whenTrue, whenFalse, isRef,
_semanticModel
, syntax, type, constantValue, isImplicit);
1855
return new WhileLoopOperation(condition, conditionIsTop, conditionIsUntil, ignoredCondition: null, body, locals, continueLabel, exitLabel,
_semanticModel
, syntax, isImplicit);
1869
return new WhileLoopOperation(condition, conditionIsTop, conditionIsUntil, ignoredCondition: null, body, locals, continueLabel, exitLabel,
_semanticModel
, syntax, isImplicit);
1884
return new ForLoopOperation(before, conditionLocals, condition, atLoopBottom, body, locals, continueLabel, exitLabel,
_semanticModel
, syntax, isImplicit);
1895
var compilation = (CSharpCompilation)
_semanticModel
.Compilation;
1969
return new VariableDeclaratorOperation(local.GetPublicSymbol(), initializer: null, ignoredArguments: ImmutableArray<IOperation>.Empty, semanticModel:
_semanticModel
, syntax: declaratorSyntax, isImplicit: false);
1992
return new ForEachLoopOperation(loopControlVariable, collection, nextVariables, info, isAsynchronous, body, locals, continueLabel, exitLabel,
_semanticModel
, syntax, isImplicit);
2002
return new TryOperation(body, catches, @finally, exitLabel: null,
_semanticModel
, syntax, isImplicit);
2012
ITypeSymbol exceptionType = boundCatchBlock.ExceptionTypeOpt.GetPublicSymbol() ??
_semanticModel
.Compilation.ObjectType;
2016
return new CatchClauseOperation(exceptionDeclarationOrExpression, exceptionType, locals, filter, handler,
_semanticModel
, syntax, isImplicit);
2026
return new FixedOperation(locals, variables, body,
_semanticModel
, syntax, isImplicit);
2044
return new UsingOperation(resources, body, locals, isAsynchronous, disposeOperationInfo,
_semanticModel
, syntax, isImplicit);
2053
return new ThrowOperation(thrownObject,
_semanticModel
, syntax, statementType, isImplicit);
2061
return new ReturnOperation(returnedValue, OperationKind.Return,
_semanticModel
, syntax, isImplicit);
2069
return new ReturnOperation(returnedValue, OperationKind.YieldReturn,
_semanticModel
, syntax, isImplicit);
2075
bool legacyMode =
_semanticModel
.Compilation.CommonGetWellKnownTypeMember(WellKnownMember.System_Threading_Monitor__Enter2) == null;
2077
legacyMode ? null : new SynthesizedLocal((
_semanticModel
.GetEnclosingSymbol(boundLockStatement.Syntax.SpanStart) as IMethodSymbol).GetSymbol(),
2078
TypeWithAnnotations.Create(((CSharpCompilation)
_semanticModel
.Compilation).GetSpecialType(SpecialType.System_Boolean)),
2086
return new LockOperation(lockedValue, body, lockTakenSymbol,
_semanticModel
, syntax, isImplicit);
2096
return new InvalidOperation(children,
_semanticModel
, syntax, type: null, constantValue: null, isImplicit);
2143
IVariableDeclarationOperation multiVariableDeclaration = new VariableDeclarationOperation(declarators, initializer: null, ignoredDimensions,
_semanticModel
, varDeclaration, multiVariableImplicit);
2147
return new VariableDeclarationGroupOperation(ImmutableArray.Create(multiVariableDeclaration),
_semanticModel
, varStatement, isImplicit);
2163
IVariableDeclarationOperation multiVariableDeclaration = new VariableDeclarationOperation(declarators, initializer: null, ignoredDimensions,
_semanticModel
, declarationSyntax, declarationIsImplicit);
2169
var variableDeclaration = new VariableDeclarationGroupOperation(ImmutableArray.Create(multiVariableDeclaration),
_semanticModel
, declarationGroupSyntax, isImplicit);
2181
_semanticModel
,
2194
return new LabeledOperation(label, operation: null,
_semanticModel
, syntax, isImplicit);
2203
return new LabeledOperation(label, labeledStatement,
_semanticModel
, syntax, isImplicit);
2223
return new ExpressionStatementOperation(expression,
_semanticModel
, syntax, isImplicit);
2238
return new DeclarationExpressionOperation(tupleOperation,
_semanticModel
, declarationExpressionSyntax, type, isImplicit: false);
2251
return new TupleOperation(elements, naturalType.GetPublicSymbol(),
_semanticModel
, syntax, type, isImplicit);
2268
return new InterpolatedStringOperation(parts,
_semanticModel
, syntax, type, constantValue, isImplicit);
2361
builder.Add(new InterpolatedStringTextOperation(valueOperation,
_semanticModel
, part.Syntax, isImplicit));
2371
builder.Add(new InterpolationOperation(valueOperation, alignmentOperation, formatOperation,
_semanticModel
, part.Syntax, isImplicit));
2406
return new InterpolationOperation(expression, alignment, formatString,
_semanticModel
, syntax, isImplicit);
2414
return new InterpolatedStringTextOperation(text,
_semanticModel
, syntax, isImplicit);
2430
_semanticModel
,
2442
return new InterpolatedStringAdditionOperation(left, right,
_semanticModel
, current.Syntax, current.WasCompilerGenerated);
2469
_semanticModel
,
2489
return new InvalidOperation(ImmutableArray<IOperation>.Empty,
_semanticModel
, syntax, type, placeholder.ConstantValueOpt, isImplicit);
2502
return new InterpolatedStringHandlerArgumentPlaceholderOperation(argumentIndex, placeholderKind,
_semanticModel
, syntax, isImplicit);
2509
_semanticModel
,
2522
return new ConstantPatternOperation(value, inputType.GetPublicSymbol(), narrowedType.GetPublicSymbol(),
_semanticModel
, syntax, isImplicit);
2533
return new RelationalPatternOperation(operatorKind, value, inputType.GetPublicSymbol(), narrowedType.GetPublicSymbol(),
_semanticModel
, syntax, isImplicit);
2550
return new DeclarationPatternOperation(matchedType, acceptsNull, variable, inputType, narrowedType,
_semanticModel
, syntax, isImplicit);
2570
_semanticModel
,
2589
_semanticModel
,
2600
semanticModel:
_semanticModel
,
2613
_semanticModel
,
2627
_semanticModel
,
2638
_semanticModel
,
2678
@this.
_semanticModel
,
2692
return new SwitchOperation(locals, value, cases, exitLabel,
_semanticModel
, syntax, isImplicit);
2701
return new SwitchCaseOperation(clauses, body, locals, condition: null,
_semanticModel
, boundSwitchSection.Syntax, isImplicit: boundSwitchSection.WasCompilerGenerated);
2724
_semanticModel
,
2740
_semanticModel
,
2754
return new DefaultCaseClauseOperation(label.GetPublicSymbol(),
_semanticModel
, syntax, isImplicit);
2761
return new SingleValueCaseClauseOperation(Create(cp.Value), label.GetPublicSymbol(),
_semanticModel
, syntax, isImplicit);
2767
return new PatternCaseClauseOperation(label.GetPublicSymbol(), pattern, guard,
_semanticModel
, syntax, isImplicit);
2778
return new IsPatternOperation(value, pattern,
_semanticModel
, syntax, type, isImplicit);
2793
return new TranslatedQueryOperation(operation,
_semanticModel
, syntax, type, isImplicit);
2806
_semanticModel
,
2821
_semanticModel
,
2836
_semanticModel
,
2847
_semanticModel
,
2861
var reference = OperationFactory.CreateInvalidOperation(
_semanticModel
, subpatternSyntax, ImmutableArray<IOperation>.Empty, isImplicit: true);
2862
return new PropertySubpatternOperation(reference, pattern,
_semanticModel
, subpatternSyntax, isImplicit: false);
2885
previousType, narrowedType: previousType, semanticModel:
_semanticModel
, nameSyntax, isImplicit: true);
2902
createReceiver(),
_semanticModel
, nameSyntax, type: field.Type.GetPublicSymbol(), constantValue, isImplicit: false);
2908
createReceiver(),
_semanticModel
, nameSyntax, type: property.Type.GetPublicSymbol(), isImplicit: false);
2915
reference = OperationFactory.CreateInvalidOperation(
_semanticModel
, nameSyntax, ImmutableArray<IOperation>.Empty, isImplicit: false);
2921
return new PropertySubpatternOperation(reference, pattern,
_semanticModel
, syntaxForPropertySubpattern, isImplicit: !isSingle);
2924
=> symbol?.IsStatic == false ? new InstanceReferenceOperation(InstanceReferenceKind.PatternInput,
_semanticModel
, nameSyntax!, receiverType, isImplicit: true) : null;
2937
return new InstanceReferenceOperation(referenceKind,
_semanticModel
, syntax, type, isImplicit);
Operations\CSharpOperationFactory_Methods.cs (10)
34
new InstanceReferenceOperation(InstanceReferenceKind.ImplicitReceiver,
_semanticModel
, syntax, type.GetPublicSymbol(), isImplicit: true);
47
_semanticModel
,
75
return new VariableInitializerOperation(locals: ImmutableArray<ILocalSymbol>.Empty, value,
_semanticModel
, initializerSyntax, initializerIsImplicit);
89
return new VariableDeclaratorOperation(symbol, initializer, ignoredDimensions,
_semanticModel
, syntax, isImplicit);
95
return boundLocal == null ? null : new VariableDeclaratorOperation(boundLocal.LocalSymbol.GetPublicSymbol(), initializer: null, ignoredArguments: ImmutableArray<IOperation>.Empty, semanticModel:
_semanticModel
, syntax: boundLocal.Syntax, isImplicit: false);
138
return new EventReferenceOperation(@event, constrainedToType.GetPublicSymbol(), instance,
_semanticModel
, eventAccessSyntax, @event.Type, isImplicit);
429
semanticModel:
_semanticModel
,
445
semanticModel:
_semanticModel
,
457
_semanticModel
,
467
var assignment = new SimpleAssignmentOperation(isRef, target, value,
_semanticModel
, assignmentSyntax, assignmentType, value.GetConstantValue(), isImplicitAssignment);