Permalink
Browse files

Extended the finding of symbols to work for specialisations.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
  • Loading branch information...
ddobrev committed Jul 14, 2017
1 parent 01677b0 commit 6a414939e598c17176bac69c761a780bc1cca926
@@ -56,6 +56,26 @@ public override bool VisitDeclaration(Declaration decl)
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 &&
@@ -32,6 +32,7 @@ public SpecializationMethodsWithDependentPointersPass()
VisitOptions.VisitClassFields = false;
VisitOptions.VisitClassMethods = false;
VisitOptions.VisitClassProperties = false;
VisitOptions.VisitClassTemplateSpecializations = false;
VisitOptions.VisitEventParameters = false;
VisitOptions.VisitFunctionParameters = false;
VisitOptions.VisitFunctionReturnType = false;

0 comments on commit 6a41493

Please sign in to comment.