Commit Graph

10 Commits

Author SHA1 Message Date
Paolo Tranquilli
daf1fa3c31 Swift: lock built swiftmodule traps in main
This should cover `-merge-modules` mode.

Dumping of the configuration to the target files was moved to a
separate pair of header/source files, as now it is also done in
`SwiftOutputRewrite.cpp`.
2022-07-29 16:27:55 +02:00
Paolo Tranquilli
065fecc57e Swift: extract precompiled swiftmodule files
Previously we were not extracting any `swiftmodule` file that was not
a system or a built-in one. This was done to avoid re-extracting
`swiftmodule` files that were built previously in the same build, but it
turned out to be too eager, as there are legitimate cases where a
non-system, non-built-in precompiled swift module can be used. An
example of that is the `PackageDescription` module used in Swift
Package Manager manifest files (`Package.swift`).

We now relax the test and trigger module extraction on all loaded
modules that do not have source files (we trigger source file extraction
for those). The catch, is that we also create empty trap files for
current output `swiftmodule` files (including possible alias locations
set up by XCode).

This means that if a following extractor run loads a previously built
`swiftmodule` file, although it will trigger module extraction, this
will however be skipped as it will find its target file already present
(this is done via the `TargetFile` semantics).
2022-07-29 11:10:03 +02:00
Alex Denisov
133a6caaa3 Swift: cleanup output rewriting code 2022-06-30 12:03:53 +02:00
AlexDenisov
d42b752c6d Apply suggestions from code review
Co-authored-by: Paolo Tranquilli <redsun82@github.com>
2022-06-30 11:10:43 +02:00
AlexDenisov
b5c1ec8958 Update swift/extractor/SwiftOutputRewrite.cpp
Co-authored-by: Paolo Tranquilli <redsun82@github.com>
2022-06-30 11:08:23 +02:00
AlexDenisov
6b0e734c47 Update swift/extractor/SwiftOutputRewrite.cpp
Co-authored-by: Paolo Tranquilli <redsun82@github.com>
2022-06-30 11:06:03 +02:00
Alex Denisov
1dd3141e2d Swift: address more code review comments 2022-06-30 08:57:22 +02:00
Alex Denisov
35da75f685 Swift: rename method 2022-06-30 08:48:36 +02:00
AlexDenisov
522d48aa33 Apply suggestions from code review
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2022-06-30 08:47:17 +02:00
Alex Denisov
4d81206a87 Swift: teach extractor to emit build artifacts for later consumption 2022-06-29 10:58:24 +02:00