[Lldb-commits] [lldb] 30ce956 - [lldb][NFC] Remove GetConstTypeName and GetConstQualifiedTypeName from CompilerType
Raphael Isemann via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 12 00:50:13 PST 2020
Author: Raphael Isemann
Date: 2020-02-12T09:49:39+01:00
New Revision: 30ce956aec94ab3785025346a890f4a8cbbe1c58
URL: https://github.com/llvm/llvm-project/commit/30ce956aec94ab3785025346a890f4a8cbbe1c58
DIFF: https://github.com/llvm/llvm-project/commit/30ce956aec94ab3785025346a890f4a8cbbe1c58.diff
LOG: [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.
Added:
Modified:
lldb/include/lldb/DataFormatters/FormatClasses.h
lldb/include/lldb/Symbol/CompilerType.h
lldb/source/Core/ValueObject.cpp
lldb/source/Core/ValueObjectChild.cpp
lldb/source/Core/ValueObjectConstResult.cpp
lldb/source/Core/ValueObjectMemory.cpp
lldb/source/Core/ValueObjectRegister.cpp
lldb/source/DataFormatters/FormatManager.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
lldb/source/Symbol/CompilerType.cpp
lldb/source/Symbol/Type.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/DataFormatters/FormatClasses.h b/lldb/include/lldb/DataFormatters/FormatClasses.h
index 344a2d70ac53..41b9539803aa 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 3885283e8ecf..8399166b4dd4 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 80e41c91e68b..71ceef7798d3 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 778bcecf05d3..6205ed32c615 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 80d7783ea267..8d84f8e62ccc 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 b1fd51386682..91b2c6084928 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 bd1e2359afae..ec87c38fb367 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 0230c84e992e..23ad6c67f887 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 bae489128fd1..0f89550984ac 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 a9e48e2cabfe..459e02e55745 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 ba69b6b9f0c2..1507f2c3121b 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("<invalid>");
-}
-
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 b6d86801d230..09c0e1638793 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,
More information about the lldb-commits
mailing list