mirror of
https://github.com/nasa/trick.git
synced 2025-06-14 05:08:22 +00:00
ICG produces non-compilable io_* code for this weird example #334
When saving the list of namespaces and classes a particular type is contained in we have to save the class name and any template args it includes separately. This allows us to mangle the names easier. And we now search for type names to see if they follow this pattern template_name<template_args>::embedded_class. If we are using a template embedded class we need to create attributes for the embedded class.
This commit is contained in:
@ -161,6 +161,11 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
|
||||
cval.setCompat15(hsd.isPathInCompat15(rp)) ;
|
||||
free(rp) ;
|
||||
|
||||
// If we have trouble determining the containing namespace and classes skip this variable.
|
||||
if ( !cval.getNamespacesAndClasses(rec->getDeclContext())) {
|
||||
return false ;
|
||||
}
|
||||
|
||||
// If this class needs a default constructor, then the complier will generate one and we can call it.
|
||||
if ( rec->needsImplicitDefaultConstructor() ) {
|
||||
cval.setHasDefaultConstructor(true) ;
|
||||
@ -187,10 +192,10 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
|
||||
|
||||
cval.setSize(rec->getASTContext().getASTRecordLayout(rec).getSize().getQuantity()) ;
|
||||
|
||||
clang::CXXRecordDecl::base_class_iterator bcii ;
|
||||
|
||||
//std::cout << "parsing " << cval.getName() << std::endl ;
|
||||
//std::cout << " [34mprocessing inheritance " << rec->getNumBases() << " " << rec->getNumVBases() << "[00m" << std::endl ;
|
||||
clang::CXXRecordDecl::base_class_iterator bcii ;
|
||||
for ( bcii = rec->bases_begin() ; bcii != rec->bases_end() ; bcii++ ) {
|
||||
if ( !bcii->isVirtual() ) {
|
||||
const clang::Type * temp = bcii->getType().getTypePtr() ;
|
||||
@ -279,8 +284,6 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
|
||||
}
|
||||
}
|
||||
|
||||
cval.getNamespacesAndClasses(rec->getDeclContext()) ;
|
||||
|
||||
// clears obscured inherited variables caused by diamond inheritance
|
||||
cval.clearAmbiguousVariables() ;
|
||||
|
||||
|
Reference in New Issue
Block a user