Pointers to STLs cannot be checkpointed. #552

Added code to disable printing of STLs if it is arrayed or has pointer
dimensions.
This commit is contained in:
Alex Lin 2018-01-25 09:40:23 -06:00
parent a2d0387d57
commit 54b57bc351
2 changed files with 11 additions and 0 deletions

View File

@ -128,6 +128,10 @@ bool FieldVisitor::VisitBuiltinType(clang::BuiltinType *bt) {
bool FieldVisitor::VisitConstantArrayType(clang::ConstantArrayType *cat) {
//cat->dump() ; std::cout << std::endl ;
fdes->addArrayDim(cat->getSize().getZExtValue()) ;
// If this field is an arrayed STL, skip it!
if ( fdes->isSTL() ) {
fdes->setIO(0) ;
}
return true;
}
@ -249,6 +253,10 @@ bool FieldVisitor::VisitFieldDecl( clang::FieldDecl *field ) {
bool FieldVisitor::VisitPointerType(clang::PointerType *p) {
fdes->addArrayDim(-1) ;
// If this field is a pointer to an STL, skip it!
if ( fdes->isSTL() ) {
fdes->setIO(0) ;
}
return true;
}

View File

@ -60,6 +60,9 @@ bool PrintFileContentsBase::isPrintable( ClassValues * c , FieldDescription * fd
if ( !(fdes->getIO() & ioMask) || !fdes->getTypeName().compare("void") || !fdes->getEnumString().compare("TRICK_VOID")) {
return false;
}
if ( fdes->isSTL() and fdes->getNumDims() ) {
return false;
}
if ( fdes->getAccess() == clang::AS_public || (!fdes->isStatic() && !global_compat15 && !c->isCompat15())) {
return true;
}