7d05485754
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
25 lines
507 B
C#
25 lines
507 B
C#
using System;
|
|
|
|
using Mono.Linker;
|
|
using Mono.Linker.Steps;
|
|
using Mono.Cecil;
|
|
|
|
namespace ILLink.CustomSteps
|
|
{
|
|
public class ClearInitLocalsStep : BaseStep
|
|
{
|
|
protected override void ProcessAssembly(AssemblyDefinition assembly)
|
|
{
|
|
foreach (ModuleDefinition module in assembly.Modules) {
|
|
foreach (TypeDefinition type in module.Types) {
|
|
foreach (MethodDefinition method in type.Methods) {
|
|
if (method.Body != null) {
|
|
method.Body.InitLocals = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|