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

6
src/Generator/Passes/CheckIgnoredDecls.cs

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

Loading…
Cancel
Save