10 instantiations of PlatformMethodValue
Microsoft.CodeAnalysis.NetAnalyzers (10)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (1)
529else if (value.AnalysisValues.Contains(new PlatformMethodValue(info.PlatformName, EmptyVersion, false)))
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.OperationVisitor.cs (3)
164infosBuilder.Add(new PlatformMethodValue(name, versions.SupportedFirst, negated: false)); 169infosBuilder.Add(new PlatformMethodValue(name, versions.UnsupportedFirst, negated: true)); 172infosBuilder.Add(new PlatformMethodValue(name, versions.UnsupportedSecond, negated: true));
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.Value.cs (6)
38=> new PlatformMethodValue(PlatformName, Version, !Negated); 52var info = new PlatformMethodValue(platformName, EmptyVersion, negated: false); 65var info = new PlatformMethodValue(osPlatformNamesBuilder[i], EmptyVersion, negated: false); 82var info = new PlatformMethodValue(platformName, version, negated: false); 90var info = new PlatformMethodValue(literal.ConstantValue.Value.ToString(), version, negated: false); 101var info = new PlatformMethodValue(platformName, version, negated: false);
28 references to PlatformMethodValue
Microsoft.CodeAnalysis.NetAnalyzers (28)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (6)
498if (analysisValue is PlatformMethodValue info) 642IsPlatformSupportWasSuppresed((PlatformMethodValue)parent.AnalysisValues.First(), attributes, originalAttributes)) 659static bool IsPlatformSupportWasSuppresed(PlatformMethodValue parentValue, SmallDictionary<string, Versions> attributes, SmallDictionary<string, Versions> originalAttributes) 676if (value is PlatformMethodValue info) 719PlatformMethodValue info, Version? unsupportedVersion) 744static SmallDictionary<string, Versions> SetCallSiteUnsupportedAttribute(SmallDictionary<string, Versions>? csAttributes, PlatformMethodValue info)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.OperationVisitor.cs (8)
53using var infosBuilder = ArrayBuilder<PlatformMethodValue>.GetInstance(); 121/// Convert each platform and versions pair from <paramref name="mappedAttributes"/> map into <see cref="PlatformMethodValue"/>s and add into <paramref name="infosBuilder"/> array 124/// <param name="infosBuilder">Converted array of <see cref="PlatformMethodValue"/>s</param> 125/// <returns>True if any <see cref="PlatformMethodValue"/> added into the <paramref name="infosBuilder"/>, false otherwise</returns> 126public bool TryDecodeGuardAttributes(SmallDictionary<string, Versions> mappedAttributes, ArrayBuilder<PlatformMethodValue> infosBuilder) 158private static void AddValue(ArrayBuilder<PlatformMethodValue> infosBuilder, string name, Versions versions) 190using var infosBuilder = ArrayBuilder<PlatformMethodValue>.GetInstance(); 191if (PlatformMethodValue.TryDecode(method, visitedArguments, DataFlowAnalysisContext.ValueContentAnalysisResult, _osPlatformType, infosBuilder))
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.Value.cs (14)
24private readonly struct PlatformMethodValue : IAbstractAnalysisValue, IEquatable<PlatformMethodValue> 45ArrayBuilder<PlatformMethodValue> infosBuilder) 52var info = new PlatformMethodValue(platformName, EmptyVersion, negated: false); 65var info = new PlatformMethodValue(osPlatformNamesBuilder[i], EmptyVersion, negated: false); 82var info = new PlatformMethodValue(platformName, version, negated: false); 90var info = new PlatformMethodValue(literal.ConstantValue.Value.ToString(), version, negated: false); 101var info = new PlatformMethodValue(platformName, version, negated: false); 162public bool Equals(PlatformMethodValue other) 168=> obj is PlatformMethodValue otherInfo && Equals(otherInfo); 179=> other is PlatformMethodValue otherInfo && Equals(otherInfo); 181public static bool operator ==(PlatformMethodValue left, PlatformMethodValue right) 186public static bool operator !=(PlatformMethodValue left, PlatformMethodValue right)