public override GlobalFlowStateAnalysisValueSet VisitInvocation_NonLambdaOrDelegateOrLocalFunction( IMethodSymbol method, IOperation?visitedInstance, ImmutableArray <IArgumentOperation> visitedArguments, bool invokedAsDelegate, IOperation originalOperation, GlobalFlowStateAnalysisValueSet defaultValue) { var value = base.VisitInvocation_NonLambdaOrDelegateOrLocalFunction(method, visitedInstance, visitedArguments, invokedAsDelegate, originalOperation, defaultValue); if (_platformCheckMethods.Contains(method.OriginalDefinition)) { using var infosBuilder = ArrayBuilder <PlatformMethodValue> .GetInstance(); if (PlatformMethodValue.TryDecode(method, visitedArguments, DataFlowAnalysisContext.ValueContentAnalysisResult, _osPlatformType, infosBuilder)) { for (var i = 0; i < infosBuilder.Count; i++) { var newValue = new GlobalFlowStateAnalysisValueSet(infosBuilder[i]); value = i == 0 ? newValue : new GlobalFlowStateAnalysisValueSet(value, newValue); } return(value); } return(GlobalFlowStateAnalysisValueSet.Unknown); } return(GetValueOrDefault(value)); }
public override GlobalFlowStateAnalysisValueSet VisitInvocation_NonLambdaOrDelegateOrLocalFunction( IMethodSymbol method, IOperation?visitedInstance, ImmutableArray <IArgumentOperation> visitedArguments, bool invokedAsDelegate, IOperation originalOperation, GlobalFlowStateAnalysisValueSet defaultValue) { var value = base.VisitInvocation_NonLambdaOrDelegateOrLocalFunction(method, visitedInstance, visitedArguments, invokedAsDelegate, originalOperation, defaultValue); if (_platformCheckMethods.Contains(method.OriginalDefinition)) { return(PlatformMethodValue.TryDecode(method, visitedArguments, DataFlowAnalysisContext.ValueContentAnalysisResult, _osPlatformType, out var platformInfo) ? new GlobalFlowStateAnalysisValueSet(platformInfo) : GlobalFlowStateAnalysisValueSet.Unknown); } return(GetValueOrDefault(value)); }