From 18629d46779598d8b2006e1f7b6c31816348165e Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 18 Feb 2018 11:54:34 -0300 Subject: [PATCH] implement some signature decoder methods --- ICSharpCode.Decompiler/Metadata/Dom.cs | 2 +- ILSpy/Languages/Language.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.Decompiler/Metadata/Dom.cs b/ICSharpCode.Decompiler/Metadata/Dom.cs index c222b0933..29ff19e98 100644 --- a/ICSharpCode.Decompiler/Metadata/Dom.cs +++ b/ICSharpCode.Decompiler/Metadata/Dom.cs @@ -785,7 +785,7 @@ namespace ICSharpCode.Decompiler.Metadata public FullTypeName GetFunctionPointerType(MethodSignature signature) { - throw new NotSupportedException(); + return default(FullTypeName); } public FullTypeName GetGenericInstantiation(FullTypeName genericType, ImmutableArray typeArguments) diff --git a/ILSpy/Languages/Language.cs b/ILSpy/Languages/Language.cs index 6b447eebf..806876eb4 100644 --- a/ILSpy/Languages/Language.cs +++ b/ILSpy/Languages/Language.cs @@ -304,7 +304,7 @@ namespace ICSharpCode.ILSpy public string GetFunctionPointerType(SRM.MethodSignature signature) { - throw new NotImplementedException(); + return "method " + signature.ReturnType + " *(" + string.Join(", ", signature.ParameterTypes) + ")"; } public string GetGenericInstantiation(string genericType, ImmutableArray typeArguments) @@ -324,7 +324,8 @@ namespace ICSharpCode.ILSpy public string GetModifiedType(string modifier, string unmodifiedType, bool isRequired) { - throw new NotImplementedException(); + string modifierKeyword = isRequired ? "modreq" : "modopt"; + return $"{unmodifiedType} {modifierKeyword}({modifier})"; } public string GetPinnedType(string elementType)