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
11 changes: 8 additions & 3 deletions Cpp2IL.Core/Utils/AsmResolver/AsmResolverAssemblyPopulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ namespace Cpp2IL.Core.Utils.AsmResolver;

public static class AsmResolverAssemblyPopulator
{
public static bool IsTypeContextModule(TypeAnalysisContext typeCtx)
{
return typeCtx.Name.StartsWith("<Module>") || typeCtx.FullName.StartsWith("<Module>");
}

public static void ConfigureHierarchy(AssemblyAnalysisContext asmCtx)
{
foreach (var typeCtx in asmCtx.Types)
{
if (typeCtx.Name == "<Module>")
if (IsTypeContextModule(typeCtx))
continue;

var il2CppTypeDef = typeCtx.Definition;
Expand Down Expand Up @@ -242,7 +247,7 @@ public static void PopulateCustomAttributes(AssemblyAnalysisContext asmContext)

foreach (var type in asmContext.Types)
{
if (type.Name == "<Module>")
if (IsTypeContextModule(type))
continue;

CopyCustomAttributes(type, type.GetExtraData<TypeDefinition>("AsmResolverType")!.CustomAttributes);
Expand Down Expand Up @@ -282,7 +287,7 @@ public static void CopyDataFromIl2CppToManaged(AssemblyAnalysisContext asmContex

foreach (var typeContext in asmContext.Types)
{
if (typeContext.Name == "<Module>")
if (IsTypeContextModule(typeContext))
continue;

var managedType = typeContext.GetExtraData<TypeDefinition>("AsmResolverType") ?? throw new($"AsmResolver type not found in type analysis context for {typeContext.Definition?.FullName}");
Expand Down
2 changes: 1 addition & 1 deletion Cpp2IL.Core/Utils/AsmResolver/AsmResolverMethodFiller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void FillManagedMethodBodies(AssemblyAnalysisContext asmContext)
{
foreach (var typeContext in asmContext.Types)
{
if (typeContext.Name == "<Module>")
if (AsmResolverAssemblyPopulator.IsTypeContextModule(typeContext))
continue;

#if !DEBUG
Expand Down