Skip to content

Commit f20262d

Browse files
committed
Add net8 handling
1 parent 0f39ec5 commit f20262d

File tree

7 files changed

+19
-1
lines changed

7 files changed

+19
-1
lines changed

src/ILLink.Shared/DataFlow/DefaultValueDictionary.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,8 @@ public DefaultValueDictionary<TKey, TValue> Clone ()
108108
// Prevent warning CS0659 https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0659.
109109
// This type should never be used as a dictionary key.
110110
public override int GetHashCode () => throw new NotImplementedException ();
111+
112+
public static bool operator ==(DefaultValueDictionary<TKey, TValue> left, DefaultValueDictionary<TKey, TValue> right) => left.Equals(right);
113+
public static bool operator !=(DefaultValueDictionary<TKey, TValue> left, DefaultValueDictionary<TKey, TValue> right) => !(left == right);
111114
}
112115
}

src/ILLink.Shared/DataFlow/MaybeLattice.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public Maybe<T> Clone ()
2626
return new (copyValue.DeepCopy ());
2727
return new (value);
2828
}
29+
30+
public static bool operator ==(Maybe<T> left, Maybe<T> right) => left.Equals(right);
31+
public static bool operator !=(Maybe<T> left, Maybe<T> right) => !(left == right);
2932
}
3033

3134
public struct MaybeLattice<T, TValueLattice> : ILattice<Maybe<T>>

src/ILLink.Shared/DataFlow/ValueSet.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ public bool Equals (ValueSet<TValue> other)
120120
}
121121
}
122122

123+
public static bool operator ==(ValueSet<TValue> left, ValueSet<TValue> right) => left.Equals(right);
124+
public static bool operator !=(ValueSet<TValue> left, ValueSet<TValue> right) => !(left == right);
125+
123126
public override int GetHashCode ()
124127
{
125128
if (_values == null)

src/ILLink.Shared/TypeSystemProxy/WellKnownType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static (string Namespace, string Name) GetNamespaceAndName (this WellKnow
3838
WellKnownType.System_NotSupportedException => ("System", "NotSupportedException"),
3939
WellKnownType.System_Runtime_CompilerServices_DisablePrivateReflectionAttribute => ("System.Runtime.CompilerServices", "DisablePrivateReflectionAttribute"),
4040
WellKnownType.System_Void => ("System", "Void"),
41+
_ => throw new System.ArgumentException (type.ToString ())
4142
};
4243
}
4344
public static string GetNamespace (this WellKnownType type) => GetNamespaceAndName (type).Namespace;

src/linker/Linker.Dataflow/HoistedLocalKey.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ public HoistedLocalKey (FieldDefinition field)
2626
public override bool Equals (object? obj) => obj is HoistedLocalKey other && Equals (other);
2727

2828
public override int GetHashCode () => Field.GetHashCode ();
29+
30+
public static bool operator ==(HoistedLocalKey left, HoistedLocalKey right) => left.Equals(right);
31+
public static bool operator !=(HoistedLocalKey left, HoistedLocalKey right) => !(left == right);
2932
}
3033
}

src/linker/Linker.Dataflow/ValueNode.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,8 @@ public ValueBasicBlockPair (MultiValue value, int basicBlockIndex)
6464
public override bool Equals (object? obj) => obj is ValueBasicBlockPair other && Equals (other);
6565

6666
public override int GetHashCode () => HashUtils.Combine (Value.GetHashCode (), BasicBlockIndex);
67+
68+
public static bool operator ==(ValueBasicBlockPair left, ValueBasicBlockPair right) => left.Equals(right);
69+
public static bool operator !=(ValueBasicBlockPair left, ValueBasicBlockPair right) => !(left == right);
6770
}
6871
}

test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public static class PathUtilities
1414
public const string ConfigDirectoryName = "Release";
1515
#endif
1616

17-
#if NET7_0
17+
#if NET8_0
18+
public const string TFMDirectoryName = "net8.0";
19+
#elif NET7_0
1820
public const string TFMDirectoryName = "net7.0";
1921
#elif NET6_0
2022
public const string TFMDirectoryName = "net6.0";

0 commit comments

Comments
 (0)