@@ -33,12 +33,12 @@ class SwiftObjectFileFormat {
3333 }
3434 // / Predicate to identify if the named section can contain reflection data.
3535 virtual bool sectionContainsReflectionData (llvm::StringRef sectionName) {
36- return getSectionName (fieldmd) == sectionName ||
37- getSectionName (assocty) == sectionName ||
38- getSectionName (builtin) == sectionName ||
39- getSectionName (capture) == sectionName ||
40- getSectionName (typeref) == sectionName ||
41- getSectionName (reflstr) == sectionName ;
36+ return sectionName == getSectionName (fieldmd) ||
37+ sectionName == getSectionName (assocty) ||
38+ sectionName == getSectionName (builtin) ||
39+ sectionName == getSectionName (capture) ||
40+ sectionName == getSectionName (typeref) ||
41+ sectionName == getSectionName (reflstr) ;
4242 }
4343};
4444
@@ -67,6 +67,9 @@ class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
6767 }
6868
6969 bool sectionContainsReflectionData (llvm::StringRef sectionName) override {
70+ // For Mach-O, the caller must call this function twice, once with just the
71+ // section name (ex `__swift5_fieldmd`), and again with the segment
72+ // qualified section name (ex `__DATA,__const`).
7073 return sectionName.startswith (" __swift5_" ) ||
7174 sectionName == " __DATA_CONST,__const" ||
7275 sectionName == " __DATA,__const" ;
0 commit comments