1 implementation of IArgumentOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
7912internal sealed partial class ArgumentOperation : Operation, IArgumentOperation
499 references to IArgumentOperation
Aspire.Hosting.Analyzers (2)
AppHostAnalyzer.cs (2)
121IArgumentOperation? argumentOperation = null; 122foreach (var argument in invocation.Arguments)
ConfigurationSchemaGenerator (4)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (4)
81IArgumentOperation instanceArg = GetArgumentForParameterAtIndex(operation.Arguments, instanceIndex); 120private static IArgumentOperation GetArgumentForParameterAtIndex(ImmutableArray<IArgumentOperation> arguments, int parameterIndex) 122foreach (var argument in arguments)
ILLink.RoslynAnalyzer (9)
DataFlow\FeatureChecksVisitor.cs (1)
43 public override FeatureChecksValue VisitArgument (IArgumentOperation operation, StateValue state)
DataFlow\LocalDataFlowVisitor.cs (7)
183 return ProcessMethodCall (operation, method, null, ImmutableArray<IArgumentOperation>.Empty, state); 278 foreach (var val in propertyRef.Arguments) 615 foreach (var val in operation.Arguments) 679 public override TValue VisitArgument (IArgumentOperation operation, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state) 771 IArgumentOperation argumentOperation; 803 ImmutableArray<IArgumentOperation> arguments, 809 foreach (var argument in arguments) {
IOperationExtensions.cs (1)
124 } else if (operation.Parent is IArgumentOperation argumentOperation) {
Metrics (17)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
Metrics.Legacy (17)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
Microsoft.Analyzers.Extra (6)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
209foreach (var argument in invocation.Arguments)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (3)
398var paramsArg = invocationOp.Arguments[details.ArgsParamIndex]; 447var paramsArg = invocationOp.Arguments[details.ArgsParamIndex]; 480foreach (var arg in invocation!.Arguments)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
44var op = invocationOp.Arguments[MessageParamIndex];
UsingToStringInLoggersAnalyzer.cs (1)
64foreach (var arg in invocation.Arguments)
Microsoft.Analyzers.Local (1)
CallAnalysis\ToInvariantString.cs (1)
41var a = op.Arguments[0];
Microsoft.AspNetCore.App.Analyzers (16)
Authorization\AddAuthorizationBuilderAnalyzer.cs (3)
70if (TryGetConfigureArgumentOperation(invocation, out var configureArgumentOperation) 88private static bool TryGetConfigureArgumentOperation(IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? configureArgumentOperation) 101private static bool TryGetConfigureDelegateCreationOperation(IArgumentOperation configureArgumentOperation, [NotNullWhen(true)] out IDelegateCreationOperation? configureDelegateCreationOperation)
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
47var addressArgument = kestrelOptionsListenInvocation?.Arguments.FirstOrDefault();
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
39foreach (var argument in invocation.Arguments)
RouteHandlers\DetectAmbiguousRoutes.cs (5)
62if (current.Parent is IArgumentOperation { Parent: IInvocationOperation invocationOperation } && 77IArgumentOperation or 235private static bool AreArgumentsEqual(IMethodSymbol method, ImmutableArray<IArgumentOperation> arguments1, ImmutableArray<IArgumentOperation> arguments2) 271static IOperation? GetParameterArgument(IParameterSymbol parameter, ImmutableArray<IArgumentOperation> arguments)
RouteHandlers\RouteHandlerAnalyzer.cs (4)
78foreach (var argument in invocation.Arguments) 175IArgumentOperation? argumentOperation = null; 176foreach (var argument in invocation.Arguments) 227var builderArgument = operation.Arguments.SingleOrDefault(a => a.Parameter?.Ordinal == 0);
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
366foreach (var argument in invocation.Arguments)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (5)
32targetOperation.TryGetRouteHandlerArgument(out var routeHandlerParameter) && 45if (invocation.TryGetRouteHandlerArgument(out var argument)) 53public static bool TryGetRouteHandlerArgument(this IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? argumentOperation) 59foreach (var argument in invocation.Arguments) 85IArgumentOperation argument => ResolveMethodFromOperation(argument.Value, semanticModel),
Microsoft.AspNetCore.Http.ValidationsGenerator (5)
src\Http\Http.Extensions\gen\Microsoft.AspNetCore.Http.RequestDelegateGenerator\StaticRouteHandlerModel\InvocationOperationExtensions.cs (5)
32targetOperation.TryGetRouteHandlerArgument(out var routeHandlerParameter) && 45if (invocation.TryGetRouteHandlerArgument(out var argument)) 53public static bool TryGetRouteHandlerArgument(this IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? argumentOperation) 59foreach (var argument in invocation.Arguments) 85IArgumentOperation argument => ResolveMethodFromOperation(argument.Value, semanticModel),
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
ActualApiResponseMetadataFactory.cs (2)
191private static (int? statusCode, ITypeSymbol? returnType) InspectMethodArguments(ImmutableArray<IArgumentOperation> arguments) 196foreach (var argument in arguments)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
Microsoft.CodeAnalysis (72)
Generated\OperationKind.Generated.cs (1)
181/// <summary>Indicates an <see cref="IArgumentOperation"/>.</summary>
Generated\Operations.Generated.cs (18)
663ImmutableArray<IArgumentOperation> Arguments { get; } 797ImmutableArray<IArgumentOperation> Arguments { get; } 1006ImmutableArray<IArgumentOperation> Arguments { get; } 1291ImmutableArray<IArgumentOperation> Arguments { get; } 3756ImmutableArray<IArgumentOperation> Arguments { get; } 5010internal RaiseEventOperation(IEventReferenceOperation eventReference, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5017public ImmutableArray<IArgumentOperation> Arguments { get; } 5154internal InvocationOperation(IMethodSymbol targetMethod, ITypeSymbol? constrainedToType, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5168public ImmutableArray<IArgumentOperation> Arguments { get; } 5456internal PropertyReferenceOperation(IPropertySymbol property, ITypeSymbol? constrainedToType, ImmutableArray<IArgumentOperation> arguments, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5466public ImmutableArray<IArgumentOperation> Arguments { get; } 5917internal ObjectCreationOperation(IMethodSymbol? constructor, IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5928public ImmutableArray<IArgumentOperation> Arguments { get; } 10290internal FunctionPointerInvocationOperation(IOperation target, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10298public ImmutableArray<IArgumentOperation> Arguments { get; } 11156public override IOperation VisitArgument(IArgumentOperation operation, object? argument) 11493public virtual void VisitArgument(IArgumentOperation operation) => DefaultVisit(operation); 11632public virtual TResult? VisitArgument(IArgumentOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (43)
2035private ImmutableArray<IArgumentOperation> VisitArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed) 2043private void VisitAndPushArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed) 2090private IArgumentOperation RewriteArgumentFromArray(IOperation visitedArgument, int index, ImmutableArray<IArgumentOperation> args) 3344ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, value.Syntax, 3955private void HandleUsingOperationParts(IOperation resources, IOperation body, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, ImmutableArray<ILocalSymbol> locals, bool isAsynchronous, 4112private void AddDisposingFinally(IOperation resource, bool requiresRuntimeConversion, ITypeSymbol iDisposable, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, bool isAsynchronous) 4177ImmutableArray<IArgumentOperation> args; 4186args = ImmutableArray<IArgumentOperation>.Empty; 4231disposeArguments: ImmutableArray<IArgumentOperation>.Empty, 4245arguments: ImmutableArray<IArgumentOperation>.Empty, 4343ImmutableArray.Create<IArgumentOperation>( 4371ImmutableArray.Create<IArgumentOperation>( 4426ImmutableArray.Create<IArgumentOperation>( 4695InvocationOperation makeInvocationDroppingInstanceForStaticMethods(IMethodSymbol method, IOperation instance, ImmutableArray<IArgumentOperation> arguments) 4700InvocationOperation makeInvocation(SyntaxNode syntax, IMethodSymbol method, IOperation? instanceOpt, ImmutableArray<IArgumentOperation> arguments) 4710ImmutableArray<IArgumentOperation> makeArguments(ImmutableArray<IArgumentOperation> arguments, ref IOperation? instance) 4725return ImmutableArray<IArgumentOperation>.Empty; 4806var builder = ArrayBuilder<IArgumentOperation>.GetInstance(parametersCount, fillWithValue: null!); 5931(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments); 5946(IOperation visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) handlePointerAndArguments( 5947IOperation targetPointer, ImmutableArray<IArgumentOperation> arguments) 5951ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: false); 5958private (IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) VisitInstanceWithArguments(IOperation? instance, ImmutableArray<IArgumentOperation> arguments) 5966ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: hasInstance); 5984ImmutableArray<IArgumentOperation> visitedArgs = VisitArguments(operation.Arguments, instancePushed: false); 6243ImmutableArray<IArgumentOperation> propertyArguments = PopArray(propertyReference.Arguments, RewriteArgumentFromArray); 6303foreach (var argument in propertyReference.Arguments) 6400IOperation visitedTarget = new PropertyReferenceOperation(propertyReference.Property, propertyReference.ConstrainedToType, ImmutableArray<IArgumentOperation>.Empty, visitedPropertyInstance, 6814IArgumentOperation? outParameterArgument = null; 7161(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments); 7243ImmutableArray<IArgumentOperation> arguments; 7247var builder = ArrayBuilder<IArgumentOperation>.GetInstance(propertySymbol.Parameters.Length); 7263arguments = ImmutableArray<IArgumentOperation>.Empty; 7351(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = 7797matchFailureCtor, initializer: null, ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, operation.Syntax, 7905public override IOperation VisitArgument(IArgumentOperation operation, int? captureIdForResult) 7935isVirtual: true, arguments: ImmutableArray<IArgumentOperation>.Empty, 8037var visitedValue = new PropertyReferenceOperation(property, constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, oldInstance, 8063var target = new PropertyReferenceOperation(property, constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, implicitReceiver,
Operations\DisposeOperationInfo.cs (2)
12public readonly ImmutableArray<IArgumentOperation> DisposeArguments; 14public DisposeOperationInfo(IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments)
Operations\Loops\ForEachLoopOperationInfo.cs (8)
38public readonly ImmutableArray<IArgumentOperation> GetEnumeratorArguments; 39public readonly ImmutableArray<IArgumentOperation> MoveNextArguments; 40public readonly ImmutableArray<IArgumentOperation> CurrentArguments; 41public readonly ImmutableArray<IArgumentOperation> DisposeArguments; 56ImmutableArray<IArgumentOperation> getEnumeratorArguments = default, 57ImmutableArray<IArgumentOperation> moveNextArguments = default, 58ImmutableArray<IArgumentOperation> currentArguments = default, 59ImmutableArray<IArgumentOperation> disposeArguments = default)
Microsoft.CodeAnalysis.Analyzers (50)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (1)
263foreach (var argument in invocation.Arguments)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (27)
26using PooledLocalizabeStringsConcurrentDictionary = PooledConcurrentDictionary<INamedTypeSymbol, PooledConcurrentSet<(IFieldSymbol field, IArgumentOperation argument)>>; 525[NotNullWhen(returnValue: true)] out ImmutableArray<IArgumentOperation> creationArguments) 614ImmutableArray<IArgumentOperation> creationArguments, 622IArgumentOperation? titleArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("title", StringComparison.OrdinalIgnoreCase) == true); 636private static void AnalyzeTitleCore(string title, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic) 662IArgumentOperation argumentOperation, 718ImmutableArray<IArgumentOperation> creationArguments, 725var messageArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("messageFormat", StringComparison.OrdinalIgnoreCase) == true); 734private static void AnalyzeMessageCore(string message, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic) 765ImmutableArray<IArgumentOperation> creationArguments, 772IArgumentOperation? descriptionArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("description", StringComparison.OrdinalIgnoreCase) == true); 781private static void AnalyzeDescriptionCore(string description, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic) 802IArgumentOperation argument, 803Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeStringValueCore, 832var builder = localizableStringsMap.GetOrAdd(containingType, _ => PooledConcurrentSet<(IFieldSymbol, IArgumentOperation)>.GetInstance()); 840Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeStringValueCore, 843IArgumentOperation argument, 858Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeLocalizableStringValueCore, 882IArgumentOperation argumentOperation, 1027ImmutableArray<IArgumentOperation> creationArguments, 1033foreach (var argument in creationArguments) 1054ImmutableArray<IArgumentOperation> creationArguments, 1064var argument = creationArguments.FirstOrDefault( 1105private static (bool? isEnabledByDefault, DiagnosticSeverity? defaultSeverity) GetDefaultSeverityAndEnabledByDefault(Compilation compilation, ImmutableArray<IArgumentOperation> creationArguments) 1113foreach (var argument in creationArguments) 1182ImmutableArray<IArgumentOperation> creationArguments, 1198foreach (var argument in creationArguments)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (3)
66IArgumentOperation argument, 137ImmutableArray<IArgumentOperation> creationArguments, 146foreach (var argument in creationArguments)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (1)
274IArgumentOperation ruleIdArgument,
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (1)
116ImmutableArray<IArgumentOperation> arguments, bool isUsedAsExtensionMethod, Func<SyntaxGenerator, IEnumerable<SyntaxNode>, SyntaxNode> getReplacementNode,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
Microsoft.CodeAnalysis.AnalyzerUtilities (92)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (1)
318protected override CopyAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, CopyAbstractValue defaultValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (3)
186protected override DisposeAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, DisposeAbstractValue defaultValue) 258ImmutableArray<IArgumentOperation> visitedArguments, 325protected override void PostProcessArgument(IArgumentOperation operation, bool isEscaped)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
160operation.Parent is IArgumentOperation argument && argument.Parameter?.RefKind == RefKind.Out) &&
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateValueSetFlowOperationVisitor.cs (1)
111ImmutableArray<IArgumentOperation> visitedArguments,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (6)
252ImmutableArray<IArgumentOperation> visitedArguments, 264ImmutableArray<IArgumentOperation> visitedArguments, 275ImmutableArray<IArgumentOperation> visitedArguments, 284private void ProcessRegularInvocationOrCreation(IMethodSymbol? targetMethod, ImmutableArray<IArgumentOperation> arguments, IOperation operation) 323foreach (var argument in arguments) 342foreach (var argument in arguments)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (6)
285protected override PointsToAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, PointsToAbstractValue defaultValue) 298protected override void PostProcessArgument(IArgumentOperation operation, bool isEscaped) 941ImmutableArray<IArgumentOperation> visitedArguments, 952foreach (var argument in visitedArguments) 1026ImmutableArray<IArgumentOperation> visitedArguments, 1036ImmutableArray<IArgumentOperation> visitedArguments,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (8)
162foreach (IArgumentOperation argumentOperation in operation.Arguments) 175foreach (IArgumentOperation argumentOperation in operation.Arguments) 454public override PropertySetAbstractValue VisitInvocation_NonLambdaOrDelegateOrLocalFunction(IMethodSymbol method, IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments, bool invokedAsDelegate, IOperation originalOperation, PropertySetAbstractValue defaultValue) 461foreach (IArgumentOperation visitedArgument in visitedArguments) 512ImmutableArray<IArgumentOperation> visitedArguments, 528foreach (IArgumentOperation argumentOperation in visitedArguments) 633public override PropertySetAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue) 641public override PropertySetAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\SourceInfo.cs (1)
16internal delegate bool MethodMatcher(string methodName, ImmutableArray<IArgumentOperation> arguments);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (16)
251IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(operation.Arguments); 263ImmutableArray<IArgumentOperation> visitedArguments, 277IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 319IArgumentOperation? argumentOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == taintedTarget); 398IArgumentOperation? thenSanitizedTargetOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == thenSanitizedTarget); 422public override TaintedDataAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue) 427IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 436public override TaintedDataAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue) 441IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 459IArgumentOperation operation, 559IEnumerable<IArgumentOperation> taintedArguments, 567foreach (IArgumentOperation taintedArgument in taintedArguments) 630ImmutableArray<IArgumentOperation> arguments, 682private static bool IsMethodArgumentASink(IMethodSymbol method, IEnumerable<SinkInfo> infosForType, IArgumentOperation taintedArgument, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds) 752private IEnumerable<IArgumentOperation> GetTaintedArguments(ImmutableArray<IArgumentOperation> arguments)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMapExtensions.cs (2)
37ImmutableArray<IArgumentOperation> arguments, 185ImmutableArray<IArgumentOperation> arguments,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysis.ValueContentDataFlowOperationVisitor.cs (1)
273ImmutableArray<IArgumentOperation> visitedArguments,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (2)
163_ => ImmutableArray<IArgumentOperation>.Empty, 166foreach (var argument in arguments)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocationDataFlowOperationVisitor.cs (1)
67protected override TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (2)
64protected sealed override TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue) 80protected virtual TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, TAbstractAnalysisValue defaultValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (1)
197case IArgumentOperation argument:
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (23)
47private readonly HashSet<IArgumentOperation> _pendingArgumentsToReset; 48private readonly List<IArgumentOperation> _pendingArgumentsToPostProcess; 275_pendingArgumentsToReset = new HashSet<IArgumentOperation>(); 276_pendingArgumentsToPostProcess = new List<IArgumentOperation>(); 975private bool IsContractCheckArgument(IArgumentOperation operation) 1214protected virtual TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue) 1489Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation)); 1667case IArgumentOperation argument: 2203ImmutableArray<IArgumentOperation> arguments, 2400foreach (var argument in arguments) 2517foreach (var argument in arguments) 2548IParameterSymbol GetMappedParameterForArgument(IArgumentOperation argumentOperation) 2781foreach (IArgumentOperation argumentOperation in pendingArguments) 3070public sealed override TAbstractAnalysisValue VisitArgument(IArgumentOperation operation, object? argument) 3095protected virtual void PostProcessArgument(IArgumentOperation operation, bool isEscaped) 3102/// This method resets the analysis data for an object instance passed around as an <see cref="IArgumentOperation"/> 3105private void PostProcessEscapedArgument(IArgumentOperation operation) 3225void PostVisitInvocation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments) 3250void ProcessInterlockedOperation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments, INamedTypeSymbol interlockedType) 3265foreach (var argument in arguments) 3534ImmutableArray<IArgumentOperation> visitedArguments, 3576ImmutableArray<IArgumentOperation> visitedArguments, 3594ImmutableArray<IArgumentOperation> visitedArguments,
Microsoft.CodeAnalysis.BannedApiAnalyzers (17)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
Microsoft.CodeAnalysis.CodeStyle (5)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
61conversion.Parent is IArgumentOperation { Parent: IInvocationOperation invocation } &&
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (2)
174return Unwrap(interpolatedStringOperation?.Parent, towardsParent: true) is IArgumentOperation 261private static bool IsSpaceChar(IArgumentOperation argument)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Microsoft.CodeAnalysis.CSharp (24)
Operations\CSharpOperationFactory.cs (12)
457ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundCall); 615var arguments = ImmutableArray<IArgumentOperation>.Empty; 637ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundIndexerAccess); 730ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundObjectCreationExpression); 879ImmutableArray<IArgumentOperation> arguments; 897arguments = ImmutableArray<IArgumentOperation>.Empty; 927ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundCollectionElementInitializer); 1932ImmutableArray<IArgumentOperation> createArgumentOperations(MethodArgumentInfo? info) 1940return ImmutableArray<IArgumentOperation>.Empty; 2907reference = new PropertyReferenceOperation(property.GetPublicSymbol(), constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, 2940private ImmutableArray<IArgumentOperation> CreateDisposeArguments(MethodArgumentInfo patternDisposeInfo) 2947return ImmutableArray<IArgumentOperation>.Empty;
Operations\CSharpOperationFactory_Methods.cs (12)
36internal IArgumentOperation CreateArgumentOperation(ArgumentKind kind, IParameterSymbol? parameter, BoundExpression expression) 194internal ImmutableArray<IArgumentOperation> DeriveArguments(BoundNode containingExpression) 264private ImmutableArray<IArgumentOperation> DeriveArguments( 276return ImmutableArray<IArgumentOperation>.Empty; 288private static ImmutableArray<IArgumentOperation> MakeArgumentsInEvaluationOrder( 308ArrayBuilder<IArgumentOperation> argumentsBuilder = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length); 359private static ImmutableArray<IArgumentOperation> BuildArgumentsInEvaluationOrder( 368ArrayBuilder<IArgumentOperation> argumentsInEvaluationBuilder = ArrayBuilder<IArgumentOperation>.GetInstance(parameters.Length); 443arguments: ImmutableArray<IArgumentOperation>.Empty, 455ImmutableArray<IArgumentOperation>.Empty,
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
24=> invocation.Parent is IArgumentOperation { Parent: IInvocationOperation nextInvocation } ? nextInvocation : null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1500var argument = invocationOperation.Arguments.FirstOrDefault(a => Equals(originalParameter, a.Parameter));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
239var argumentOp = invocationOp.Arguments.FirstOrDefault(a => a.Syntax == argument);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (5)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 303foreach (var arg in args) 373Arguments: ImmutableArray<IArgumentOperation> { IsEmpty: true }, 632Arguments: [IArgumentOperation { Value: IOperation arg }]
Microsoft.CodeAnalysis.CSharp.Features (6)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
24=> invocation.Parent is IArgumentOperation { Parent: IInvocationOperation nextInvocation } ? nextInvocation : null;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (5)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 303foreach (var arg in args) 373Arguments: ImmutableArray<IArgumentOperation> { IsEmpty: true }, 632Arguments: [IArgumentOperation { Value: IOperation arg }]
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IArgument.cs (2)
3069var argument = invocation.Arguments[0]; 4157foreach (var argument in operation.Arguments)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1500var argument = invocationOperation.Arguments.FirstOrDefault(a => Equals(originalParameter, a.Parameter));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
239var argumentOp = invocationOp.Arguments.FirstOrDefault(a => a.Syntax == argument);
Microsoft.CodeAnalysis.Features (14)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
5673? (oldModel.GetOperation(oldLambda.Parent, cancellationToken) as IArgumentOperation)?.Parameter
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (5)
430private static async Task<ImmutableArray<IArgumentOperation>> GetArgumentsReadOnlyOnceAsync( 432ImmutableArray<IArgumentOperation> arguments, 436using var _ = ArrayBuilder<IArgumentOperation>.GetInstance(out var builder); 437foreach (var argument in arguments) 497IArgumentOperation argumentOperation)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
61conversion.Parent is IArgumentOperation { Parent: IInvocationOperation invocation } &&
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (2)
174return Unwrap(interpolatedStringOperation?.Parent, towardsParent: true) is IArgumentOperation 261private static bool IsSpaceChar(IArgumentOperation argument)
ValueTracking\ValueTracker.OperationCollector.cs (5)
31IArgumentOperation argumentOperation => ShouldTrackArgument(argumentOperation) ? VisitAsync(argumentOperation.Value, cancellationToken) : Task.CompletedTask, 118if (IsContainedIn<IArgumentOperation>(operation, out var argumentOperation) && argumentOperation.Parameter is not null) 181private async Task TrackArgumentsAsync(ImmutableArray<IArgumentOperation> argumentOperations, CancellationToken cancellationToken) 228private static bool ShouldTrackArgument(IArgumentOperation argumentOperation)
Microsoft.CodeAnalysis.ResxSourceGenerator (17)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
Microsoft.CodeAnalysis.Test.Utilities (16)
Compilation\ControlFlowGraphVerifier.cs (1)
901while (containingArgument is not (null or IArgumentOperation));
Compilation\OperationTreeVerifier.cs (3)
849private void VisitArguments(ImmutableArray<IArgumentOperation> arguments) 911public override void VisitArgument(IArgumentOperation operation) 913LogString($"{nameof(IArgumentOperation)} (");
Compilation\TestOperationVisitor.cs (3)
345void visitArguments(ImmutableArray<IArgumentOperation> arguments) 349foreach (IArgumentOperation arg in arguments) 576public override void VisitArgument(IArgumentOperation operation)
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
88foreach (IArgumentOperation argument in invocation.Arguments)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
76foreach (IArgumentOperation argument in invocation.Arguments)
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
69foreach (IArgumentOperation argument in invocation.Arguments)
Diagnostics\OperationTestAnalyzer.cs (6)
545foreach (IArgumentOperation argument in invocation.Arguments) 667var argument = (IArgumentOperation)operationContext.Operation; 1102foreach (IArgumentOperation argument in invocation.Arguments) 1129foreach (IArgumentOperation argument in creation.Arguments) 1737if (((IArgumentOperation)operation).ArgumentKind == ArgumentKind.ParamArray)
Microsoft.CodeAnalysis.VisualBasic (8)
VisualBasicExtensions.vb (8)
1398''' Gets the underlying <see cref="Conversion"/> information for InConversion of <see cref="IArgumentOperation"/> that was created from Visual Basic code. 1402''' <exception cref="ArgumentException">If the <see cref="IArgumentOperation"/> was not created from Visual Basic code.</exception> 1404Public Function GetInConversion(argument As IArgumentOperation) As Conversion 1410NameOf(IArgumentOperation)), 1416''' Gets the underlying <see cref="Conversion"/> information for OutConversion of <see cref="IArgumentOperation"/> that was created from Visual Basic code. 1420''' <exception cref="ArgumentException">If the <see cref="IArgumentOperation"/> was not created from Visual Basic code.</exception> 1422Public Function GetOutConversion(argument As IArgumentOperation) As Conversion 1428NameOf(IArgumentOperation)),
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Microsoft.Interop.ComInterfaceGenerator (4)
src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (4)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal) 19foreach (IArgumentOperation argument in operation.Arguments) 28public static IArgumentOperation? GetArgumentByOrdinal(this IObjectCreationOperation operation, int ordinal) 35foreach (IArgumentOperation argument in operation.Arguments)
Microsoft.Interop.LibraryImportGenerator (8)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (3)
649IArgumentOperation? managedTypeArgument = attrCreation.GetArgumentByOrdinal(0); 670IArgumentOperation? marshallerTypeArgument = attrCreation.GetArgumentByOrdinal(2); 688var marshalModeArgument = attrCreation.GetArgumentByOrdinal(1);
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
90IArgumentOperation marshallerEntryPointTypeArgument = attrCreation.GetArgumentByOrdinal(0);
src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (4)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal) 19foreach (IArgumentOperation argument in operation.Arguments) 28public static IArgumentOperation? GetArgumentByOrdinal(this IObjectCreationOperation operation, int ordinal) 35foreach (IArgumentOperation argument in operation.Arguments)
Microsoft.Interop.LibraryImportGenerator.Downlevel (4)
src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (4)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal) 19foreach (IArgumentOperation argument in operation.Arguments) 28public static IArgumentOperation? GetArgumentByOrdinal(this IObjectCreationOperation operation, int ordinal) 35foreach (IArgumentOperation argument in operation.Arguments)
Roslyn.Diagnostics.Analyzers (18)
AbstractDoNotCopyValue.cs (1)
393public override void VisitArgument(IArgumentOperation operation)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
Roslyn.Diagnostics.CSharp.Analyzers (1)
CSharpDoNotUseDebugAssertForInterpolatedStrings.cs (1)
68invocation.Arguments is [_, IArgumentOperation { Value: IInterpolatedStringOperation { ConstantValue.HasValue: false } }])
System.Text.RegularExpressions.Generator (9)
UpgradeToGeneratedRegexAnalyzer.cs (2)
152private static bool ValidateParameters(ImmutableArray<IArgumentOperation> arguments) 164IArgumentOperation argument = arguments[i];
UpgradeToGeneratedRegexCodeFixer.cs (7)
161ImmutableArray<IArgumentOperation> operationArguments; 255static string? GetRegexPatternFromArgument(ImmutableArray<IArgumentOperation> arguments) 257IArgumentOperation? patternArgument = arguments.SingleOrDefault(arg => arg.Parameter?.Name == UpgradeToGeneratedRegexAnalyzer.PatternArgumentName); 266static RegexOptions GetRegexOptionsFromArgument(ImmutableArray<IArgumentOperation> arguments) 268IArgumentOperation? optionsArgument = arguments.SingleOrDefault(arg => arg.Parameter?.Name == UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName); 276static SyntaxNode? GetNode(ImmutableArray<IArgumentOperation> arguments, SyntaxGenerator generator, string parameterName) 278IArgumentOperation? argument = arguments.SingleOrDefault(arg => arg.Parameter?.Name == parameterName);
Test.Utilities (17)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
Text.Analyzers (17)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
40var firstArg = invocation.Arguments.FirstOrDefault(); 787foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 853this ImmutableArray<IArgumentOperation> arguments, 855[NotNullWhen(true)] out IArgumentOperation? result) 860foreach (var argument in arguments) 873public static IArgumentOperation GetArgumentForParameterAtIndex( 874this ImmutableArray<IArgumentOperation> arguments, 877if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 890public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 891this ImmutableArray<IArgumentOperation> arguments) 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 895foreach (var argument in arguments) 1025else if (operation.Parent is IArgumentOperation argumentOperation)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 54public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);