Browse Source

Extended the finding of symbols to work for specialisations.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/888/head
Dimitar Dobrev 8 years ago
parent
commit
6a414939e5
  1. 20
      src/Generator/Passes/FindSymbolsPass.cs
  2. 1
      src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs

20
src/Generator/Passes/FindSymbolsPass.cs

@ -56,6 +56,26 @@ namespace CppSharp.Passes @@ -56,6 +56,26 @@ namespace CppSharp.Passes
if (!Options.CheckSymbols || Options.IsCLIGenerator)
return false;
if (decl.IsDependent)
{
var @class = decl.Namespace as Class;
if (@class != null && @class.IsDependent)
{
foreach (var specialization in @class.Specializations)
{
var specializedFunction = specialization.Methods.Find(
m => m.InstantiatedFrom == decl);
if (specializedFunction != null &&
CheckForSymbol(specializedFunction))
return true;
}
}
}
return CheckForSymbol(decl);
}
private bool CheckForSymbol(Declaration decl)
{
var mangledDecl = decl as IMangledDecl;
var method = decl as Method;
if (decl.IsGenerated && mangledDecl != null &&

1
src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs

@ -32,6 +32,7 @@ namespace CppSharp.Passes @@ -32,6 +32,7 @@ namespace CppSharp.Passes
VisitOptions.VisitClassFields = false;
VisitOptions.VisitClassMethods = false;
VisitOptions.VisitClassProperties = false;
VisitOptions.VisitClassTemplateSpecializations = false;
VisitOptions.VisitEventParameters = false;
VisitOptions.VisitFunctionParameters = false;
VisitOptions.VisitFunctionReturnType = false;

Loading…
Cancel
Save