Browse Source

Improve ignored check for decls with explicit generation kinds.

pull/1511/head
Joao Matos 5 years ago committed by João Matos
parent
commit
fb34f55f76
  1. 5
      src/AST/Declaration.cs
  2. 6
      src/Generator/Passes/CheckIgnoredDecls.cs

5
src/AST/Declaration.cs

@ -72,6 +72,11 @@ namespace CppSharp.AST
/// </summary> /// </summary>
public virtual bool IsGenerated => GenerationKind == GenerationKind.Generate; public virtual bool IsGenerated => GenerationKind == GenerationKind.Generate;
/// <summary>
/// Whether the declaration has an explicit set generation kind.
/// </summary>
public bool HasExplicitGenerationKind => generationKind.HasValue;
/// <summary> /// <summary>
/// Whether the declaration was explicitly set to be generated via /// Whether the declaration was explicitly set to be generated via
/// the GenerationKind propery as opposed to the default generated state. /// the GenerationKind propery as opposed to the default generated state.

6
src/Generator/Passes/CheckIgnoredDecls.cs

@ -13,9 +13,6 @@ namespace CppSharp.Passes
public bool CheckDeclarationAccess(Declaration decl) public bool CheckDeclarationAccess(Declaration decl)
{ {
if (decl.IsExplicitlyGenerated)
return true;
switch (decl.Access) switch (decl.Access)
{ {
case AccessSpecifier.Public: case AccessSpecifier.Public:
@ -79,6 +76,9 @@ namespace CppSharp.Passes
if (AlreadyVisited(decl)) if (AlreadyVisited(decl))
return false; return false;
if (decl.HasExplicitGenerationKind)
return true;
if (decl.GenerationKind == GenerationKind.None) if (decl.GenerationKind == GenerationKind.None)
return true; return true;

Loading…
Cancel
Save