Lombiq / Hastlayer-SDK

Turning .NET software into FPGA hardware for faster execution and lower power usage.

Home Page:https://hastlayer.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrade to v6 ILSpy libraries

Piedone opened this issue · comments

See important info:

Also:

  • ICSharpCode.NRefactory was integrated into ICSharpCode.Decompiler and thus the independent ICSharpCode.NRefactory package isn't used any more.
  • ILRange is now part of ILInstruction instead of being an annotation.
  • Not sure what "Instead of Cecil.TypeReference, the decompiler now uses the NRefactory TypeSystem." means for us, but probably we can still get the Cecil type info object as per the former, now deleted, last example on https://github.com/icsharpcode/ILSpy/wiki/Getting-Started-With-ICSharpCode.Decompiler (GetCecil() doesn't exist any more):
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

Done, will be part of the next release.

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.