Skip to content

Commit e1a39bf

Browse files
committed
use startswith for macho and add header doc
1 parent e2be9a3 commit e1a39bf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/swift/ABI/ObjectFile.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class SwiftObjectFileFormat {
3131
virtual llvm::Optional<llvm::StringRef> getSegmentName() {
3232
return {};
3333
}
34+
/// Predicate to identify if the named section can contain reflection data.
3435
virtual bool sectionContainsReflectionData(llvm::StringRef sectionName) {
3536
return getSectionName(fieldmd) == sectionName ||
3637
getSectionName(assocty) == sectionName ||
@@ -43,8 +44,6 @@ class SwiftObjectFileFormat {
4344

4445
/// Responsible for providing the Mach-O reflection section identifiers.
4546
class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
46-
using super = SwiftObjectFileFormat;
47-
4847
public:
4948
llvm::StringRef getSectionName(ReflectionSectionKind section) override {
5049
switch (section) {
@@ -68,7 +67,7 @@ class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
6867
}
6968

7069
bool sectionContainsReflectionData(llvm::StringRef sectionName) override {
71-
return super::sectionContainsReflectionData(sectionName) ||
70+
return sectionName.startswith("__swift5_") ||
7271
sectionName == "__DATA_CONST,__const";
7372
}
7473
};

0 commit comments

Comments
 (0)