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