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