Commit Graph

5 Commits

Author SHA1 Message Date
Steven Wu
9d59044bb1 [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.
2025-02-05 09:41:04 -08:00
Steven Wu
e654e371de [BridgingHeader] Implicit import bridging header from CAS module
The binary module built from a CAS build will have the embeded bridging
header info with 0 modTime. Allow a regular build to import such a
module with the same behavior as if the module is built from a regular
build.

rdar://126221616
2024-04-15 14:47:56 -07:00
Steven Wu
7a68d364f4 [Caching] Embed bridging header in binary module correctly when caching
When caching is enabled with include-tree, the bridging header PCH is
created from the include tree directly. Setup the rewriter correctly
when embedding the bridging header into swift binary module.

rdar://125719747
2024-04-15 14:46:38 -07:00
Ben Langmuir
d178172b5c [Caching] Adopt -finclude-tree-preserve-pch-path to fix -gmodules with
This fixes -gmodules when caching by adopting the new clang -cc1 option
-finclude-tree-preserve-pch-path. -gmodules is required to make
debugging work when examining types that come from clang modules or
bridging headers, but was previously being disabled by clang's caching
support.

rdar://126370706
2024-04-12 13:20:30 -07:00
Steven Wu
423c482427 [Caching] Resolve BridgingHeader Module Deps correctly
Fix the bridging header dependencies calculation for explicit module
build, especially for caching which needs an accurate list of deps for
compute cache key correctly.

Previously, the bridging header deps are computed from `ModuleGraph`
from the clang dependency scanner, which can be affected by already seen
modules. It causes the dependencies to be missing for bridging header if
the module is seen by main swift source module.

Now report only the directly module dependencies from bridging header,
then compute all the transitive dependencies before calculating all the
cache keys.

rdar://123156636
2024-02-19 16:09:56 -08:00