From ebde1312c24d585e82f33e975dde7f99840d1113 Mon Sep 17 00:00:00 2001 From: triton Date: Mon, 12 Aug 2013 17:06:52 +0100 Subject: [PATCH] Run the CheckAbiParameters pass after CheckOperatorsOverloadsPass since the latter can change the signature of the methods which can affect the correctness of the first pass. --- src/Generator/Generators/CSharp/CSharpGenerator.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpGenerator.cs b/src/Generator/Generators/CSharp/CSharpGenerator.cs index 34a3cd7e..479eb7f8 100644 --- a/src/Generator/Generators/CSharp/CSharpGenerator.cs +++ b/src/Generator/Generators/CSharp/CSharpGenerator.cs @@ -1,8 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using CppSharp.AST; using CppSharp.Passes; -using CppSharp.Generators; namespace CppSharp.Generators.CSharp { @@ -28,8 +26,13 @@ namespace CppSharp.Generators.CSharp public override bool SetupPasses() { - Driver.AddTranslationUnitPass(new CheckAbiParameters(Driver.Options)); + // Both the CheckOperatorsOverloadsPass and CheckAbiParameters can + // create and and new parameters to functions and methods. Make sure + // CheckAbiParameters runs last because hidden structure parameters + // should always occur first. + Driver.AddTranslationUnitPass(new CheckOperatorsOverloadsPass()); + Driver.AddTranslationUnitPass(new CheckAbiParameters(Driver.Options)); return true; }