diff options
Diffstat (limited to 'src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CanonicalEETypeNode.cs')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CanonicalEETypeNode.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CanonicalEETypeNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CanonicalEETypeNode.cs index 2383df231..945e49c39 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CanonicalEETypeNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CanonicalEETypeNode.cs @@ -27,7 +27,6 @@ namespace ILCompiler.DependencyAnalysis Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any)); Debug.Assert(type == type.ConvertToCanonForm(CanonicalFormKind.Specific)); Debug.Assert(!type.IsMdArray); - Debug.Assert(!type.IsByRefLike); } public override bool StaticDependenciesAreComputed => true; @@ -46,7 +45,7 @@ namespace ILCompiler.DependencyAnalysis DefType closestDefType = _type.GetClosestDefType(); - if (_type.RuntimeInterfaces.Length > 0) + if (InterfaceDispatchMapNode.MightHaveInterfaceDispatchMap(_type, factory)) dependencyList.Add(factory.InterfaceDispatchMap(_type), "Canonical interface dispatch map"); dependencyList.Add(factory.VTable(closestDefType), "VTable"); @@ -62,6 +61,15 @@ namespace ILCompiler.DependencyAnalysis AddDependenciesForUniversalGVMSupport(factory, _type, ref dependencyList); } + // Keep track of the default constructor map dependency for this type if it has a default constructor + MethodDesc defaultCtor = closestDefType.GetDefaultConstructor(); + if (defaultCtor != null) + { + dependencyList.Add(new DependencyListEntry( + factory.MethodEntrypoint(defaultCtor, closestDefType.IsValueType), + "DefaultConstructorNode")); + } + return dependencyList; } @@ -136,6 +144,6 @@ namespace ILCompiler.DependencyAnalysis base.ComputeValueTypeFieldPadding(); } - protected internal override int ClassCode => -1798018602; + public override int ClassCode => -1798018602; } } |