Browse Source

Fields now keep a reference to their class.

pull/1/head
triton 13 years ago
parent
commit
e6de2de511
  1. 1
      src/Bridge/Field.cs
  2. 5
      src/Parser/Parser.cpp
  3. 2
      src/Parser/Parser.h

1
src/Bridge/Field.cs

@ -10,6 +10,7 @@ namespace Cxxi @@ -10,6 +10,7 @@ namespace Cxxi
public AccessSpecifier Access { get; set; }
public uint Offset { get; set; }
public Class Class { get; set; }
public Field()
{

5
src/Parser/Parser.cpp

@ -381,7 +381,7 @@ Cxxi::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDependen @@ -381,7 +381,7 @@ Cxxi::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDependen
{
FieldDecl* FD = (*it);
Cxxi::Field^ Field = WalkFieldCXX(FD);
Cxxi::Field^ Field = WalkFieldCXX(FD, RC);
if (Layout)
Field->Offset = Layout->getFieldOffset(FD->getFieldIndex());
@ -513,7 +513,7 @@ Cxxi::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD) @@ -513,7 +513,7 @@ Cxxi::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD)
//-----------------------------------//
Cxxi::Field^ Parser::WalkFieldCXX(clang::FieldDecl* FD)
Cxxi::Field^ Parser::WalkFieldCXX(clang::FieldDecl* FD, Cxxi::Class^ Class)
{
using namespace clang;
using namespace clix;
@ -528,6 +528,7 @@ Cxxi::Field^ Parser::WalkFieldCXX(clang::FieldDecl* FD) @@ -528,6 +528,7 @@ Cxxi::Field^ Parser::WalkFieldCXX(clang::FieldDecl* FD)
auto TL = FD->getTypeSourceInfo()->getTypeLoc();
F->QualifiedType = GetQualifiedType(FD->getType(), WalkType(FD->getType(), &TL));
F->Access = ConvertToAccess(FD->getAccess());
F->Class = Class;
HandleComments(FD, F);

2
src/Parser/Parser.h

@ -99,7 +99,7 @@ protected: @@ -99,7 +99,7 @@ protected:
Cxxi::Function^ WalkFunction(clang::FunctionDecl*, bool IsDependent = false);
Cxxi::Class^ WalkRecordCXX(clang::CXXRecordDecl*, bool IsDependent = false);
Cxxi::Method^ WalkMethodCXX(clang::CXXMethodDecl*);
Cxxi::Field^ WalkFieldCXX(clang::FieldDecl*);
Cxxi::Field^ WalkFieldCXX(clang::FieldDecl*, Cxxi::Class^);
Cxxi::ClassTemplate^ Parser::WalkClassTemplate(clang::ClassTemplateDecl*);
Cxxi::FunctionTemplate^ Parser::WalkFunctionTemplate(
clang::FunctionTemplateDecl*);

Loading…
Cancel
Save