Skip to content
Merged
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
24 changes: 12 additions & 12 deletions Il2CppInterop.Generator/Passes/Pass90WriteToDisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ public static void DoPass(RewriteGlobalContext context, GeneratorOptions options
{
var module = asmContext.NewAssembly.ManifestModule!;

// Rewrite corlib references.
foreach (var reference in module.AssemblyReferences)
{
// System.Private.CoreLib needs rewriting because references can get created during the rewrite process.
// mscorlib and netstandard are included for completeness.
if (reference.Name?.Value is "System.Private.CoreLib" or "mscorlib" or "netstandard")
{
CorlibReferences.RewriteCorlibReference(reference);
continue;
}
}

// Add TargetFrameworkAttribute to the assembly.
{
var importedConstructor = (ICustomAttributeType)module.DefaultImporter.ImportMethod(targetAttributeConstructor);
Expand All @@ -49,6 +37,18 @@ public static void DoPass(RewriteGlobalContext context, GeneratorOptions options
asmContext.NewAssembly.CustomAttributes.Add(targetFrameworkAttribute);
}

// Rewrite corlib references.
foreach (var reference in module.AssemblyReferences)
{
// System.Private.CoreLib needs rewriting because references can get created during the rewrite process.
// mscorlib and netstandard are included for completeness.
if (reference.Name?.Value is "System.Private.CoreLib" or "mscorlib" or "netstandard")
{
CorlibReferences.RewriteCorlibReference(reference);
continue;
}
}

// Optimize macros in all methods and assign tokens.
foreach (var type in module.GetAllTypes())
{
Expand Down
Loading