File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,20 @@ class SwiftObjectFileFormat {
3131 virtual llvm::Optional<llvm::StringRef> getSegmentName () {
3232 return {};
3333 }
34+ virtual bool sectionContainsReflectionData (llvm::StringRef sectionName) {
35+ return getSectionName (fieldmd) == sectionName ||
36+ getSectionName (assocty) == sectionName ||
37+ getSectionName (builtin) == sectionName ||
38+ getSectionName (capture) == sectionName ||
39+ getSectionName (typeref) == sectionName ||
40+ getSectionName (reflstr) == sectionName;
41+ }
3442};
3543
3644// / Responsible for providing the Mach-O reflection section identifiers.
3745class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
46+ using super = SwiftObjectFileFormat;
47+
3848public:
3949 llvm::StringRef getSectionName (ReflectionSectionKind section) override {
4050 switch (section) {
@@ -56,6 +66,11 @@ class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
5666 llvm::Optional<llvm::StringRef> getSegmentName () override {
5767 return {" __TEXT" };
5868 }
69+
70+ bool sectionContainsReflectionData (llvm::StringRef sectionName) override {
71+ return super::sectionContainsReflectionData (sectionName) ||
72+ sectionName == " __DATA_CONST,__const" ;
73+ }
5974};
6075
6176// / Responsible for providing the ELF reflection section identifiers.
You can’t perform that action at this time.
0 commit comments