diff --git a/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatEmpty.cs b/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatEmpty.cs index 7807a3d4..5b82b18a 100644 --- a/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatEmpty.cs +++ b/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatEmpty.cs @@ -1,6 +1,6 @@ using AsmResolver.DotNet; -using AssetRipper.CIL; using Cpp2IL.Core.Model.Contexts; +using Cpp2IL.Core.Utils.AsmResolver; namespace Cpp2IL.Core.OutputFormats; diff --git a/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatIlRecovery.cs b/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatIlRecovery.cs index c69e28a1..129f3a7b 100644 --- a/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatIlRecovery.cs +++ b/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatIlRecovery.cs @@ -1,7 +1,7 @@ using AsmResolver.DotNet; using AsmResolver.PE.DotNet.Cil; -using AssetRipper.CIL; using Cpp2IL.Core.Model.Contexts; +using Cpp2IL.Core.Utils.AsmResolver; namespace Cpp2IL.Core.OutputFormats; diff --git a/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatThrowNull.cs b/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatThrowNull.cs index 8a86b7ec..c554c1b9 100644 --- a/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatThrowNull.cs +++ b/Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatThrowNull.cs @@ -1,7 +1,7 @@ using AsmResolver.DotNet; using AsmResolver.PE.DotNet.Cil; -using AssetRipper.CIL; using Cpp2IL.Core.Model.Contexts; +using Cpp2IL.Core.Utils.AsmResolver; namespace Cpp2IL.Core.OutputFormats; diff --git a/Cpp2IL.Core/Utils/AsmResolver/AsmResolverUtils.cs b/Cpp2IL.Core/Utils/AsmResolver/AsmResolverUtils.cs index 5b58be47..fe5530e1 100644 --- a/Cpp2IL.Core/Utils/AsmResolver/AsmResolverUtils.cs +++ b/Cpp2IL.Core/Utils/AsmResolver/AsmResolverUtils.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Concurrent; +using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; @@ -327,6 +328,10 @@ public static ITypeDefOrRef ImportTypeIfNeeded(this ReferenceImporter importer, return importer.ImportType(type); } + public static bool IsManagedMethodWithBody(this MethodDefinition managedMethod) => + managedMethod.Managed && !managedMethod.IsAbstract && !managedMethod.IsPInvokeImpl + && !managedMethod.IsInternalCall && !managedMethod.IsNative && !managedMethod.IsRuntime; + internal static ArrayTypeSignature MakeArrayTypeWithLowerBounds(this TypeSignature elementType, int rank) { var result = new ArrayTypeSignature(elementType, rank);