1 implementation of IArgumentOperation
Microsoft.CodeAnalysis (1)
391 references to IArgumentOperation
Aspire.Hosting.Analyzers (2)
ConfigurationSchemaGenerator (4)
GenerateDocumentationAndConfigFiles (9)
ILLink.RoslynAnalyzer (9)
Microsoft.Analyzers.Extra (6)
Microsoft.Analyzers.Local (1)
Microsoft.AspNetCore.App.Analyzers (16)
Microsoft.AspNetCore.Components.Analyzers (1)
Microsoft.AspNetCore.Mvc.Analyzers (1)
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
Microsoft.CodeAnalysis (78)
Generated\Operations.Generated.cs (21)
663ImmutableArray<IArgumentOperation> Arguments { get; }
797ImmutableArray<IArgumentOperation> Arguments { get; }
1006ImmutableArray<IArgumentOperation> Arguments { get; }
1291ImmutableArray<IArgumentOperation> Arguments { get; }
3756ImmutableArray<IArgumentOperation> Arguments { get; }
3960/// <see cref="IArgumentOperation" />; otherwise, they can be any operation.
3967/// That final argument will be represented by an <see cref="IArgumentOperation" /> whose 'Value' is an
4019/// which contains the elements as they appear in source. This will appear as the 'Value' of an <see cref="IArgumentOperation" />
5050internal RaiseEventOperation(IEventReferenceOperation eventReference, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit)
5057public ImmutableArray<IArgumentOperation> Arguments { get; }
5194internal InvocationOperation(IMethodSymbol targetMethod, ITypeSymbol? constrainedToType, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
5208public ImmutableArray<IArgumentOperation> Arguments { get; }
5496internal PropertyReferenceOperation(IPropertySymbol property, ITypeSymbol? constrainedToType, ImmutableArray<IArgumentOperation> arguments, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
5506public ImmutableArray<IArgumentOperation> Arguments { get; }
5957internal ObjectCreationOperation(IMethodSymbol? constructor, IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit)
5968public ImmutableArray<IArgumentOperation> Arguments { get; }
10330internal FunctionPointerInvocationOperation(IOperation target, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
10338public ImmutableArray<IArgumentOperation> Arguments { get; }
11228public override IOperation VisitArgument(IArgumentOperation operation, object? argument)
11570public virtual void VisitArgument(IArgumentOperation operation) => DefaultVisit(operation);
11711public virtual TResult? VisitArgument(IArgumentOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (46)
2045private ImmutableArray<IArgumentOperation> VisitArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed)
2053private void VisitAndPushArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed)
2100private IArgumentOperation RewriteArgumentFromArray(IOperation visitedArgument, int index, ImmutableArray<IArgumentOperation> args)
3354ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, value.Syntax,
3965private void HandleUsingOperationParts(IOperation resources, IOperation body, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, ImmutableArray<ILocalSymbol> locals, bool isAsynchronous,
4123private void AddDisposingFinally(IOperation resource, bool requiresRuntimeConversion, ITypeSymbol iDisposable, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, bool isAsynchronous)
4188ImmutableArray<IArgumentOperation> args;
4197args = ImmutableArray<IArgumentOperation>.Empty;
4242disposeArguments: ImmutableArray<IArgumentOperation>.Empty,
4256arguments: ImmutableArray<IArgumentOperation>.Empty,
4354ImmutableArray.Create<IArgumentOperation>(
4382ImmutableArray.Create<IArgumentOperation>(
4437ImmutableArray.Create<IArgumentOperation>(
4706InvocationOperation makeInvocationDroppingInstanceForStaticMethods(IMethodSymbol method, IOperation instance, ImmutableArray<IArgumentOperation> arguments)
4711InvocationOperation makeInvocation(SyntaxNode syntax, IMethodSymbol method, IOperation? instanceOpt, ImmutableArray<IArgumentOperation> arguments)
4721ImmutableArray<IArgumentOperation> makeArguments(ImmutableArray<IArgumentOperation> arguments, ref IOperation? instance)
4736return ImmutableArray<IArgumentOperation>.Empty;
4817var builder = ArrayBuilder<IArgumentOperation>.GetInstance(parametersCount, fillWithValue: null!);
5942(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments);
5957(IOperation visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) handlePointerAndArguments(
5958IOperation targetPointer, ImmutableArray<IArgumentOperation> arguments)
5962ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: false);
5969private (IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) VisitInstanceWithArguments(IOperation? instance, ImmutableArray<IArgumentOperation> arguments)
5977ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: hasInstance);
5995ImmutableArray<IArgumentOperation> visitedArgs = VisitArguments(operation.Arguments, instancePushed: false);
6254ImmutableArray<IArgumentOperation> propertyArguments = PopArray(propertyReference.Arguments, RewriteArgumentFromArray);
6314foreach (var argument in propertyReference.Arguments)
6411IOperation visitedTarget = new PropertyReferenceOperation(propertyReference.Property, propertyReference.ConstrainedToType, ImmutableArray<IArgumentOperation>.Empty, visitedPropertyInstance,
6557if (operation.ConstructArguments.Any(a => a is IArgumentOperation) && !operation.ConstructArguments.All(a => a is IArgumentOperation))
6563var arguments = operation.ConstructArguments.As<IArgumentOperation>();
6847IArgumentOperation? outParameterArgument = null;
7197(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments);
7279ImmutableArray<IArgumentOperation> arguments;
7283var builder = ArrayBuilder<IArgumentOperation>.GetInstance(propertySymbol.Parameters.Length);
7299arguments = ImmutableArray<IArgumentOperation>.Empty;
7387(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) =
7839matchFailureCtor, initializer: null, ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, operation.Syntax,
7947public override IOperation VisitArgument(IArgumentOperation operation, int? captureIdForResult)
7977isVirtual: true, arguments: ImmutableArray<IArgumentOperation>.Empty,
8079var visitedValue = new PropertyReferenceOperation(property, constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, oldInstance,
8105var target = new PropertyReferenceOperation(property, constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, implicitReceiver,
Microsoft.CodeAnalysis.Analyzers (42)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (27)
31using PooledLocalizabeStringsConcurrentDictionary = PooledConcurrentDictionary<INamedTypeSymbol, PooledConcurrentSet<(IFieldSymbol field, IArgumentOperation argument)>>;
528[NotNullWhen(returnValue: true)] out ImmutableArray<IArgumentOperation> creationArguments)
617ImmutableArray<IArgumentOperation> creationArguments,
625IArgumentOperation? titleArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("title", StringComparison.OrdinalIgnoreCase) == true);
639private static void AnalyzeTitleCore(string title, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic)
665IArgumentOperation argumentOperation,
720ImmutableArray<IArgumentOperation> creationArguments,
727var messageArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("messageFormat", StringComparison.OrdinalIgnoreCase) == true);
736private static void AnalyzeMessageCore(string message, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic)
767ImmutableArray<IArgumentOperation> creationArguments,
774IArgumentOperation? descriptionArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("description", StringComparison.OrdinalIgnoreCase) == true);
783private static void AnalyzeDescriptionCore(string description, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic)
804IArgumentOperation argument,
805Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeStringValueCore,
834var builder = localizableStringsMap.GetOrAdd(containingType, _ => PooledConcurrentSet<(IFieldSymbol, IArgumentOperation)>.GetInstance());
842Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeStringValueCore,
845IArgumentOperation argument,
860Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeLocalizableStringValueCore,
884IArgumentOperation argumentOperation,
1029ImmutableArray<IArgumentOperation> creationArguments,
1035foreach (var argument in creationArguments)
1056ImmutableArray<IArgumentOperation> creationArguments,
1066var argument = creationArguments.FirstOrDefault(
1107private static (bool? isEnabledByDefault, DiagnosticSeverity? defaultSeverity) GetDefaultSeverityAndEnabledByDefault(Compilation compilation, ImmutableArray<IArgumentOperation> creationArguments)
1115foreach (var argument in creationArguments)
1184ImmutableArray<IArgumentOperation> creationArguments,
1200foreach (var argument in creationArguments)
Microsoft.CodeAnalysis.AnalyzerUtilities (82)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (8)
164foreach (IArgumentOperation argumentOperation in operation.Arguments)
177foreach (IArgumentOperation argumentOperation in operation.Arguments)
456public override PropertySetAbstractValue VisitInvocation_NonLambdaOrDelegateOrLocalFunction(IMethodSymbol method, IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments, bool invokedAsDelegate, IOperation originalOperation, PropertySetAbstractValue defaultValue)
463foreach (IArgumentOperation visitedArgument in visitedArguments)
514ImmutableArray<IArgumentOperation> visitedArguments,
530foreach (IArgumentOperation argumentOperation in visitedArguments)
635public override PropertySetAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue)
643public override PropertySetAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (16)
252IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(operation.Arguments);
264ImmutableArray<IArgumentOperation> visitedArguments,
278IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments);
320IArgumentOperation? argumentOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == taintedTarget);
399IArgumentOperation? thenSanitizedTargetOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == thenSanitizedTarget);
423public override TaintedDataAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue)
428IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments);
437public override TaintedDataAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue)
442IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments);
460IArgumentOperation operation,
560IEnumerable<IArgumentOperation> taintedArguments,
568foreach (IArgumentOperation taintedArgument in taintedArguments)
631ImmutableArray<IArgumentOperation> arguments,
683private static bool IsMethodArgumentASink(IMethodSymbol method, IEnumerable<SinkInfo> infosForType, IArgumentOperation taintedArgument, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds)
753private IEnumerable<IArgumentOperation> GetTaintedArguments(ImmutableArray<IArgumentOperation> arguments)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (21)
49private readonly HashSet<IArgumentOperation> _pendingArgumentsToReset;
50private readonly List<IArgumentOperation> _pendingArgumentsToPostProcess;
977private bool IsContractCheckArgument(IArgumentOperation operation)
1216protected virtual TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue)
1491Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation));
1669case IArgumentOperation argument:
2205ImmutableArray<IArgumentOperation> arguments,
2402foreach (var argument in arguments)
2519foreach (var argument in arguments)
2550IParameterSymbol GetMappedParameterForArgument(IArgumentOperation argumentOperation)
2783foreach (IArgumentOperation argumentOperation in pendingArguments)
3072public sealed override TAbstractAnalysisValue VisitArgument(IArgumentOperation operation, object? argument)
3097protected virtual void PostProcessArgument(IArgumentOperation operation, bool isEscaped)
3104/// This method resets the analysis data for an object instance passed around as an <see cref="IArgumentOperation"/>
3107private void PostProcessEscapedArgument(IArgumentOperation operation)
3227void PostVisitInvocation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments)
3252void ProcessInterlockedOperation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments, INamedTypeSymbol interlockedType)
3267foreach (var argument in arguments)
3536ImmutableArray<IArgumentOperation> visitedArguments,
3578ImmutableArray<IArgumentOperation> visitedArguments,
3596ImmutableArray<IArgumentOperation> visitedArguments,
Microsoft.CodeAnalysis.CodeStyle (5)
Microsoft.CodeAnalysis.CSharp (24)
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
Microsoft.CodeAnalysis.CSharp.Features (6)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (11)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Microsoft.CodeAnalysis.Features (14)
Microsoft.CodeAnalysis.ResxSourceGenerator (9)
Microsoft.CodeAnalysis.VisualBasic (8)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (8)
Microsoft.CodeAnalysis.Workspaces (2)
Microsoft.Interop.ComInterfaceGenerator (4)
Microsoft.Interop.LibraryImportGenerator (8)
Microsoft.Interop.LibraryImportGenerator.Downlevel (4)
Roslyn.Diagnostics.Analyzers (10)
Roslyn.Diagnostics.CSharp.Analyzers (3)
System.Text.RegularExpressions.Generator (11)