diff options
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index e55ca2ad9c..e37f7c7751 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -415,6 +415,21 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { /// ConvertTagDeclType - Lay out a tagged decl type like struct or union or /// enum. const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) { + + // FIXME. This may have to move to a better place. + if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(TD)) { + assert(!RD->isPolymorphic() && + "FIXME: We don't support polymorphic classes yet!"); + for (CXXRecordDecl::base_class_const_iterator i = RD->bases_begin(), + e = RD->bases_end(); i != e; ++i) { + if (!i->isVirtual()) { + const CXXRecordDecl *Base = + cast<CXXRecordDecl>(i->getType()->getAsRecordType()->getDecl()); + ConvertTagDeclType(Base); + } + } + } + // TagDecl's are not necessarily unique, instead use the (clang) // type connected to the decl. const Type *Key = |