davide created this revision. davide added reviewers: shafik, JDevlieghere, alex, compnerd, teemperor. Herald added a project: LLDB.
.. removing IsMeaninglessWithoutTypeResolution(). I'm fairly confident this was introduced to support swift, where static types [without dynamic counterpart] don't carry a lot of value. Since then, the formatters and dynamic type resolution has been rewritten, and we employ different solutions. This function is unused here too, so let's get read of it. rdar://problem/36377967 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D65782 Files: lldb/include/lldb/Symbol/CompilerType.h lldb/include/lldb/Symbol/TypeSystem.h lldb/source/DataFormatters/FormatManager.cpp lldb/source/Symbol/CompilerType.cpp lldb/source/Symbol/TypeSystem.cpp
Index: lldb/source/Symbol/TypeSystem.cpp =================================================================== --- lldb/source/Symbol/TypeSystem.cpp +++ lldb/source/Symbol/TypeSystem.cpp @@ -125,10 +125,6 @@ return eLazyBoolCalculate; } -bool TypeSystem::IsMeaninglessWithoutDynamicResolution(void *type) { - return false; -} - ConstString TypeSystem::DeclGetMangledName(void *opaque_decl) { return ConstString(); } Index: lldb/source/Symbol/CompilerType.cpp =================================================================== --- lldb/source/Symbol/CompilerType.cpp +++ lldb/source/Symbol/CompilerType.cpp @@ -709,12 +709,6 @@ return eLazyBoolCalculate; } -bool CompilerType::IsMeaninglessWithoutDynamicResolution() const { - if (IsValid()) - return m_type_system->IsMeaninglessWithoutDynamicResolution(m_type); - return false; -} - // Get the index of the child of "clang_type" whose name matches. This function // doesn't descend into the children, but only looks one level deep and name // matches can include base class names. Index: lldb/source/DataFormatters/FormatManager.cpp =================================================================== --- lldb/source/DataFormatters/FormatManager.cpp +++ lldb/source/DataFormatters/FormatManager.cpp @@ -183,15 +183,13 @@ reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField; } - if (!compiler_type.IsMeaninglessWithoutDynamicResolution()) { - entries.push_back( - {type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef}); + entries.push_back( + {type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef}); - ConstString display_type_name(compiler_type.GetDisplayTypeName()); - if (display_type_name != type_name) - entries.push_back({display_type_name, reason, did_strip_ptr, - did_strip_ref, did_strip_typedef}); - } + ConstString display_type_name(compiler_type.GetDisplayTypeName()); + if (display_type_name != type_name) + entries.push_back({display_type_name, reason, did_strip_ptr, did_strip_ref, + did_strip_typedef}); for (bool is_rvalue_ref = true, j = true; j && compiler_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false) { @@ -565,10 +563,8 @@ lldb::DynamicValueType use_dynamic) { ValueObjectSP valobj_sp = valobj.GetQualifiedRepresentationIfAvailable( use_dynamic, valobj.IsSynthetic()); - if (valobj_sp && valobj_sp->GetCompilerType().IsValid()) { - if (!valobj_sp->GetCompilerType().IsMeaninglessWithoutDynamicResolution()) - return valobj_sp->GetQualifiedTypeName(); - } + if (valobj_sp && valobj_sp->GetCompilerType().IsValid()) + return valobj_sp->GetQualifiedTypeName(); return ConstString(); } Index: lldb/include/lldb/Symbol/TypeSystem.h =================================================================== --- lldb/include/lldb/Symbol/TypeSystem.h +++ lldb/include/lldb/Symbol/TypeSystem.h @@ -454,20 +454,6 @@ virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj); - // Type systems can have types that are placeholder types, which are meant to - // indicate the presence of a type, but offer no actual information about - // said types, and leave the burden of actually figuring type information out - // to dynamic type resolution. For instance a language with a generics - // system, can use placeholder types to indicate "type argument goes here", - // without promising uniqueness of the placeholder, nor attaching any - // actually idenfiable information to said placeholder. This API allows type - // systems to tell LLDB when such a type has been encountered In response, - // the debugger can react by not using this type as a cache entry in any - // type-specific way For instance, LLDB will currently not cache any - // formatters that are discovered on such a type as attributable to the - // meaningless type itself, instead preferring to use the dynamic type - virtual bool IsMeaninglessWithoutDynamicResolution(void *type); - protected: const LLVMCastKind m_kind; // Support for llvm casting SymbolFile *m_sym_file; Index: lldb/include/lldb/Symbol/CompilerType.h =================================================================== --- lldb/include/lldb/Symbol/CompilerType.h +++ lldb/include/lldb/Symbol/CompilerType.h @@ -334,8 +334,6 @@ LazyBool ShouldPrintAsOneLiner(ValueObject *valobj) const; - bool IsMeaninglessWithoutDynamicResolution() const; - // Dumping types #ifndef NDEBUG
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits