Browse Source

Merge pull request #278 from ddobrev/master

Simplified the getting of a function type now that the more complex (native) type is no longer used for abstract impls
pull/279/head
João Matos 11 years ago
parent
commit
5151bcbe70
  1. 9
      src/AST/Function.cs
  2. 18
      src/AST/Method.cs

9
src/AST/Function.cs

@ -211,7 +211,7 @@ namespace CppSharp.AST @@ -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 @@ -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)

18
src/AST/Method.cs

@ -151,23 +151,5 @@ namespace CppSharp.AST @@ -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;
}
}
}
Loading…
Cancel
Save