Lombiq / Hastlayer-SDK

Turning .NET software into FPGA hardware for faster execution and lower power usage.
https://hastlayer.com
BSD 3-Clause "New" or "Revised" License
302 stars 33 forks source link

Upgrade to v6 ILSpy libraries #20

Closed Piedone closed 4 years ago

Piedone commented 7 years ago

See important info:

Also:

var decompiler = new CSharpDecompiler("Demo.ConsoleApp.exe", new DecompilerSettings());
var name = new FullTypeName("Demo.ConsoleApp.Test+NestedClassTest");
ITypeDefinition type = decompiler.TypeSystem.Compilation.FindType(name).GetDefinition();
var module = decompiler.TypeSystem.GetCecil(type).Module

And: https://github.com/icsharpcode/ILSpy/blob/cd2896e3e9989d092419aea92bd8417eb7e2e485/ICSharpCode.Decompiler.PdbProvider.Cecil/MonoCecilDebugInfoProvider.cs

But with v4.0, the underlying decompiler and disassembler engine have been ported to System.Reflection.Metadata, see: https://github.com/icsharpcode/ILSpy/wiki/srm

There is still TypeDeclaration but now there is also an ITypeDefinition which is similar to what was in Mono.Cecil and can be retrieved from various places via GetDefinition(). Then there is IEntity.MetadataToken as well, which is supposed to provide what GetCecil() did.

After this, the workaround for the ILSpy large integer literal bug can be removed, see DecompilationErrorsFixer and WronglyDecompiledCases.

JIRA issue

Piedone commented 4 years ago

Done, will be part of the next release.

Piedone commented 4 years ago

Guys this was an epic upgrade :D. @siegfriedpammer @christophwille @dgrunwald But it's very well worth it. I could remove a lot of workarounds and special case handling from Hastlayer.