Browse Source

Keep track of dependent declarations and ignore them.

pull/1/head
triton 12 years ago
parent
commit
d5bf0460c4
  1. 3
      src/Bridge/Declaration.cs
  2. 3
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  3. 3
      src/Parser/Parser.cpp

3
src/Bridge/Declaration.cs

@ -144,6 +144,9 @@ namespace CppSharp @@ -144,6 +144,9 @@ namespace CppSharp
// True if the declaration is incomplete (no definition).
public bool IsIncomplete;
// True if the declaration is dependent.
public bool IsDependent;
// Keeps a reference to the complete version of this declaration.
public Declaration CompleteDeclaration;

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

@ -167,6 +167,9 @@ namespace CppSharp.Generators.CSharp @@ -167,6 +167,9 @@ namespace CppSharp.Generators.CSharp
if (@class.Ignore || @class.IsIncomplete)
continue;
if (@class.IsDependent)
continue;
NewLineIfNeeded();
GenerateClass(@class);
NeedNewLine();

3
src/Parser/Parser.cpp

@ -373,6 +373,7 @@ CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDepe @@ -373,6 +373,7 @@ CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDepe
RC->IsPOD = Record->isPOD();
RC->IsUnion = Record->isUnion();
RC->IsAbstract = Record->isAbstract();
RC->IsDependent = Record->isDependentType();
auto &Sema = C->getSema();
Sema.ForceDeclarationOfImplicitMembers(Record);
@ -402,7 +403,7 @@ CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDepe @@ -402,7 +403,7 @@ CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDepe
// Get the record layout information.
const ASTRecordLayout* Layout = 0;
if (!IsDependent)
if (/*!IsDependent && */!Record->isDependentType())
{
Layout = &C->getASTContext().getASTRecordLayout(Record);
RC->Layout->Alignment = (int)Layout-> getAlignment().getQuantity();

Loading…
Cancel
Save