Skip to content

Commit

Permalink
[lldb][NFC] Remove GetConstTypeName and GetConstQualifiedTypeName fro…
Browse files Browse the repository at this point in the history
…m CompilerType

Beside these two functions just being wrappers around GetTypeName they are also
just a leftover from migrating the CompilerType interface to ConstString.
  • Loading branch information
Teemperor committed Feb 12, 2020
1 parent 440460f commit 30ce956
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lldb/include/lldb/DataFormatters/FormatClasses.h
Expand Up @@ -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;
}
}
Expand Down
4 changes: 0 additions & 4 deletions lldb/include/lldb/Symbol/CompilerType.h
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Core/ValueObject.cpp
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Core/ValueObjectChild.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObjectConstResult.cpp
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObjectMemory.cpp
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObjectRegister.cpp
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/DataFormatters/FormatManager.cpp
Expand Up @@ -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());
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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;

Expand Down
13 changes: 0 additions & 13 deletions lldb/source/Symbol/CompilerType.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Symbol/Type.cpp
Expand Up @@ -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;
}

Expand Down Expand Up @@ -657,7 +657,7 @@ CompilerType Type::GetForwardCompilerType() {
}

ConstString Type::GetQualifiedName() {
return GetForwardCompilerType().GetConstTypeName();
return GetForwardCompilerType().GetTypeName();
}

bool Type::GetTypeScopeAndBasename(const llvm::StringRef& name,
Expand Down

0 comments on commit 30ce956

Please sign in to comment.