diff options
| author | Enrico Granata <egranata@apple.com> | 2013-10-31 22:42:00 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2013-10-31 22:42:00 +0000 |
| commit | fcf0c4e31a0692199cc47751939d813940c1cbbb (patch) | |
| tree | 15f92f0761864401ad7eafd9f717c44d881b65af | |
| parent | 74329d6cff36eaf0e2b527620d127f225a10d528 (diff) | |
| download | bcm5719-llvm-fcf0c4e31a0692199cc47751939d813940c1cbbb.tar.gz bcm5719-llvm-fcf0c4e31a0692199cc47751939d813940c1cbbb.zip | |
Further fixes to the dynamic type system prompted by ObjCDataFormatterTestCase.test_nserror_with_dsym_and_run_command
llvm-svn: 193818
| -rw-r--r-- | lldb/source/Core/ValueObjectDynamicValue.cpp | 10 | ||||
| -rw-r--r-- | lldb/source/DataFormatters/ValueObjectPrinter.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Symbol/ClangASTType.cpp | 9 | ||||
| -rw-r--r-- | lldb/source/Symbol/Type.cpp | 7 |
4 files changed, 18 insertions, 11 deletions
diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp index ff8a0edb801..47e781e7115 100644 --- a/lldb/source/Core/ValueObjectDynamicValue.cpp +++ b/lldb/source/Core/ValueObjectDynamicValue.cpp @@ -69,10 +69,10 @@ ValueObjectDynamicValue::GetTypeName() const bool success = UpdateValueIfNeeded(false); if (success) { - if (m_dynamic_type_info.HasType()) - return GetClangType().GetConstTypeName(); if (m_dynamic_type_info.HasName()) return m_dynamic_type_info.GetName(); + if (m_dynamic_type_info.HasType()) + return GetClangType().GetConstTypeName(); } return m_parent->GetTypeName(); } @@ -94,10 +94,10 @@ ValueObjectDynamicValue::GetQualifiedTypeName() const bool success = UpdateValueIfNeeded(false); if (success) { - if (m_dynamic_type_info.HasType()) - return GetClangType().GetConstQualifiedTypeName (); if (m_dynamic_type_info.HasName()) return m_dynamic_type_info.GetName(); + if (m_dynamic_type_info.HasType()) + return GetClangType().GetConstQualifiedTypeName (); } return m_parent->GetTypeName(); } @@ -155,6 +155,8 @@ FixupTypeAndOrName (const TypeAndOrName& type_andor_name, corrected_name.append(" *"); else if (parent.IsPointerOrReferenceType()) corrected_name.append(" &"); + // the parent type should be a correctly pointer'ed or referenc'ed type + ret.SetClangASTType(parent.GetClangType()); ret.SetName(corrected_name.c_str()); } return ret; diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index 93d7a05e481..5c7f48b600b 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -422,8 +422,7 @@ ValueObjectPrinter::ShouldPrintChildren (bool is_failed_description, curr_ptr_depth = 1; } - if (curr_ptr_depth == 0) - return false; + return (curr_ptr_depth > 0); } TypeSummaryImpl* entry = GetSummaryFormatter(); diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp index 7d6676646d7..0dfabcc931f 100644 --- a/lldb/source/Symbol/ClangASTType.cpp +++ b/lldb/source/Symbol/ClangASTType.cpp @@ -293,12 +293,17 @@ ClangASTType::IsRuntimeGeneratedType () const { if (!IsValid()) return false; + clang::DeclContext* decl_ctx = GetDeclContextForType(); if (!decl_ctx) return false; - if (!llvm::isa<ObjCContainerDecl>(decl_ctx)) + + if (!llvm::isa<clang::ObjCInterfaceDecl>(decl_ctx)) return false; - ClangASTMetadata* ast_metadata = ClangASTContext::GetMetadata(m_ast, decl_ctx); + + clang::ObjCInterfaceDecl *result_iface_decl = llvm::dyn_cast<clang::ObjCInterfaceDecl>(decl_ctx); + + ClangASTMetadata* ast_metadata = ClangASTContext::GetMetadata(m_ast, result_iface_decl); if (!ast_metadata) return false; return (ast_metadata->GetISAPtr() != 0); diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index 81aa44fc987..32a1d474053 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -855,11 +855,12 @@ TypeAndOrName::operator!=(const TypeAndOrName &other) const ConstString TypeAndOrName::GetName () const -{ +{ + if (m_type_name) + return m_type_name; if (m_type_pair) return m_type_pair.GetName(); - else - return m_type_name; + return ConstString("<invalid>"); } void |

