|
|
|
|
@ -139,6 +139,13 @@ namespace Cxxi
@@ -139,6 +139,13 @@ namespace Cxxi
|
|
|
|
|
{ |
|
|
|
|
public ISet<Declaration> ForwardReferences; |
|
|
|
|
public ISet<Class> Bases; |
|
|
|
|
private Class mainClass; |
|
|
|
|
|
|
|
|
|
public TypeRefsVisitor() |
|
|
|
|
{ |
|
|
|
|
ForwardReferences = new HashSet<Declaration>(); |
|
|
|
|
Bases = new HashSet<Class>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void Collect(Declaration declaration) |
|
|
|
|
{ |
|
|
|
|
@ -151,10 +158,15 @@ namespace Cxxi
@@ -151,10 +158,15 @@ namespace Cxxi
|
|
|
|
|
ForwardReferences.Add(declaration); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public TypeRefsVisitor() |
|
|
|
|
public void Process(Declaration declaration) |
|
|
|
|
{ |
|
|
|
|
ForwardReferences = new HashSet<Declaration>(); |
|
|
|
|
Bases = new HashSet<Class>(); |
|
|
|
|
if (declaration is Class) |
|
|
|
|
{ |
|
|
|
|
mainClass = declaration as Class; |
|
|
|
|
Visited.Remove(mainClass); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
declaration.Visit(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override bool VisitClassDecl(Class @class) |
|
|
|
|
@ -162,6 +174,9 @@ namespace Cxxi
@@ -162,6 +174,9 @@ namespace Cxxi
|
|
|
|
|
if (AlreadyVisited(@class)) |
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
if (@class.Ignore) |
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
Collect(@class); |
|
|
|
|
|
|
|
|
|
// If the class is incomplete, then we cannot process the record
|
|
|
|
|
@ -170,6 +185,9 @@ namespace Cxxi
@@ -170,6 +185,9 @@ namespace Cxxi
|
|
|
|
|
if (@class.IsIncomplete) |
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
if (@class != mainClass) |
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
foreach (var field in @class.Fields) |
|
|
|
|
VisitFieldDecl(field); |
|
|
|
|
|
|
|
|
|
|