[BrdigingHeader] Auto bridging header chaining

Add ability to automatically chaining the bridging headers discovered from all
dependencies module when doing swift caching build. This will eliminate all
implicit bridging header imports from the build and make the bridging header
importing behavior much more reliable, while keep the compatibility at maximum.

For example, if the current module A depends on module B and C, and both B and
C are binary modules that uses bridging header, when building module A,
dependency scanner will construct a new header that chains three bridging
headers together with the option to build a PCH from it. This will make all
importing errors more obvious while improving the performance.
This commit is contained in:
Steven Wu
2025-01-06 15:52:32 -08:00
parent 8534f29ef5
commit 9d59044bb1
44 changed files with 1094 additions and 275 deletions

View File

@@ -334,6 +334,18 @@ swiftscan_string_ref_t swiftscan_swift_textual_detail_get_user_module_version(
return details->swift_textual_details.user_module_version;
}
swiftscan_string_ref_t
swiftscan_swift_textual_detail_get_chained_bridging_header_path(
swiftscan_module_details_t details) {
return details->swift_textual_details.chained_bridging_header_path;
}
swiftscan_string_ref_t
swiftscan_swift_textual_detail_get_chained_bridging_header_content(
swiftscan_module_details_t details) {
return details->swift_textual_details.chained_bridging_header_content;
}
//=== Swift Binary Module Details query APIs ------------------------------===//
swiftscan_string_ref_t swiftscan_swift_binary_detail_get_compiled_module_path(
@@ -570,7 +582,7 @@ swiftscan_scanner_diagnostics_query(swiftscan_scanner_t scanner) {
swiftscan_diagnostic_set_t *Result = new swiftscan_diagnostic_set_t;
Result->count = NumDiagnostics;
Result->diagnostics = new swiftscan_diagnostic_info_t[NumDiagnostics];
for (size_t i = 0; i < NumDiagnostics; ++i) {
const auto &Diagnostic = Diagnostics[i];
swiftscan_diagnostic_info_s *DiagnosticInfo = new swiftscan_diagnostic_info_s;