From 36bdfb6c07539d838bd23f0225f2c2f8ad18d682 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Fri, 14 Feb 2014 12:50:32 +0200 Subject: [PATCH] Simplified the getting of a function type now that the more complex (native) type is no longer used for abstract impls. Signed-off-by: Dimitar Dobrev Conflicts: src/AST/Method.cs --- src/AST/Function.cs | 9 ++------- src/AST/Method.cs | 18 ------------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/AST/Function.cs b/src/AST/Function.cs index 1e5beb67..74bb8930 100644 --- a/src/AST/Function.cs +++ b/src/AST/Function.cs @@ -211,7 +211,7 @@ namespace CppSharp.AST public Type Type { get { return ReturnType.Type; } } public QualifiedType QualifiedType { get { return ReturnType; } } - public virtual QualifiedType GetFunctionType() + public FunctionType GetFunctionType() { var functionType = new FunctionType { @@ -222,12 +222,7 @@ namespace CppSharp.AST functionType.Parameters.AddRange(Parameters); ReplaceIndirectReturnParamWithRegular(functionType); - var pointerType = new PointerType - { - QualifiedPointee = new QualifiedType(functionType) - }; - - return new QualifiedType(pointerType); + return functionType; } static void ReplaceIndirectReturnParamWithRegular(FunctionType functionType) diff --git a/src/AST/Method.cs b/src/AST/Method.cs index 30c462f6..557ba730 100644 --- a/src/AST/Method.cs +++ b/src/AST/Method.cs @@ -151,23 +151,5 @@ namespace CppSharp.AST { return visitor.VisitMethodDecl(this); } - - public override QualifiedType GetFunctionType() - { - var qualifiedType = base.GetFunctionType(); - if (!IsStatic) - { - FunctionType functionType; - qualifiedType.Type.IsPointerTo(out functionType); - var instance = new Parameter - { - Name = "instance", - QualifiedType = new QualifiedType( - new BuiltinType(PrimitiveType.IntPtr)) - }; - functionType.Parameters.Insert(0, instance); - } - return qualifiedType; - } } } \ No newline at end of file