|
|
|
@ -5,15 +5,21 @@ namespace CppSharp.Passes
@@ -5,15 +5,21 @@ namespace CppSharp.Passes
|
|
|
|
|
{ |
|
|
|
|
public class CheckIgnoredDeclsPass : TranslationUnitPass |
|
|
|
|
{ |
|
|
|
|
public CheckIgnoredDeclsPass() |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override bool VisitDeclaration(Declaration decl) |
|
|
|
|
{ |
|
|
|
|
if (decl.ExplicityIgnored) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
if (decl.Access == AccessSpecifier.Private) |
|
|
|
|
{ |
|
|
|
|
Method method = decl as Method; |
|
|
|
|
if (method == null || !method.IsOverride) |
|
|
|
|
{ |
|
|
|
|
decl.ExplicityIgnored = true; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (decl.IsDependent) |
|
|
|
|
{ |
|
|
|
|
decl.ExplicityIgnored = true; |
|
|
|
@ -24,16 +30,6 @@ namespace CppSharp.Passes
@@ -24,16 +30,6 @@ namespace CppSharp.Passes
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override bool VisitClassDecl(Class @class) |
|
|
|
|
{ |
|
|
|
|
if (@class.Access == AccessSpecifier.Private) |
|
|
|
|
{ |
|
|
|
|
@class.ExplicityIgnored = true; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return base.VisitClassDecl(@class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override bool VisitFieldDecl(Field field) |
|
|
|
|
{ |
|
|
|
|
if (!VisitDeclaration(field)) |
|
|
|
@ -106,16 +102,7 @@ namespace CppSharp.Passes
@@ -106,16 +102,7 @@ namespace CppSharp.Passes
|
|
|
|
|
|
|
|
|
|
public override bool VisitMethodDecl(Method method) |
|
|
|
|
{ |
|
|
|
|
if (!VisitDeclaration(method)) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
if (method.Access == AccessSpecifier.Private && !method.IsOverride) |
|
|
|
|
{ |
|
|
|
|
method.ExplicityIgnored = true; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return base.VisitMethodDecl(method); |
|
|
|
|
return VisitDeclaration(method) && base.VisitMethodDecl(method); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override bool VisitTypedefDecl(TypedefDecl typedef) |
|
|
|
|