Improve IRDumper (#1135)

* Improve IRDumper

* Make Symbols.Add(ulong, ulong, ulong, string) thread safe

* Use a StringBuilder for MemoryOperand

* Add #if M_DEBUG guards

* Fix JMP_TABLE typo

* Fix using in Symbols

* Use Conditional("M_DEBUG") instead

Address gdkchan's feedback

* Use a struct instead of 4-tuple

Address gdkchan's feedback

* Place symbols in comments instead

Address gdkchan's feedback

* Use StringBuilder throughout

* Handle offsetted symbols

* Fix naming convention of Builder

* Avoid ArgumentException

* Remove unnecessary using

* Use switch expression instead

* Turn into a class

* Clean up

* Remove unnecessary using
This commit is contained in:
Ficture Seven 2020-05-04 06:06:22 +04:00 committed by GitHub
parent 53369e79bd
commit 180ad8605d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 333 additions and 128 deletions

View file

@ -1,3 +1,4 @@
using ARMeilleure.Diagnostics;
using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.State;
using System;
@ -85,6 +86,8 @@ namespace ARMeilleure.Translation
IntPtr ptr = Marshal.GetFunctionPointerForDelegate<Delegate>(func);
Symbols.Add((ulong)ptr.ToInt64(), func.Method.Name);
OperandType returnType = GetOperandType(func.Method.ReturnType);
return Call(Const(ptr.ToInt64()), returnType, callArgs);