11 instantiations of ValueSet
illink (11)
Linker.Dataflow\ArrayValue.cs (1)
23
result = MultiValueLattice.Meet(result, new
MultiValue
(new ArrayValue(sizeValue, elementType)));
Linker.Dataflow\InterproceduralState.cs (1)
73
MethodBodies = new
ValueSet
<MethodIL>(methodsList);
Linker.Dataflow\MethodBodyScanner.cs (2)
31
Value = new
MultiValue
(UnknownValue.Instance);
36
Value = new
MultiValue
(value);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (6)
29
public static readonly ValueSet<TValue> Unknown =
new
(UnknownSentinel);
164
public static implicit operator ValueSet<TValue>(TValue value) =>
new
(value);
268
return new
ValueSet
<TValue>(values);
290
return new
ValueSet
<TValue>(values);
322
return new
ValueSet
<TValue>(copyValue.DeepCopy());
327
return new
ValueSet
<TValue>(GetKnownValues().Select(value => value is IDeepCopyValue<TValue> copyValue ? copyValue.DeepCopy() : value));
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\ArrayValue.cs (1)
46
return
new
(input.AsEnumerable().Select(v => v is ArrayValue ? UnknownValue.Instance : v));
150 references to ValueSet
illink (150)
Linker.Dataflow\ArrayValue.cs (5)
11
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
18
public static
MultiValue
Create(
MultiValue
size, TypeReference elementType)
20
MultiValue
result = MultiValueLattice.Top;
47
public partial bool TryGetValueByIndex(int index, out
MultiValue
value)
Linker.Dataflow\AttributeDataFlow.cs (5)
10
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
34
MultiValue
value = GetValueForCustomAttributeArgument(arguments[parameter.MetadataIndex]);
43
MultiValue
valueNode = GetValueForCustomAttributeArgument(value);
52
MultiValue
GetValueForCustomAttributeArgument(CustomAttributeArgument argument)
72
void RequireDynamicallyAccessedMembers(in DiagnosticContext diagnosticContext, in
MultiValue
value, ValueWithDynamicallyAccessedMembers targetValue)
Linker.Dataflow\GenericArgumentDataFlow.cs (2)
10
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
68
MultiValue
genericArgumentValue = context.Annotations.FlowAnnotations.GetTypeValueFromGenericArgument(genericArgument);
Linker.Dataflow\HandleCallAction.cs (7)
14
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
49
MultiValue
instanceValue,
50
IReadOnlyList<
MultiValue
> argumentValues,
52
out
MultiValue
? methodReturnValue)
54
MultiValue
? maybeMethodReturnValue = methodReturnValue = null;
234
void AddReturnValue(
MultiValue
value)
236
maybeMethodReturnValue = (maybeMethodReturnValue is null) ? value : MultiValueLattice.Meet((
MultiValue
)maybeMethodReturnValue, value);
Linker.Dataflow\InterproceduralState.cs (8)
13
ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>>;
14
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
22
public
ValueSet
<MethodIL> MethodBodies;
26
public InterproceduralState(
ValueSet
<MethodIL> methodBodies, HoistedLocalState hoistedLocals, InterproceduralStateLattice lattice)
76
public void SetHoistedLocal(HoistedLocalKey key,
MultiValue
value)
86
public
MultiValue
GetHoistedLocal(HoistedLocalKey key)
93
public readonly DictionaryLattice<HoistedLocalKey,
MultiValue
, ValueSetLattice<SingleValue>> HoistedLocalsLattice;
98
DictionaryLattice<HoistedLocalKey,
MultiValue
, ValueSetLattice<SingleValue>> hoistedLocalsLattice,
Linker.Dataflow\MethodBodyScanner.cs (29)
18
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
27
public
MultiValue
Value { get; }
39
public StackSlot(
MultiValue
value)
197
MultiValue
localValue = keyValuePair.Value.Value;
215
in
MultiValue
valueToStore,
223
MultiValue
value;
710
MultiValue
retValue = DereferenceValue(retStackSlot.Value, locals, ref interproceduralState);
937
protected void StoreInReference(
MultiValue
target,
MultiValue
source, MethodIL methodIL, Instruction operation, LocalVariableStore locals, int curBasicBlock, ref InterproceduralState ipState, int? parameterIndex)
978
protected abstract
MultiValue
GetFieldValue(FieldReference field);
999
MultiValue
value;
1015
protected virtual void HandleStoreField(MethodIL methodIL, FieldValue field, Instruction operation,
MultiValue
valueToStore, int? parameterIndex)
1019
protected virtual void HandleStoreParameter(MethodIL methodIL, MethodParameterValue parameter, Instruction operation,
MultiValue
valueToStore, int? parameterIndex)
1023
protected virtual void HandleReturnValue(MethodIL method, MethodReturnValue thisParameter, Instruction operation,
MultiValue
valueToReturn)
1062
MultiValue
valueToStore = DereferenceValue(valueToStoreSlot.Value, locals, ref interproceduralState);
1106
internal
MultiValue
DereferenceValue(
MultiValue
maybeReferenceValue, LocalVariableStore locals, ref InterproceduralState interproceduralState)
1108
MultiValue
dereferencedValue = MultiValueLattice.Top;
1114
dereferencedValue =
MultiValue
.Union(
1121
dereferencedValue =
MultiValue
.Union(
1127
dereferencedValue =
MultiValue
.Union(dereferencedValue, valueBasicBlockPair.Value);
1129
dereferencedValue =
MultiValue
.Union(dereferencedValue, UnknownValue.Instance);
1135
dereferencedValue =
MultiValue
.Union(dereferencedValue, fieldValue);
1138
dereferencedValue =
MultiValue
.Union(dereferencedValue, value);
1196
var dereferencedMethodParams = new List<
MultiValue
>();
1197
foreach (
var
argument in methodArguments)
1199
MultiValue
methodReturnValue = HandleCall(
1210
foreach (
var
param in methodArguments)
1228
public abstract
MultiValue
HandleCall(
Linker.Dataflow\ReflectionMethodBodyScanner.cs (13)
14
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
110
protected override
MultiValue
GetFieldValue(FieldReference field)
118
private void HandleStoreValueWithDynamicallyAccessedMembers(ValueWithDynamicallyAccessedMembers targetValue, Instruction operation,
MultiValue
sourceValue, int? parameterIndex)
127
protected override void HandleStoreField(MethodIL methodIL, FieldValue field, Instruction operation,
MultiValue
valueToStore, int? parameterIndex)
130
protected override void HandleStoreParameter(MethodIL methodIL, MethodParameterValue parameter, Instruction operation,
MultiValue
valueToStore, int? parameterIndex)
133
protected override void HandleReturnValue(MethodIL methodIL, MethodReturnValue returnValue, Instruction operation,
MultiValue
valueToStore)
161
public override
MultiValue
HandleCall(MethodIL callingMethodIL, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams)
178
MultiValue
instanceValue;
179
ImmutableArray<
MultiValue
> arguments;
213
public static
MultiValue
HandleCall(
216
MultiValue
instanceValue,
217
ImmutableArray<
MultiValue
> argumentValues,
240
if (!handleCallAction.Invoke(calledMethodProxy.Value, instanceValue, argumentValues, intrinsicId, out
MultiValue
methodReturnValue))
Linker.Dataflow\TrimAnalysisAssignmentPattern.cs (5)
8
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
14
public
MultiValue
Source { get; init; }
15
public
MultiValue
Target { get; init; }
22
public TrimAnalysisAssignmentPattern(
MultiValue
source,
MultiValue
target, MessageOrigin origin, int? parameterIndex)
Linker.Dataflow\TrimAnalysisMethodCallPattern.cs (9)
11
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
19
public readonly
MultiValue
Instance;
20
public readonly ImmutableArray<
MultiValue
> Arguments;
26
MultiValue
instance,
27
ImmutableArray<
MultiValue
> arguments,
36
Arguments = ImmutableArray<
MultiValue
>.Empty;
40
var builder = ImmutableArray.CreateBuilder<
MultiValue
>();
41
foreach (
var
argument in arguments)
55
var argumentsBuilder = ImmutableArray.CreateBuilder<
MultiValue
>();
Linker.Dataflow\ValueNode.cs (6)
7
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
11
public class ValueNodeList : List<
MultiValue
>
22
public ValueNodeList(List<
MultiValue
> other)
30
foreach (
var
item in this)
54
public ValueBasicBlockPair(
MultiValue
value, int basicBlockIndex)
60
public
MultiValue
Value { get; }
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (19)
16
public readonly struct ValueSet<TValue> : IEquatable<
ValueSet
<TValue>>, IDeepCopyValue<
ValueSet
<TValue>>
21
public static readonly
ValueSet
<TValue> Empty;
29
public static readonly
ValueSet
<TValue> Unknown = new(UnknownSentinel);
164
public static implicit operator
ValueSet
<TValue>(TValue value) => new(value);
169
public override bool Equals(object? obj) => obj is
ValueSet
<TValue> other && Equals(other);
171
public bool Equals(
ValueSet
<TValue> other)
217
public static bool operator ==(
ValueSet
<TValue> left,
ValueSet
<TValue> right) => left.Equals(right);
218
public static bool operator !=(
ValueSet
<TValue> left,
ValueSet
<TValue> right) => !(left == right);
223
return typeof(
ValueSet
<TValue>).GetHashCode();
246
internal static
ValueSet
<TValue> Union(
ValueSet
<TValue> left,
ValueSet
<TValue> right)
271
internal static
ValueSet
<TValue> Intersection(
ValueSet
<TValue> left,
ValueSet
<TValue> right)
310
public
ValueSet
<TValue> DeepCopy()
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\ValueSetLattice.cs (6)
12
public readonly struct ValueSetLattice<TValue> : ILattice<
ValueSet
<TValue>>
15
public
ValueSet
<TValue> Top => default;
17
public
ValueSet
<TValue> Meet(
ValueSet
<TValue> left,
ValueSet
<TValue> right) =>
ValueSet
<TValue>.Union(left, right);
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\ArrayValue.cs (4)
6
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
19
public partial bool TryGetValueByIndex(int index, out
MultiValue
value);
21
public static
MultiValue
SanitizeArrayElementValue(
MultiValue
input)
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (23)
14
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
31
public bool Invoke(MethodProxy calledMethod,
MultiValue
instanceValue, IReadOnlyList<
MultiValue
> argumentValues, IntrinsicId intrinsicId, out
MultiValue
methodReturnValue)
33
MultiValue
? maybeMethodReturnValue;
79
MultiValue
instanceValue,
80
IReadOnlyList<
MultiValue
> argumentValues,
82
out
MultiValue
? methodReturnValue);
86
MultiValue
instanceValue,
87
IReadOnlyList<
MultiValue
> argumentValues,
89
out
MultiValue
? methodReturnValue)
91
MultiValue
? returnValue = methodReturnValue = null;
638
foreach (
var
methodValue in ProcessGetMethodByName(systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags))
819
foreach (
var
methodValue in ProcessGetMethodByName(systemTypeValue.RepresentedType, stringValue.Contents, bindingFlags))
1145
if ((argumentValue as ArrayValue)?.TryGetValueByIndex(0, out
var
underlyingMultiValue) == true)
1637
void AddReturnValue(
MultiValue
value)
1643
private IEnumerable<
MultiValue
> ProcessGetMethodByName(TypeProxy type, string methodName, BindingFlags? bindingFlags)
1661
private bool AnalyzeGenericInstantiationTypeArray(in
MultiValue
arrayParam, ImmutableArray<GenericParameterValue> genericParameters)
1693
if (!array.TryGetValueByIndex(i, out
MultiValue
value) || value.AsSingleValue() is UnknownValue)
1707
if (array.TryGetValueByIndex(i, out
MultiValue
value))
1733
in
MultiValue
genericParametersArray,
1761
private void ProcessCreateInstanceByName(MethodProxy calledMethod, IReadOnlyList<
MultiValue
> argumentValues)
1818
internal static BindingFlags? GetBindingFlagsFromValue(in
MultiValue
parameter) => (BindingFlags?)parameter.AsConstInt();
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\RequireDynamicallyAccessedMembersAction.cs (2)
9
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
21
public void Invoke(in
MultiValue
value, ValueWithDynamicallyAccessedMembers targetValue)
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueExtensions.cs (7)
7
using MultiValue = ILLink.Shared.DataFlow.
ValueSet
<ILLink.Shared.DataFlow.SingleValue>;
45
internal static int? AsConstInt(this in
MultiValue
value)
53
internal static SingleValue? AsSingleValue(this in
MultiValue
node)
62
private static
ValueSet
<SingleValue>.Enumerable Unknown = new
ValueSet
<SingleValue>.Enumerable(UnknownValue.Instance);
66
internal static
ValueSet
<SingleValue>.Enumerable AsEnumerable(this
MultiValue
multiValue)