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