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 });
1486
copiedAttributes.Add(platformName, CopyAllAttributes(new
Versions
(), attributes));
1499
copy.Platforms!.Add(platformName, CopyAllAttributes(new
Versions
(), attributes));
1512
copy.Add(platformName, CopyAllAttributes(new
Versions
(), attributes));
1546
var diagnosticAttribute = new
Versions
();
1717
diagnosticAttribute = new
Versions
();
1750
diagnosticAttribute = new
Versions
();
2094
attributes[platformName] = new
Versions
();
2105
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,
1478
private static bool TryCopyAttributesNotSuppressedByMsBuild(SmallDictionary<string,
Versions
> operationAttributes,
1479
ImmutableArray<string> msBuildPlatforms, out SmallDictionary<string,
Versions
> copiedAttributes)
1481
copiedAttributes = new SmallDictionary<string,
Versions
>(StringComparer.OrdinalIgnoreCase);
1495
var copy = new PlatformAttributes(copyAttributes.Callsite, new SmallDictionary<string,
Versions
>(StringComparer.OrdinalIgnoreCase));
1506
private static SmallDictionary<string,
Versions
> CopyAttributes(SmallDictionary<string,
Versions
> copyAttributes)
1508
var copy = new SmallDictionary<string,
Versions
>(StringComparer.OrdinalIgnoreCase);
1537
private static bool IsNotSuppressedByCallSite(SmallDictionary<string,
Versions
> operationAttributes,
1538
SmallDictionary<string,
Versions
> callSiteAttributes, ImmutableArray<string> msBuildPlatforms,
1539
out SmallDictionary<string,
Versions
> notSuppressedAttributes, bool crossPlatform)
1541
notSuppressedAttributes = new SmallDictionary<string,
Versions
>(StringComparer.OrdinalIgnoreCase);
1546
var
diagnosticAttribute = new Versions();
1556
if (callSiteAttributes.TryGetValue(platformName, out
var
callSiteAttribute))
1580
if (callSiteAttributes.TryGetValue(platformName, out
var
callSiteAttribute))
1630
if (callSiteAttributes.TryGetValue(platformName, out
var
callSiteAttribute))
1672
if (callSiteAttributes.TryGetValue(platformName, out
var
callSiteAttribute))
1715
!notSuppressedAttributes.TryGetValue(name, out
var
diagnosticAttribute))
1743
static void AddOrUpdatedDiagnostic(
Versions
operationAttributes,
1744
SmallDictionary<string,
Versions
> notSuppressedAttributes, string name)
1748
if (!notSuppressedAttributes.TryGetValue(name, out
var
diagnosticAttribute))
1758
static bool UnsupportedSecondSuppressed(
Versions
attribute,
Versions
callSiteAttribute) =>
1762
static bool SuppressedByCallSiteUnsupported(
Versions
callSiteAttribute, Version unsupporteAttribute) =>
1767
static bool SuppressedByCallSiteSupported(
Versions
attribute, Version? callSiteSupportedFirst) =>
1771
static bool UnsupportedFirstSuppressed(
Versions
attribute,
Versions
callSiteAttribute) =>
1776
static bool OptionalOsSupportSuppressed(
Versions
callSiteAttribute,
Versions
attribute) =>
1780
static bool MandatoryOsVersionsSuppressed(
Versions
callSitePlatforms, Version checkingVersion) =>
1785
private static
Versions
CopyAllAttributes(
Versions
copyTo,
Versions
copyFrom)
1842
SmallDictionary<string,
Versions
>? childAttributes = null;
1881
if (pAttributes.TryGetValue(name, out
var
existing))
1932
if (childAttributes.TryGetValue(platform, out
var
childAttribute))
1979
if (childAttributes.TryGetValue(platform, out
var
childAttr) &&
2023
pAttributes ??= new SmallDictionary<string,
Versions
>(StringComparer.OrdinalIgnoreCase);
2034
static void CheckAttributesConsistency(SmallDictionary<string,
Versions
> childAttributes)
2061
static
Versions
NormalizeAttribute(
Versions
attributes)
2085
private static bool TryAddValidAttribute([NotNullWhen(true)] ref SmallDictionary<string,
Versions
>? attributes,
2090
attributes ??= new SmallDictionary<string,
Versions
>(StringComparer.OrdinalIgnoreCase);
2092
if (!attributes.TryGetValue(platformName, out
var
_))
2103
if (!attributes.TryGetValue(relation.relatedPlatform, out
var
_))
2173
private static bool AddAttribute(AttributeData attribute, Version version,
Versions
attributes)
2205
static void AddOrUpdateObsoletedAttribute(AttributeData attribute,
Versions
attributes, Version version)
2228
static void AddOrUpdateUnsupportedAttribute(AttributeData attribute,
Versions
attributes, Version version)
2253
static void AddOrUpdateSupportedAttribute(
Versions
attributes, Version version)
2297
private static bool AllowList(
Versions
attributes) =>
2306
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))