Fix code generation of dynamic classes, i.e classes having virtual tables.

git-svn-id: http://root.cern.ch/svn/root/trunk@47418 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Vassil Vassilev 2012-11-18 22:57:52 +00:00
parent 9fce4384b9
commit 177d20e14c

View File

@ -209,8 +209,22 @@ namespace cling {
getCodeGenerator()->Initialize(getCI()->getASTContext());
// codegen the transaction
for (Transaction::const_iterator I = T->decls_begin(),
// We assume that there is no ordering of the calls to HandleXYZ, because
// in clang they can happen in different order too, eg. coming from
// template instatiator and so on.
for (Transaction::iterator I = T->decls_begin(),
E = T->decls_end(); I != E; ++I) {
for (DeclGroupRef::const_iterator J = I->begin(), L = I->end();
J != L; ++J)
if (TagDecl* TD = dyn_cast<TagDecl>(*J))
if (TD->isThisDeclarationADefinition()) {
getCodeGenerator()->HandleTagDeclDefinition(TD);
if (CXXRecordDecl* CXXRD = dyn_cast<CXXRecordDecl>(TD))
if (CXXRD->isDynamicClass())
getCodeGenerator()->HandleVTable(CXXRD, true);
}
getCodeGenerator()->HandleTopLevelDecl(*I);
}
getCodeGenerator()->HandleTranslationUnit(getCI()->getASTContext());