12 instantiations of Versions
Microsoft.CodeAnalysis.NetAnalyzers (12)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (10)
738csAttributes.Add(info.PlatformName, new Versions() { SupportedFirst = info.Version, UnsupportedFirst = unsupportedVersion }); 761csAttributes.Add(info.PlatformName, new Versions() { UnsupportedFirst = info.Version }); 1459copiedAttributes.Add(platformName, CopyAllAttributes(new Versions(), attributes)); 1472copy.Platforms!.Add(platformName, CopyAllAttributes(new Versions(), attributes)); 1485copy.Add(platformName, CopyAllAttributes(new Versions(), attributes)); 1519var diagnosticAttribute = new Versions(); 1690diagnosticAttribute = new Versions(); 1723diagnosticAttribute = new Versions(); 2065attributes[platformName] = new Versions(); 2076attributes[relation.relatedPlatform] = new Versions();
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.OperationVisitor.cs (2)
98versions = new Versions(); 240versions = new Versions();
120 references to Versions
Microsoft.CodeAnalysis.NetAnalyzers (120)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (111)
326(SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions>? csAttributes)>.GetInstance(); 411private static bool HasGuardedLambdaOrLocalFunctionResult(IOperation platformSpecificOperation, SmallDictionary<string, Versions> attributes, 412ref SmallDictionary<string, Versions>? csAttributes, DataFlowAnalysisResult<GlobalFlowStateBlockAnalysisResult, 413GlobalFlowStateAnalysisValueSet> analysisResult, SmallDictionary<string, Versions>? originalCsAttributes, SmallDictionary<string, Versions> originalAttributes) 480private static bool IsKnownValueGuarded(SmallDictionary<string, Versions> attributes, 481ref SmallDictionary<string, Versions>? csAttributes, GlobalFlowStateAnalysisValueSet value, 482SmallDictionary<string, Versions>? originalCsAttributes, SmallDictionary<string, Versions> originalAttributes) 488SmallDictionary<string, Versions> attributes, 489ref SmallDictionary<string, Versions>? csAttributes, 492SmallDictionary<string, Versions>? originalCsAttributes, 493SmallDictionary<string, Versions> originalAttributes) 500if (attributes.TryGetValue(info.PlatformName, out var attribute)) 659static bool IsPlatformSupportWasSuppresed(PlatformMethodValue parentValue, SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions> originalAttributes) 661originalAttributes.TryGetValue(parentValue.PlatformName, out Versions? version) && 664static bool IsOnlySupportNeedsGuard(string platformName, SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions> csAttributes) 665=> csAttributes.TryGetValue(platformName, out var versions) && 670static bool IsNegationOfCallsiteAttributes(SmallDictionary<string, Versions> csAttributes, ImmutableHashSet<IAbstractAnalysisValue> parentValues) 678if (csAttributes.TryGetValue(info.PlatformName, out var version)) 718static SmallDictionary<string, Versions> SetCallSiteSupportedAttribute(SmallDictionary<string, Versions>? csAttributes, 721csAttributes ??= new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase); 723if (csAttributes.TryGetValue(info.PlatformName, out var attributes)) 744static SmallDictionary<string, Versions> SetCallSiteUnsupportedAttribute(SmallDictionary<string, Versions>? csAttributes, PlatformMethodValue info) 746csAttributes ??= new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase); 748if (csAttributes.TryGetValue(info.PlatformName, out var attributes)) 767static void RemoveUnsupportsOnDifferentPlatforms(SmallDictionary<string, Versions> attributes, string platformName) 789static void RemoveUnsupportedWithLessVersion(Version supportedVersion, Versions attribute) 797static void RemoveOtherSupportsOnDifferentPlatforms(SmallDictionary<string, Versions> attributes, string platformName) 812private static void ReportDiagnostics(IOperation operation, SmallDictionary<string, Versions> attributes, 813SmallDictionary<string, Versions>? csAttributes, OperationBlockAnalysisContext context, 814ISymbol symbol, SmallDictionary<string, Versions> originalAttributes) 818foreach (var attribute in originalAttributes.Values) 833SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions>? callsiteAttributes) 863static bool IsDenyList(SmallDictionary<string, Versions>? callsiteAttributes) => 866static bool GetSupportedPlatforms(SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions>? csAttributes, 972static string AppendMessage(Versions attribute, string message) 982static string AppendMessageAndUrl(Versions attribute, string message) 1003SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions>? callsiteAttributes) 1018static bool GetPlatformNames(SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions>? csAttributes, 1037if (csAttributes == null || (csAttributes.TryGetValue(pName, out var csAttribute) && 1103static void AddObsoleted(SmallDictionary<string, Versions>? csAttributes, ArrayBuilder<string> obsoletedBuilder, string pName, Versions pAttribute) 1125static ImmutableArray<string> GetCallsitePlatforms(SmallDictionary<string, Versions> attributes, 1126SmallDictionary<string, Versions>? callsiteAttributes, out Callsite callsite, bool supported) 1181if (unsupportedVersion != null && attributes.TryGetValue(pName, out var attribute)) 1235static bool HasSameVersionedPlatformSupport(SmallDictionary<string, Versions> attributes, string pName, bool checkSupport) 1237if (attributes.TryGetValue(pName, out var attribute)) 1258static bool HasVersionedCallsite(SmallDictionary<string, Versions> csAttributes, string pName) 1260if (csAttributes.TryGetValue(pName, out var attribute)) 1336(SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions>? csAttributes)> platformSpecificOperations, 1451private static bool TryCopyAttributesNotSuppressedByMsBuild(SmallDictionary<string, Versions> operationAttributes, 1452ImmutableArray<string> msBuildPlatforms, out SmallDictionary<string, Versions> copiedAttributes) 1454copiedAttributes = new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase); 1468var copy = new PlatformAttributes(copyAttributes.Callsite, new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase)); 1479private static SmallDictionary<string, Versions> CopyAttributes(SmallDictionary<string, Versions> copyAttributes) 1481var copy = new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase); 1510private static bool IsNotSuppressedByCallSite(SmallDictionary<string, Versions> operationAttributes, 1511SmallDictionary<string, Versions> callSiteAttributes, ImmutableArray<string> msBuildPlatforms, 1512out SmallDictionary<string, Versions> notSuppressedAttributes, bool crossPlatform) 1514notSuppressedAttributes = new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase); 1519var diagnosticAttribute = new Versions(); 1529if (callSiteAttributes.TryGetValue(platformName, out var callSiteAttribute)) 1553if (callSiteAttributes.TryGetValue(platformName, out var callSiteAttribute)) 1603if (callSiteAttributes.TryGetValue(platformName, out var callSiteAttribute)) 1645if (callSiteAttributes.TryGetValue(platformName, out var callSiteAttribute)) 1688!notSuppressedAttributes.TryGetValue(name, out var diagnosticAttribute)) 1716static void AddOrUpdatedDiagnostic(Versions operationAttributes, 1717SmallDictionary<string, Versions> notSuppressedAttributes, string name) 1721if (!notSuppressedAttributes.TryGetValue(name, out var diagnosticAttribute)) 1731static bool UnsupportedSecondSuppressed(Versions attribute, Versions callSiteAttribute) => 1735static bool SuppressedByCallSiteUnsupported(Versions callSiteAttribute, Version unsupporteAttribute) => 1740static bool SuppressedByCallSiteSupported(Versions attribute, Version? callSiteSupportedFirst) => 1744static bool UnsupportedFirstSuppressed(Versions attribute, Versions callSiteAttribute) => 1749static bool OptionalOsSupportSuppressed(Versions callSiteAttribute, Versions attribute) => 1753static bool MandatoryOsVersionsSuppressed(Versions callSitePlatforms, Version checkingVersion) => 1758private static Versions CopyAllAttributes(Versions copyTo, Versions copyFrom) 1815SmallDictionary<string, Versions>? childAttributes = null; 1852if (pAttributes.TryGetValue(name, out var existing)) 1903if (childAttributes.TryGetValue(platform, out var childAttribute)) 1950if (childAttributes.TryGetValue(platform, out var childAttr) && 1994pAttributes ??= new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase); 2005static void CheckAttributesConsistency(SmallDictionary<string, Versions> childAttributes) 2032static Versions NormalizeAttribute(Versions attributes) 2056private static bool TryAddValidAttribute([NotNullWhen(true)] ref SmallDictionary<string, Versions>? attributes, 2061attributes ??= new SmallDictionary<string, Versions>(StringComparer.OrdinalIgnoreCase); 2063if (!attributes.TryGetValue(platformName, out var _)) 2074if (!attributes.TryGetValue(relation.relatedPlatform, out var _)) 2144private static bool AddAttribute(AttributeData attribute, Version version, Versions attributes) 2176static void AddOrUpdateObsoletedAttribute(AttributeData attribute, Versions attributes, Version version) 2199static void AddOrUpdateUnsupportedAttribute(AttributeData attribute, Versions attributes, Version version) 2224static void AddOrUpdateSupportedAttribute(Versions attributes, Version version) 2268private static bool AllowList(Versions attributes) => 2277private static bool DenyList(Versions attributes) =>
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.Data.cs (2)
48public PlatformAttributes(Callsite callsite, SmallDictionary<string, Versions> platforms) 54public SmallDictionary<string, Versions>? Platforms { get; set; }
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.OperationVisitor.cs (7)
77private static bool HasAnyGuardAttribute(ImmutableArray<AttributeData> attributes, ImmutableArray<IArgumentOperation> methodArguments, [NotNullWhen(true)] out SmallDictionary<string, Versions>? mappedAttributes) 96if (!mappedAttributes.TryGetValue(platformName, out var versions)) 126public bool TryDecodeGuardAttributes(SmallDictionary<string, Versions> mappedAttributes, ArrayBuilder<PlatformMethodValue> infosBuilder) 134if (mappedAttributes.TryGetValue(relation.relatedPlatform, out var v)) 158private static void AddValue(ArrayBuilder<PlatformMethodValue> infosBuilder, string name, Versions versions) 225private static bool HasAnyGuardAttribute(ImmutableArray<AttributeData> attributes, Version expectedVersion, [NotNullWhen(true)] out SmallDictionary<string, Versions>? mappedAttributes) 238if (!mappedAttributes.TryGetValue(platformName, out var versions))