Browse Source

Initialize the class layout in the new parser.

pull/222/head
triton 11 years ago
parent
commit
54fa62beae
  1. 6
      src/CppParser/Parser.cpp

6
src/CppParser/Parser.cpp

@ -495,11 +495,13 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, Class* C) @@ -495,11 +495,13 @@ void Parser::WalkVTable(clang::CXXRecordDecl* RD, Class* C)
assert(RD->isDynamicClass() && "Only dynamic classes have virtual tables");
if (!C->Layout)
C->Layout = new ClassLayout();
switch(TargetABI)
{
case TargetCXXABI::Microsoft:
{
C->Layout = new ClassLayout();
C->Layout->ABI = CppAbi::Microsoft;
MicrosoftVTableContext VTContext(*AST);
@ -613,6 +615,8 @@ void Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, Class* RC) @@ -613,6 +615,8 @@ void Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, Class* RC)
if (hasLayout)
{
Layout = &C->getASTContext().getASTRecordLayout(Record);
if (!RC->Layout)
RC->Layout = new ClassLayout();
RC->Layout->Alignment = (int)Layout-> getAlignment().getQuantity();
RC->Layout->Size = (int)Layout->getSize().getQuantity();
RC->Layout->DataSize = (int)Layout->getDataSize().getQuantity();

Loading…
Cancel
Save