diff options
| -rw-r--r-- | lldb/include/lldb/Symbol/ClangASTContext.h | 6 | ||||
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 30 |
3 files changed, 21 insertions, 17 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 67e907ee27d..b99cf5576ff 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -868,9 +868,9 @@ public: static bool IsPossibleDynamicType (clang::ASTContext *ast, lldb::clang_type_t clang_type, - lldb::clang_type_t *dynamic_pointee_type = NULL, - bool cplusplus = true, - bool objc = true); + lldb::clang_type_t *dynamic_pointee_type, // Can pass NULL + bool check_cplusplus, + bool check_objc); static bool IsCStringType (lldb::clang_type_t clang_type, uint32_t &length); diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index ed370e66c12..c613965087e 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1784,7 +1784,7 @@ ValueObject::IsPossibleDynamicType () if (process) return process->IsPossibleDynamicValue(*this); else - return ClangASTContext::IsPossibleDynamicType (GetClangAST (), GetClangType()); + return ClangASTContext::IsPossibleDynamicType (GetClangAST (), GetClangType(), NULL, true, true); } ValueObjectSP diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 132ab60b34a..c5ad4972f6d 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -5522,10 +5522,18 @@ ClangASTContext::IsPossibleDynamicType (clang::ASTContext *ast, break; case clang::Type::Typedef: - return ClangASTContext::IsPossibleDynamicType (ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), dynamic_pointee_type); + return ClangASTContext::IsPossibleDynamicType (ast, + cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), + dynamic_pointee_type, + check_cplusplus, + check_objc); case clang::Type::Elaborated: - return ClangASTContext::IsPossibleDynamicType (ast, cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(), dynamic_pointee_type); + return ClangASTContext::IsPossibleDynamicType (ast, + cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(), + dynamic_pointee_type, + check_cplusplus, + check_objc); default: break; @@ -5590,23 +5598,19 @@ ClangASTContext::IsPossibleDynamicType (clang::ASTContext *ast, CXXRecordDecl *cxx_record_decl = pointee_qual_type->getAsCXXRecordDecl(); if (cxx_record_decl) { - // Do NOT complete the type here like we used to do - // otherwise EVERY "class *" variable we have will try - // to fully complete itself and this will take a lot of - // time, memory and slow down debugging. If we have a complete - // type, then answer the question definitively, else we - // just say that a C++ class can possibly be dynamic... - if (cxx_record_decl->isCompleteDefinition()) + bool is_complete = cxx_record_decl->isCompleteDefinition(); + if (!is_complete) + is_complete = ClangASTContext::GetCompleteType (ast, clang_type); + + if (is_complete) { success = cxx_record_decl->isDynamicClass(); } else { - // We failed to get the complete type, so we have to - // treat this as a void * which we might possibly be - // able to complete - success = true; + success = false; } + if (success) { if (dynamic_pointee_type) |

