@@ -33,12 +33,12 @@ class SwiftObjectFileFormat {
33
33
}
34
34
// / Predicate to identify if the named section can contain reflection data.
35
35
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) ;
42
42
}
43
43
};
44
44
@@ -67,6 +67,9 @@ class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
67
67
}
68
68
69
69
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`).
70
73
return sectionName.startswith (" __swift5_" ) ||
71
74
sectionName == " __DATA_CONST,__const" ||
72
75
sectionName == " __DATA,__const" ;
0 commit comments