Permalink
Browse files

Fixed the generation of symbols to check all base classes up the chain.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
  • Loading branch information...
ddobrev committed Aug 9, 2017
1 parent 93f5b89 commit 27acdd262e99e5b9c2cea455a58a3413650f3e09
Showing with 14 additions and 7 deletions.
  1. +14 −7 src/Generator/Passes/GenerateSymbolsPass.cs
@@ -50,7 +50,7 @@ private void GenerateSymbols()
symbolsCodeGenerator.NewLine();
foreach (var specialization in specializations[module])
foreach (var method in specialization.Methods.Where(
m => m.IsGenerated && !m.IsDependent && !m.IsImplicit))
m => m.IsGenerated && !m.IsDependent && !m.IsImplicit && !m.IsDeleted))
symbolsCodeGenerator.VisitMethodDecl(method);
}
@@ -79,12 +79,7 @@ public override bool VisitClassDecl(Class @class)
s => s.IsExplicitlyGenerated))
specialization.Visit(this);
else
foreach (var @base in @class.Bases.Where(b => b.IsClass))
{
var specialization = @base.Class as ClassTemplateSpecialization;
if (specialization != null && !specialization.IsExplicitlyGenerated)
Add(specialization);
}
CheckBasesForSpecialization(@class);
return true;
}
@@ -195,6 +190,18 @@ private void CollectSymbols(string outputDir, string symbols)
}
}
private void CheckBasesForSpecialization(Class @class)
{
foreach (var @base in @class.Bases.Where(b => b.IsClass))
{
var specialization = @base.Class as ClassTemplateSpecialization;
if (specialization != null && !specialization.IsExplicitlyGenerated &&
specialization.SpecializationKind != TemplateSpecializationKind.ExplicitSpecialization)
Add(specialization);
CheckBasesForSpecialization(@base.Class);
}
}
private void Add(ClassTemplateSpecialization specialization)
{
ICollection<ClassTemplateSpecialization> specs;

0 comments on commit 27acdd2

Please sign in to comment.