Skip to content

Commit 49275a9

Browse files
committed
Make ObjectFile aware that the DWARF segment may contain Swift metadata
1 parent a395db6 commit 49275a9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/swift/ABI/ObjectFile.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class SwiftObjectFileFormat {
3333
virtual llvm::Optional<llvm::StringRef> getSegmentName() {
3434
return {};
3535
}
36+
/// Get the name of the segment in the symbol rich binary that may contain
37+
/// Swift meteadata.
38+
virtual llvm::Optional<llvm::StringRef> getSymbolRichSegmentName() {
39+
return {};
40+
}
3641
/// Predicate to identify if the named section can contain reflection data.
3742
virtual bool sectionContainsReflectionData(llvm::StringRef sectionName) = 0;
3843
};
@@ -61,10 +66,15 @@ class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
6166
}
6267
llvm_unreachable("Section type not found.");
6368
}
69+
6470
llvm::Optional<llvm::StringRef> getSegmentName() override {
6571
return {"__TEXT"};
6672
}
6773

74+
llvm::Optional<llvm::StringRef> getSymbolRichSegmentName() override {
75+
return {"__DWARF"};
76+
}
77+
6878
bool sectionContainsReflectionData(llvm::StringRef sectionName) override {
6979
return sectionName.startswith("__swift5_") || sectionName == "__const";
7080
}

0 commit comments

Comments
 (0)