Skip to content

Commit a4f5c8b

Browse files
committed
[lldb] Update CanContainSwiftReflectionData for Mach-O
1 parent e6fbc13 commit a4f5c8b

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7022,17 +7022,8 @@ llvm::StringRef ObjectFileMachO::GetReflectionSectionIdentifier(
70227022
#ifdef LLDB_ENABLE_SWIFT
70237023
bool ObjectFileMachO::CanContainSwiftReflectionData(const Section &section) {
70247024
swift::SwiftObjectFileFormatMachO file_format;
7025-
if (file_format.sectionContainsReflectionData(
7026-
section.GetName().GetStringRef()))
7027-
return true;
7028-
// Some section names are not unique, such as `__const`, which could be in
7029-
// `__TEXT` or `__DATA`. For these, also check the segment,section name.
7030-
if (auto segment = section.GetParent()) {
7031-
std::string segmentSectionName =
7032-
llvm::formatv("{0},{1}", segment->GetName(), section.GetName()).str();
7033-
return file_format.sectionContainsReflectionData(segmentSectionName);
7034-
}
7035-
return false;
7025+
return file_format.sectionContainsReflectionData(
7026+
section.GetName().GetStringRef());
70367027
}
70377028
#endif // LLDB_ENABLE_SWIFT
70387029

0 commit comments

Comments
 (0)