mirror of
https://github.com/nasa/trick.git
synced 2025-06-05 09:01:05 +00:00
Fixes io_src code for typedef structures.
Found that my check for embedded classes was also catching some typedef structures. This was causing some io_src code not to be generated. Changed the test so that we can differentiate between embedded classes and the typedefs. This change fixes #10 and fixes #23.
This commit is contained in:
parent
48a09d386e
commit
ea085eb9ee
@ -235,15 +235,22 @@ bool FieldVisitor::VisitRecordType(clang::RecordType *rt) {
|
|||||||
} SB ;
|
} SB ;
|
||||||
} ;
|
} ;
|
||||||
*/
|
*/
|
||||||
if ( rt->getDecl()->getIdentifier() == NULL ) {
|
//std::cout << "hasNameForLinkage " << rt->getDecl()->hasNameForLinkage() << std::endl ;
|
||||||
|
if ( rt->getDecl()->hasNameForLinkage() ) {
|
||||||
|
if ( rt->getDecl()->getDeclName() ) {
|
||||||
|
//std::cout << "getDeclName " << rt->getDecl()->getDeclName().getAsString() << std::endl ;
|
||||||
|
fdes->setTypeName(rt->getDecl()->getQualifiedNameAsString()) ;
|
||||||
|
} else {
|
||||||
|
//std::cout << "getTypedefNameForAnonDecl " << rt->getDecl()->getTypedefNameForAnonDecl() << std::endl ;
|
||||||
|
fdes->setTypeName(rt->getDecl()->getTypedefNameForAnonDecl()->getQualifiedNameAsString()) ;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
//rt->getDecl()->dump() ; std::cout << std::endl ;
|
//rt->getDecl()->dump() ; std::cout << std::endl ;
|
||||||
// io_src code not possible for anonymous struct/unions. Set the I/O to 0 to ignore it.
|
// io_src code not possible for anonymous struct/unions. Set the I/O to 0 to ignore it.
|
||||||
if ( debug_level >= 3 ) {
|
if ( debug_level >= 3 ) {
|
||||||
std::cout << "FieldVisitor VisitRecordType found anonymous type, setIO = 0" << std::endl ;
|
std::cout << "FieldVisitor VisitRecordType found anonymous type, setIO = 0" << std::endl ;
|
||||||
}
|
}
|
||||||
fdes->setIO(0) ;
|
fdes->setIO(0) ;
|
||||||
} else {
|
|
||||||
fdes->setTypeName(rt->getDecl()->getQualifiedNameAsString()) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fdes->setEnumString("TRICK_STRUCTURED") ;
|
fdes->setEnumString("TRICK_STRUCTURED") ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user