Browse Source

Fixed a regression causing generated types to be incorrectly reordered.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/980/head
Dimitar Dobrev 8 years ago
parent
commit
b41b96df77
  1. 6
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs
  2. 6
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs
  3. 49
      src/CppParser/Parser.cpp

6
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs

@ -53,6 +53,10 @@ namespace Std @@ -53,6 +53,10 @@ namespace Std
{
}
namespace Std
{
}
namespace Std
{
namespace Allocator
@ -418,7 +422,7 @@ namespace Std @@ -418,7 +422,7 @@ namespace Std
}
}
public unsafe partial class Map<_95, _96, _97, _98>
public unsafe partial class Map<_Key, _Tp, _Compare, _Allocator>
{
}
}

6
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs

@ -53,6 +53,10 @@ namespace Std @@ -53,6 +53,10 @@ namespace Std
{
}
namespace Std
{
}
namespace Std
{
namespace Allocator
@ -418,7 +422,7 @@ namespace Std @@ -418,7 +422,7 @@ namespace Std
}
}
public unsafe partial class Map<_95, _96, _97, _98>
public unsafe partial class Map<_Key, _Tp, _Compare, _Allocator>
{
}
}

49
src/CppParser/Parser.cpp

@ -1055,7 +1055,7 @@ Parser::WalkClassTemplateSpecialization(const clang::ClassTemplateSpecialization @@ -1055,7 +1055,7 @@ Parser::WalkClassTemplateSpecialization(const clang::ClassTemplateSpecialization
TS->isIncomplete = true;
if (CTS->getDefinition())
{
auto Complete = WalkDeclaration(CTS->getDefinition());
auto Complete = WalkDeclarationDef(CTS->getDefinition());
if (!Complete->isIncomplete)
TS->completeDeclaration = Complete;
}
@ -1105,7 +1105,7 @@ Parser::WalkClassTemplatePartialSpecialization(const clang::ClassTemplatePartial @@ -1105,7 +1105,7 @@ Parser::WalkClassTemplatePartialSpecialization(const clang::ClassTemplatePartial
TS->isIncomplete = true;
if (CTS->getDefinition())
{
auto Complete = WalkDeclaration(CTS->getDefinition());
auto Complete = WalkDeclarationDef(CTS->getDefinition());
if (!Complete->isIncomplete)
TS->completeDeclaration = Complete;
}
@ -3468,7 +3468,18 @@ void Parser::HandleDeclaration(const clang::Decl* D, Declaration* Decl) @@ -3468,7 +3468,18 @@ void Parser::HandleDeclaration(const clang::Decl* D, Declaration* Decl)
Declaration* Parser::WalkDeclarationDef(clang::Decl* D)
{
return WalkDeclaration(D);
auto Decl = WalkDeclaration(D);
if (!Decl || Decl->definitionOrder > 0)
return Decl;
// We store a definition order index into the declarations.
// This is needed because declarations are added to their contexts as
// soon as they are referenced and we need to know the original order
// of the declarations.
clang::RecordDecl* RecordDecl;
if ((RecordDecl = llvm::dyn_cast<clang::RecordDecl>(D)) &&
RecordDecl->isCompleteDefinition())
Decl->definitionOrder = index++;
return Decl;
}
Declaration* Parser::WalkDeclaration(const clang::Decl* D)
@ -3483,41 +3494,13 @@ Declaration* Parser::WalkDeclaration(const clang::Decl* D) @@ -3483,41 +3494,13 @@ Declaration* Parser::WalkDeclaration(const clang::Decl* D)
case Decl::Record:
{
auto RD = cast<RecordDecl>(D);
auto Record = WalkRecord(RD);
// We store a definition order index into the declarations.
// This is needed because declarations are added to their contexts as
// soon as they are referenced and we need to know the original order
// of the declarations.
if (Record->definitionOrder == 0 &&
RD->isCompleteDefinition())
{
Record->definitionOrder = index++;
//Debug("%d: %s\n", Index++, GetTagDeclName(RD).c_str());
}
Decl = Record;
Decl = WalkRecord(RD);
break;
}
case Decl::CXXRecord:
{
auto RD = cast<CXXRecordDecl>(D);
auto Class = WalkRecordCXX(RD);
// We store a definition order index into the declarations.
// This is needed because declarations are added to their contexts as
// soon as they are referenced and we need to know the original order
// of the declarations.
if (Class->definitionOrder == 0 &&
RD->isCompleteDefinition())
{
Class->definitionOrder = index++;
//Debug("%d: %s\n", Index++, GetTagDeclName(RD).c_str());
}
Decl = Class;
Decl = WalkRecordCXX(RD);
break;
}
case Decl::ClassTemplate:

Loading…
Cancel
Save