|
|
|
@ -20,13 +20,6 @@ namespace CppSharp.Passes |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public class CheckAbiParameters : TranslationUnitPass |
|
|
|
public class CheckAbiParameters : TranslationUnitPass |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly DriverOptions options; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CheckAbiParameters(DriverOptions options) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.options = options; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override bool VisitFunctionDecl(Function function) |
|
|
|
public override bool VisitFunctionDecl(Function function) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!VisitDeclaration(function)) |
|
|
|
if (!VisitDeclaration(function)) |
|
|
|
@ -49,7 +42,7 @@ namespace CppSharp.Passes |
|
|
|
if (function.HasThisReturn) |
|
|
|
if (function.HasThisReturn) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// This flag should only be true on methods.
|
|
|
|
// This flag should only be true on methods.
|
|
|
|
var method = (Method)function; |
|
|
|
var method = (Method) function; |
|
|
|
var classType = new QualifiedType(new TagType(method.Namespace), |
|
|
|
var classType = new QualifiedType(new TagType(method.Namespace), |
|
|
|
new TypeQualifiers {IsConst = true}); |
|
|
|
new TypeQualifiers {IsConst = true}); |
|
|
|
function.ReturnType = new QualifiedType(new PointerType(classType)); |
|
|
|
function.ReturnType = new QualifiedType(new PointerType(classType)); |
|
|
|
|