1 implementation of IArgumentOperation
Microsoft.CodeAnalysis (1)
464 references to IArgumentOperation
Aspire.Hosting.Analyzers (2)
ConfigurationSchemaGenerator (4)
GenerateDocumentationAndConfigFiles (9)
ILLink.RoslynAnalyzer (9)
Metrics (9)
Metrics.Legacy (9)
Microsoft.Analyzers.Extra (6)
Microsoft.Analyzers.Local (1)
Microsoft.AspNetCore.App.Analyzers (16)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
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
4018/// which contains the elements as they appear in source. This will appear as the 'Value' of an <see cref="IArgumentOperation" />
5048internal RaiseEventOperation(IEventReferenceOperation eventReference, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit)
5055public ImmutableArray<IArgumentOperation> Arguments { get; }
5192internal InvocationOperation(IMethodSymbol targetMethod, ITypeSymbol? constrainedToType, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
5206public ImmutableArray<IArgumentOperation> Arguments { get; }
5494internal PropertyReferenceOperation(IPropertySymbol property, ITypeSymbol? constrainedToType, ImmutableArray<IArgumentOperation> arguments, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
5504public ImmutableArray<IArgumentOperation> Arguments { get; }
5955internal ObjectCreationOperation(IMethodSymbol? constructor, IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit)
5966public ImmutableArray<IArgumentOperation> Arguments { get; }
10328internal FunctionPointerInvocationOperation(IOperation target, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
10336public ImmutableArray<IArgumentOperation> Arguments { get; }
11226public override IOperation VisitArgument(IArgumentOperation operation, object? argument)
11568public virtual void VisitArgument(IArgumentOperation operation) => DefaultVisit(operation);
11708public virtual TResult? VisitArgument(IArgumentOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (46)
2037private ImmutableArray<IArgumentOperation> VisitArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed)
2045private void VisitAndPushArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed)
2092private IArgumentOperation RewriteArgumentFromArray(IOperation visitedArgument, int index, ImmutableArray<IArgumentOperation> args)
3346ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, value.Syntax,
3957private void HandleUsingOperationParts(IOperation resources, IOperation body, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, ImmutableArray<ILocalSymbol> locals, bool isAsynchronous,
4114private void AddDisposingFinally(IOperation resource, bool requiresRuntimeConversion, ITypeSymbol iDisposable, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, bool isAsynchronous)
4179ImmutableArray<IArgumentOperation> args;
4188args = ImmutableArray<IArgumentOperation>.Empty;
4233disposeArguments: ImmutableArray<IArgumentOperation>.Empty,
4247arguments: ImmutableArray<IArgumentOperation>.Empty,
4345ImmutableArray.Create<IArgumentOperation>(
4373ImmutableArray.Create<IArgumentOperation>(
4428ImmutableArray.Create<IArgumentOperation>(
4697InvocationOperation makeInvocationDroppingInstanceForStaticMethods(IMethodSymbol method, IOperation instance, ImmutableArray<IArgumentOperation> arguments)
4702InvocationOperation makeInvocation(SyntaxNode syntax, IMethodSymbol method, IOperation? instanceOpt, ImmutableArray<IArgumentOperation> arguments)
4712ImmutableArray<IArgumentOperation> makeArguments(ImmutableArray<IArgumentOperation> arguments, ref IOperation? instance)
4727return ImmutableArray<IArgumentOperation>.Empty;
4808var builder = ArrayBuilder<IArgumentOperation>.GetInstance(parametersCount, fillWithValue: null!);
5933(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments);
5948(IOperation visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) handlePointerAndArguments(
5949IOperation targetPointer, ImmutableArray<IArgumentOperation> arguments)
5953ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: false);
5960private (IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) VisitInstanceWithArguments(IOperation? instance, ImmutableArray<IArgumentOperation> arguments)
5968ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: hasInstance);
5986ImmutableArray<IArgumentOperation> visitedArgs = VisitArguments(operation.Arguments, instancePushed: false);
6245ImmutableArray<IArgumentOperation> propertyArguments = PopArray(propertyReference.Arguments, RewriteArgumentFromArray);
6305foreach (var argument in propertyReference.Arguments)
6402IOperation visitedTarget = new PropertyReferenceOperation(propertyReference.Property, propertyReference.ConstrainedToType, ImmutableArray<IArgumentOperation>.Empty, visitedPropertyInstance,
6548if (operation.ConstructArguments.Any(a => a is IArgumentOperation) && !operation.ConstructArguments.All(a => a is IArgumentOperation))
6554var arguments = operation.ConstructArguments.As<IArgumentOperation>();
6838IArgumentOperation? outParameterArgument = null;
7185(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments);
7267ImmutableArray<IArgumentOperation> arguments;
7271var builder = ArrayBuilder<IArgumentOperation>.GetInstance(propertySymbol.Parameters.Length);
7287arguments = ImmutableArray<IArgumentOperation>.Empty;
7375(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) =
7827matchFailureCtor, initializer: null, ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, operation.Syntax,
7935public override IOperation VisitArgument(IArgumentOperation operation, int? captureIdForResult)
7965isVirtual: true, arguments: ImmutableArray<IArgumentOperation>.Empty,
8067var visitedValue = new PropertyReferenceOperation(property, constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, oldInstance,
8093var 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\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\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\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.BannedApiAnalyzers (9)
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.IOperation.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Microsoft.CodeAnalysis.Features (14)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (9)
Microsoft.CodeAnalysis.PublicApiAnalyzers (9)
Microsoft.CodeAnalysis.ResxSourceGenerator (9)
Microsoft.CodeAnalysis.Test.Utilities (18)
Microsoft.CodeAnalysis.VisualBasic (8)
Microsoft.CodeAnalysis.Workspaces (2)
Microsoft.Extensions.Validation.ValidationsGenerator (5)
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)
Test.Utilities (9)
Text.Analyzers (9)