|
|
|
@ -14,25 +14,24 @@ namespace CppSharp.Passes
@@ -14,25 +14,24 @@ namespace CppSharp.Passes
|
|
|
|
|
|
|
|
|
|
public override bool VisitClassDecl(Class @class) |
|
|
|
|
{ |
|
|
|
|
if (!@class.IsIncomplete) |
|
|
|
|
goto Out; |
|
|
|
|
if (!base.VisitClassDecl(@class)) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
if (@class.CompleteDeclaration != null) |
|
|
|
|
goto Out; |
|
|
|
|
EnsureCompleteDeclaration(@class); |
|
|
|
|
|
|
|
|
|
@class.CompleteDeclaration = |
|
|
|
|
AstContext.FindCompleteClass(@class.QualifiedName); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (@class.CompleteDeclaration == null) |
|
|
|
|
{ |
|
|
|
|
@class.GenerationKind = GenerationKind.Internal; |
|
|
|
|
Driver.Diagnostics.Debug("Unresolved declaration: {0}", |
|
|
|
|
@class.Name); |
|
|
|
|
} |
|
|
|
|
public override bool VisitClassTemplateDecl(ClassTemplate template) |
|
|
|
|
{ |
|
|
|
|
if (!base.VisitClassTemplateDecl(template)) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
Out: |
|
|
|
|
EnsureCompleteDeclaration(template.TemplatedDecl); |
|
|
|
|
|
|
|
|
|
return base.VisitClassDecl(@class); |
|
|
|
|
template.TemplatedDecl = template.TemplatedDecl.CompleteDeclaration ?? template.TemplatedDecl; |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override bool VisitEnumDecl(Enumeration @enum) |
|
|
|
@ -59,5 +58,24 @@ namespace CppSharp.Passes
@@ -59,5 +58,24 @@ namespace CppSharp.Passes
|
|
|
|
|
|
|
|
|
|
return base.VisitEnumDecl(@enum); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void EnsureCompleteDeclaration(Declaration declaration) |
|
|
|
|
{ |
|
|
|
|
if (!declaration.IsIncomplete) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (declaration.CompleteDeclaration != null) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
declaration.CompleteDeclaration = |
|
|
|
|
AstContext.FindCompleteClass(declaration.QualifiedName); |
|
|
|
|
|
|
|
|
|
if (declaration.CompleteDeclaration == null) |
|
|
|
|
{ |
|
|
|
|
declaration.GenerationKind = GenerationKind.Internal; |
|
|
|
|
Driver.Diagnostics.Debug("Unresolved declaration: {0}", |
|
|
|
|
declaration.Name); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|