Skip to content

Commit 08bc94b

Browse files
committed
[lldb] Use summary string for ObjectiveC.Selector (NFC)
1 parent 636f4b7 commit 08bc94b

File tree

3 files changed

+2
-34
lines changed

3 files changed

+2
-34
lines changed

lldb/source/Plugins/Language/Swift/SwiftFormatters.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -779,33 +779,6 @@ lldb_private::formatters::swift::EnumSyntheticFrontEndCreator(
779779
return (new EnumSyntheticFrontEnd(valobj_sp));
780780
}
781781

782-
bool lldb_private::formatters::swift::ObjC_Selector_SummaryProvider(
783-
ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
784-
LLDB_SCOPED_TIMER();
785-
static ConstString g_ptr("ptr");
786-
static ConstString g__rawValue("_rawValue");
787-
788-
ValueObjectSP ptr_sp(valobj.GetChildAtNamePath({g_ptr, g__rawValue}));
789-
if (!ptr_sp)
790-
return false;
791-
792-
auto ptr_value = ptr_sp->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
793-
794-
if (0 == ptr_value || LLDB_INVALID_ADDRESS == ptr_value)
795-
return false;
796-
797-
StringPrinter::ReadStringAndDumpToStreamOptions read_options;
798-
read_options.SetLocation(ptr_value);
799-
read_options.SetTargetSP(valobj.GetTargetSP());
800-
read_options.SetStream(&stream);
801-
read_options.SetQuote('"');
802-
read_options.SetNeedsZeroTermination(true);
803-
read_options.SetEscapeStyle(StringPrinter::EscapeStyle::Swift);
804-
805-
return StringPrinter::ReadStringAndDumpToStream<
806-
StringPrinter::StringElementType::ASCII>(read_options);
807-
}
808-
809782
template <int Key> struct TypePreservingNSNumber;
810783

811784
template <> struct TypePreservingNSNumber<0> {

lldb/source/Plugins/Language/Swift/SwiftFormatters.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ bool GLKit_SummaryProvider(ValueObject &valobj, Stream &stream,
108108
bool BuiltinObjC_SummaryProvider(ValueObject &valobj, Stream &stream,
109109
const TypeSummaryOptions &options);
110110

111-
bool ObjC_Selector_SummaryProvider(ValueObject &valobj, Stream &stream,
112-
const TypeSummaryOptions &options);
113-
114111
bool TypePreservingNSNumber_SummaryProvider(ValueObject &valobj, Stream &stream,
115112
const TypeSummaryOptions &options);
116113

lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,8 @@ static void LoadSwiftFormatters(lldb::TypeCategoryImplSP swift_category_sp) {
160160
basic_synth_flags.SetCascades(true).SetSkipPointers(true).SetSkipReferences(
161161
true);
162162

163-
AddCXXSummary(swift_category_sp,
164-
lldb_private::formatters::swift::ObjC_Selector_SummaryProvider,
165-
"ObjectiveC.Selector", ConstString("ObjectiveC.Selector"),
166-
summary_flags);
163+
AddStringSummary(swift_category_sp, "${var.ptr._rawValue%s}",
164+
ConstString("ObjectiveC.Selector"), summary_flags);
167165

168166
AddCXXSynthetic(
169167
swift_category_sp,

0 commit comments

Comments
 (0)