Browse Source

Simplify declaration ignores by removing IsProcessed and fixing ExplicitlyIgnored to be recursive like the others ignore properties.

pull/169/head
triton 12 years ago
parent
commit
76cf4e68d8
  1. 24
      src/AST/Declaration.cs
  2. 6
      src/AST/TranslationUnit.cs
  3. 2
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  4. 1
      src/Generator/Library.cs
  5. 3
      src/Generator/Passes/Pass.cs
  6. 2
      src/Generator/Types/Types.cs

24
src/AST/Declaration.cs

@ -133,32 +133,18 @@ namespace CppSharp.AST @@ -133,32 +133,18 @@ namespace CppSharp.AST
}
}
// Whether the declaration should be processed.
public virtual bool IsProcessed
// Whether the declaration was explicitly ignored.
public bool ExplicityIgnored
{
get
{
var isProcessed = !IgnoreFlags.HasFlag(IgnoreFlags.Processing);
var isExplicitlyIgnored = IgnoreFlags.HasFlag(IgnoreFlags.Explicit);
if (Namespace == null)
return isProcessed;
return isProcessed && Namespace.IsProcessed;
}
return isExplicitlyIgnored;
set
{
if (value)
IgnoreFlags &= ~IgnoreFlags.Processing;
else
IgnoreFlags |= IgnoreFlags.Processing;
return isExplicitlyIgnored || Namespace.ExplicityIgnored;
}
}
// Whether the declaration was explicitly ignored.
public bool ExplicityIgnored
{
get { return IgnoreFlags.HasFlag(IgnoreFlags.Explicit); }
set
{

6
src/AST/TranslationUnit.cs

@ -30,12 +30,6 @@ namespace CppSharp.AST @@ -30,12 +30,6 @@ namespace CppSharp.AST
get { return !IgnoreFlags.HasFlag(IgnoreFlags.Generation); }
}
// Whether the unit should be processed.
public override bool IsProcessed
{
get { return !IgnoreFlags.HasFlag(IgnoreFlags.Processing); }
}
// Whether the unit should be ignored.
public override bool Ignore
{

2
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -2459,7 +2459,7 @@ namespace CppSharp.Generators.CSharp @@ -2459,7 +2459,7 @@ namespace CppSharp.Generators.CSharp
public void GenerateInternalFunction(Function function)
{
if (!function.IsProcessed || function.ExplicityIgnored || function.IsPure)
if (function.ExplicityIgnored || function.IsPure)
return;
if (function.OriginalFunction != null)

1
src/Generator/Library.cs

@ -318,7 +318,6 @@ namespace CppSharp @@ -318,7 +318,6 @@ namespace CppSharp
foreach (var unit in units)
{
unit.IsGenerated = false;
unit.IsProcessed = true;
unit.ExplicityIgnored = true;
}
}

3
src/Generator/Passes/Pass.cs

@ -30,9 +30,6 @@ namespace CppSharp.Passes @@ -30,9 +30,6 @@ namespace CppSharp.Passes
public virtual bool VisitTranslationUnit(TranslationUnit unit)
{
if (!unit.IsProcessed)
return false;
if (unit.IsSystemHeader)
return false;

2
src/Generator/Types/Types.cs

@ -54,7 +54,7 @@ namespace CppSharp @@ -54,7 +54,7 @@ namespace CppSharp
if (decl.CompleteDeclaration != null)
return VisitDeclaration(decl.CompleteDeclaration);
if (!decl.IsProcessed || decl.ExplicityIgnored)
if (decl.ExplicityIgnored)
{
Ignore();
return false;

Loading…
Cancel
Save