From e1a39bf05961217c24a2dbccc6f51a9ee5f45318 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 28 Jan 2022 13:16:47 -0800 Subject: [PATCH] use startswith for macho and add header doc --- include/swift/ABI/ObjectFile.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/swift/ABI/ObjectFile.h b/include/swift/ABI/ObjectFile.h index ed0dc54a104..b2b41d3968d 100644 --- a/include/swift/ABI/ObjectFile.h +++ b/include/swift/ABI/ObjectFile.h @@ -31,6 +31,7 @@ public: virtual llvm::Optional getSegmentName() { return {}; } + /// Predicate to identify if the named section can contain reflection data. virtual bool sectionContainsReflectionData(llvm::StringRef sectionName) { return getSectionName(fieldmd) == sectionName || getSectionName(assocty) == sectionName || @@ -43,8 +44,6 @@ public: /// Responsible for providing the Mach-O reflection section identifiers. class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat { - using super = SwiftObjectFileFormat; - public: llvm::StringRef getSectionName(ReflectionSectionKind section) override { switch (section) { @@ -68,7 +67,7 @@ public: } bool sectionContainsReflectionData(llvm::StringRef sectionName) override { - return super::sectionContainsReflectionData(sectionName) || + return sectionName.startswith("__swift5_") || sectionName == "__DATA_CONST,__const"; } };