|
|
|
@ -1,10 +1,13 @@
@@ -1,10 +1,13 @@
|
|
|
|
|
using CppSharp.AST; |
|
|
|
|
using System.Linq; |
|
|
|
|
using CppSharp.AST; |
|
|
|
|
|
|
|
|
|
namespace CppSharp.Passes |
|
|
|
|
{ |
|
|
|
|
public class ParamTypeToInterfacePass : TranslationUnitPass |
|
|
|
|
{ |
|
|
|
|
public override bool VisitFunctionDecl(Function function) |
|
|
|
|
{ |
|
|
|
|
if (!function.IsOperator) |
|
|
|
|
{ |
|
|
|
|
if (function.HasIndirectReturnTypeParameter) |
|
|
|
|
{ |
|
|
|
@ -15,13 +18,13 @@ namespace CppSharp.Passes
@@ -15,13 +18,13 @@ namespace CppSharp.Passes
|
|
|
|
|
{ |
|
|
|
|
function.ReturnType = GetInterfaceType(function.ReturnType); |
|
|
|
|
} |
|
|
|
|
return base.VisitFunctionDecl(function); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override bool VisitParameterDecl(Parameter parameter) |
|
|
|
|
foreach (Parameter parameter in function.Parameters.Where( |
|
|
|
|
p => p.Kind != ParameterKind.IndirectReturnType)) |
|
|
|
|
{ |
|
|
|
|
parameter.QualifiedType = GetInterfaceType(parameter.QualifiedType); |
|
|
|
|
return base.VisitParameterDecl(parameter); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return base.VisitFunctionDecl(function); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static QualifiedType GetInterfaceType(QualifiedType type) |
|
|
|
|