Skip to content

Commit 5eaf44f

Browse files
committed
[lldb] Delete ValueObject::GetBaseClassPath
Summary: This method has exactly one call site, which is only actually executed if `ValueObject::IsBaseClass` returns false. However, the first thing that `ValueObject::GetBaseClassPath` does is check if `ValueObject::IsBaseClass` is true. Because this can never be the case, this method always returns false and is therefore effectively dead. Differential Revision: https://reviews.llvm.org/D73517
1 parent 1f85dfb commit 5eaf44f

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

lldb/include/lldb/Core/ValueObject.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,6 @@ class ValueObject : public UserID {
396396

397397
bool IsIntegerType(bool &is_signed);
398398

399-
virtual bool GetBaseClassPath(Stream &s);
400-
401399
virtual void GetExpressionPath(
402400
Stream &s, bool qualify_cxx_base_classes,
403401
GetExpressionPathFormat = eGetExpressionPathFormatDereferencePointers);

lldb/source/Core/ValueObject.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,23 +2013,6 @@ bool ValueObject::HasSyntheticValue() {
20132013
return m_synthetic_value != nullptr;
20142014
}
20152015

2016-
bool ValueObject::GetBaseClassPath(Stream &s) {
2017-
if (IsBaseClass()) {
2018-
bool parent_had_base_class =
2019-
GetParent() && GetParent()->GetBaseClassPath(s);
2020-
CompilerType compiler_type = GetCompilerType();
2021-
llvm::Optional<std::string> cxx_class_name =
2022-
TypeSystemClang::GetCXXClassName(compiler_type);
2023-
if (cxx_class_name) {
2024-
if (parent_had_base_class)
2025-
s.PutCString("::");
2026-
s.PutCString(cxx_class_name.getValue());
2027-
}
2028-
return parent_had_base_class || cxx_class_name;
2029-
}
2030-
return false;
2031-
}
2032-
20332016
ValueObject *ValueObject::GetNonBaseClassParent() {
20342017
if (GetParent()) {
20352018
if (GetParent()->IsBaseClass())
@@ -2139,13 +2122,8 @@ void ValueObject::GetExpressionPath(Stream &s, bool qualify_cxx_base_classes,
21392122
}
21402123

21412124
const char *name = GetName().GetCString();
2142-
if (name) {
2143-
if (qualify_cxx_base_classes) {
2144-
if (GetBaseClassPath(s))
2145-
s.PutCString("::");
2146-
}
2125+
if (name)
21472126
s.PutCString(name);
2148-
}
21492127
}
21502128
}
21512129

0 commit comments

Comments
 (0)