Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Internal.TypeSystem
// to sort itself with respect to other instances of the same type.
// Comparisons between different categories of types are centralized to a single location that
// can provide rules to sort them.
public class TypeSystemComparer : IComparer<TypeDesc>, IComparer<MethodDesc>, IComparer<FieldDesc>, IComparer<MethodSignature>
public class TypeSystemComparer : IComparer<TypeDesc>, IComparer<MethodDesc>, IComparer<FieldDesc>, IComparer<MethodSignature>, IComparer<ModuleDesc>
{
public static TypeSystemComparer Instance { get; } = new TypeSystemComparer();

Expand Down Expand Up @@ -128,5 +128,10 @@ public int Compare(MethodSignature x, MethodSignature y)
{
return x.CompareTo(y, this);
}

public int Compare(ModuleDesc x, ModuleDesc y)
{
return Compare(x.GetGlobalModuleType(), y.GetGlobalModuleType());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private static (string AttributeName, DiagnosticId Id)[] _requiresAttributeMisma
};

private readonly List<TypeDesc> _typesWithForcedEEType = new List<TypeDesc>();
private readonly List<ModuleDesc> _modulesWithMetadata = new List<ModuleDesc>();
private readonly SortedSet<ModuleDesc> _modulesWithMetadata = new SortedSet<ModuleDesc>(CompilerComparer.Instance);
private readonly List<FieldDesc> _fieldsWithMetadata = new List<FieldDesc>();
private readonly List<MethodDesc> _methodsWithMetadata = new List<MethodDesc>();
private readonly List<MetadataType> _typesWithMetadata = new List<MetadataType>();
Expand Down