From 30ce956aec94ab3785025346a890f4a8cbbe1c58 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Wed, 12 Feb 2020 09:35:19 +0100 Subject: [PATCH] [lldb][NFC] Remove GetConstTypeName and GetConstQualifiedTypeName from CompilerType Beside these two functions just being wrappers around GetTypeName they are also just a leftover from migrating the CompilerType interface to ConstString. --- lldb/include/lldb/DataFormatters/FormatClasses.h | 2 +- lldb/include/lldb/Symbol/CompilerType.h | 4 ---- lldb/source/Core/ValueObject.cpp | 4 ++-- lldb/source/Core/ValueObjectChild.cpp | 4 ++-- lldb/source/Core/ValueObjectConstResult.cpp | 2 +- lldb/source/Core/ValueObjectMemory.cpp | 2 +- lldb/source/Core/ValueObjectRegister.cpp | 2 +- lldb/source/DataFormatters/FormatManager.cpp | 2 +- .../ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp | 2 +- .../LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp | 2 +- lldb/source/Symbol/CompilerType.cpp | 13 ------------- lldb/source/Symbol/Type.cpp | 4 ++-- 12 files changed, 13 insertions(+), 30 deletions(-) diff --git a/lldb/include/lldb/DataFormatters/FormatClasses.h b/lldb/include/lldb/DataFormatters/FormatClasses.h index 344a2d70ac536..41b9539803aaa 100644 --- a/lldb/include/lldb/DataFormatters/FormatClasses.h +++ b/lldb/include/lldb/DataFormatters/FormatClasses.h @@ -126,7 +126,7 @@ class TypeNameSpecifierImpl { TypeNameSpecifierImpl(CompilerType type) : m_is_regex(false), m_type() { if (type.IsValid()) { - m_type.m_type_name.assign(type.GetConstTypeName().GetCString()); + m_type.m_type_name.assign(type.GetTypeName().GetCString()); m_type.m_compiler_type = type; } } diff --git a/lldb/include/lldb/Symbol/CompilerType.h b/lldb/include/lldb/Symbol/CompilerType.h index 3885283e8ecf9..8399166b4dd42 100644 --- a/lldb/include/lldb/Symbol/CompilerType.h +++ b/lldb/include/lldb/Symbol/CompilerType.h @@ -149,10 +149,6 @@ class CompilerType { TypeSystem *GetTypeSystem() const { return m_type_system; } - ConstString GetConstQualifiedTypeName() const; - - ConstString GetConstTypeName() const; - ConstString GetTypeName() const; ConstString GetDisplayTypeName() const; diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 80e41c91e68b2..71ceef7798d31 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1650,13 +1650,13 @@ bool ValueObject::GetDeclaration(Declaration &decl) { } ConstString ValueObject::GetTypeName() { - return GetCompilerType().GetConstTypeName(); + return GetCompilerType().GetTypeName(); } ConstString ValueObject::GetDisplayTypeName() { return GetTypeName(); } ConstString ValueObject::GetQualifiedTypeName() { - return GetCompilerType().GetConstQualifiedTypeName(); + return GetCompilerType().GetTypeName(); } LanguageType ValueObject::GetObjectRuntimeLanguage() { diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp index 778bcecf05d3f..6205ed32c615a 100644 --- a/lldb/source/Core/ValueObjectChild.cpp +++ b/lldb/source/Core/ValueObjectChild.cpp @@ -70,14 +70,14 @@ static void AdjustForBitfieldness(ConstString &name, ConstString ValueObjectChild::GetTypeName() { if (m_type_name.IsEmpty()) { - m_type_name = GetCompilerType().GetConstTypeName(); + m_type_name = GetCompilerType().GetTypeName(); AdjustForBitfieldness(m_type_name, m_bitfield_bit_size); } return m_type_name; } ConstString ValueObjectChild::GetQualifiedTypeName() { - ConstString qualified_name = GetCompilerType().GetConstTypeName(); + ConstString qualified_name = GetCompilerType().GetTypeName(); AdjustForBitfieldness(qualified_name, m_bitfield_bit_size); return qualified_name; } diff --git a/lldb/source/Core/ValueObjectConstResult.cpp b/lldb/source/Core/ValueObjectConstResult.cpp index 80d7783ea2673..8d84f8e62ccc5 100644 --- a/lldb/source/Core/ValueObjectConstResult.cpp +++ b/lldb/source/Core/ValueObjectConstResult.cpp @@ -228,7 +228,7 @@ size_t ValueObjectConstResult::CalculateNumChildren(uint32_t max) { ConstString ValueObjectConstResult::GetTypeName() { if (m_type_name.IsEmpty()) - m_type_name = GetCompilerType().GetConstTypeName(); + m_type_name = GetCompilerType().GetTypeName(); return m_type_name; } diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp index b1fd513866829..91b2c6084928a 100644 --- a/lldb/source/Core/ValueObjectMemory.cpp +++ b/lldb/source/Core/ValueObjectMemory.cpp @@ -117,7 +117,7 @@ CompilerType ValueObjectMemory::GetCompilerTypeImpl() { ConstString ValueObjectMemory::GetTypeName() { if (m_type_sp) return m_type_sp->GetName(); - return m_compiler_type.GetConstTypeName(); + return m_compiler_type.GetTypeName(); } ConstString ValueObjectMemory::GetDisplayTypeName() { diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp index bd1e2359afae6..ec87c38fb3679 100644 --- a/lldb/source/Core/ValueObjectRegister.cpp +++ b/lldb/source/Core/ValueObjectRegister.cpp @@ -219,7 +219,7 @@ CompilerType ValueObjectRegister::GetCompilerTypeImpl() { ConstString ValueObjectRegister::GetTypeName() { if (m_type_name.IsEmpty()) - m_type_name = GetCompilerType().GetConstTypeName(); + m_type_name = GetCompilerType().GetTypeName(); return m_type_name; } diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 0230c84e992e9..23ad6c67f8876 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -179,7 +179,7 @@ void FormatManager::GetPossibleMatches( bool did_strip_ptr, bool did_strip_ref, bool did_strip_typedef, bool root_level) { compiler_type = compiler_type.GetTypeForFormatters(); - ConstString type_name(compiler_type.GetConstTypeName()); + ConstString type_name(compiler_type.GetTypeName()); if (valobj.GetBitfieldBitSize() > 0) { StreamString sstring; sstring.Printf("%s:%d", type_name.AsCString(), valobj.GetBitfieldBitSize()); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index bae489128fd1d..0f89550984acd 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -895,7 +895,7 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type, const char *ivar_name) { uint32_t ivar_offset = LLDB_INVALID_IVAR_OFFSET; - ConstString class_name = parent_ast_type.GetConstTypeName(); + ConstString class_name = parent_ast_type.GetTypeName(); if (!class_name.IsEmpty() && ivar_name && ivar_name[0]) { // Make the objective C V2 mangled name for the ivar offset from the class // name and ivar name diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp index a9e48e2cabfe0..459e02e557450 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp @@ -397,7 +397,7 @@ ObjCLanguageRuntime::GetRuntimeType(CompilerType base_type) { if (!class_type) return llvm::None; - ConstString class_name(class_type.GetConstTypeName()); + ConstString class_name(class_type.GetTypeName()); if (!class_name) return llvm::None; diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp index ba69b6b9f0c21..1507f2c3121b3 100644 --- a/lldb/source/Symbol/CompilerType.cpp +++ b/lldb/source/Symbol/CompilerType.cpp @@ -268,19 +268,6 @@ size_t CompilerType::GetPointerByteSize() const { return 0; } -ConstString CompilerType::GetConstQualifiedTypeName() const { - return GetConstTypeName(); -} - -ConstString CompilerType::GetConstTypeName() const { - if (IsValid()) { - ConstString type_name(GetTypeName()); - if (type_name) - return type_name; - } - return ConstString(""); -} - ConstString CompilerType::GetTypeName() const { if (IsValid()) { return m_type_system->GetTypeName(m_type); diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index b6d86801d2309..09c0e16387937 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -303,7 +303,7 @@ void Type::Dump(Stream *s, bool show_context) { ConstString Type::GetName() { if (!m_name) - m_name = GetForwardCompilerType().GetConstTypeName(); + m_name = GetForwardCompilerType().GetTypeName(); return m_name; } @@ -657,7 +657,7 @@ CompilerType Type::GetForwardCompilerType() { } ConstString Type::GetQualifiedName() { - return GetForwardCompilerType().GetConstTypeName(); + return GetForwardCompilerType().GetTypeName(); } bool Type::GetTypeScopeAndBasename(const llvm::StringRef& name,