Commit Graph

289 Commits

Author SHA1 Message Date
Artem Chikin
40c1687fd2 [Fast Dependency Scanner] Produce information on whether an explicit module is a framework
In the fast dependency scanner, depending on whether a module intrface was found via the import search path or framework search path, encode into the dependency graph Swift module details, whether a given module is a framework.
2020-08-12 10:12:35 -07:00
Brent Royal-Gordon
9bc787ef5f Add a “typecheck module interface” mode 2020-08-07 16:00:15 -07:00
Nathan Hawes
e40e275c89 Manually merge remote-tracking branch 'upstream/master' into HEAD 2020-08-04 20:08:07 -07:00
Xi Ge
02075d7d6e ExplicitModule: remove all search paths for command lines to explicitly build Swift textual interface 2020-08-04 13:51:53 -07:00
Nathan Hawes
607e2b8822 Manually merge remote-tracking branch 'upstream/master' into HEAD 2020-08-04 13:47:48 -07:00
Xi Ge
f0cf2206a2 DependenciesScanner: add implicitly imported modules to dependencies of Swift module interfaces
Some implicitly imported modules aren't printed in the textual interface file as explicit import,
e.g. SwiftOnoneSupport. We should check implicit imports and add them to the dependency graph.
2020-08-03 14:43:09 -07:00
swift-ci
18516c1549 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-30 20:46:19 -07:00
Xi Ge
bfacad6f43 Front-end: pass down main executable path to the sub-ASTContext for building module interfaces. NFC 2020-07-30 12:17:02 -07:00
swift-ci
113db8c6d8 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-28 14:43:59 -07:00
Artem Chikin
413bbab306 Merge pull request #33032 from artemcm/ExplicitPackageBuilds
[Dependency Scanner] Add a scanner for explicit placeholder module dependencies
2020-07-28 14:36:26 -07:00
Artem Chikin
965ca698d5 Add in-source rationale for why Placeholder dependencies are needed. 2020-07-28 11:34:27 -07:00
Nathan Hawes
498e767765 Manually merge remote-tracking branch 'upstream/master' into merge-m-to-mr 2020-07-27 22:41:53 -07:00
Artem Chikin
1d49d22574 Keep the memory allocator local to module loaders, instead of module map parser. 2020-07-27 09:24:35 -07:00
Artem Chikin
1c1a263315 Factor out Explicit Module Map parsing into a standalone utility. 2020-07-27 09:24:35 -07:00
Varun Gandhi
1ddf4ff790 [Gardening] Use consistent style for referencing notes. 2020-07-25 23:36:17 -07:00
Nathan Hawes
1dd1b5a38a Update new code in ModuleInterfaceLoader.cpp for StringRef -> std::string conversion change. 2020-07-20 18:50:08 -07:00
Nathan Hawes
9d4ed5f39c Manually merge remote-tracking branch 'upstream/master' into manually-merge-master-to-master-rebranch 2020-07-20 16:09:55 -07:00
Xi Ge
9a33ac63a5 ExplicitModuleLoader: teach the module loader to accept forwarding modules
Since -emit-module-from-interface now emits forwarding modules, explicit module
loader should be able to accept forwarding modules and unbox their actual binary
contents.
2020-07-19 16:12:08 -07:00
Xi Ge
f9396f2812 ModuleInterface: teach -compile-module-from-interface to emit forwarding module
-compile-module-from-interface action now takes arguments of -candidate-module-file.
If one of the candidate module files is up-to-date, the action emits a forwarding
module pointing to the candidate module instead of building a binary module.
2020-07-18 19:13:47 -07:00
Xi Ge
b93ff79cb0 DependenciesScanner: include compiled module candidates for textual module interface in JSON output
Instead of replacing an interface file with its up-to-date compile module,
the dep-scanner should report potentially up-to-date module candidates either adjacent to
the interface file or in the prebuilt module cache. swift-driver should later pass down
these candidates to -compile-module-from-interface invocation and the front-end job
will check if one of the candidates is ready to use. The front-end job then either emits a forwarding
module to an up-to-date candidate or a binary module.
2020-07-17 12:32:38 -07:00
Xi Ge
a5ad5eb54c ModuleInterface: refactor a utility function out for collecting candidate compiled modules. NFC
The compiled module is either adjacent to the interface file or in prebuilt module cache directory.
2020-07-16 15:47:07 -07:00
Artem Chikin
7dd220f5ef Merge pull request #32754 from artemcm/CanImportExplicitly
[Explicit Module Builds] Add canImport functionality to the ExplicitSwiftModuleLoader
2020-07-09 16:06:40 -07:00
Artem Chikin
f361b250de [Explicit Module Builds] Add canImport functionality to the ExplicitSwiftModuleLoader
It needs to check against the provided ExplicitModuleMap instead of looking into search paths.
2020-07-08 10:11:49 -07:00
swift_jenkins
d883300bc1 Merge remote-tracking branch 'origin/master' into master-next 2020-07-01 17:59:25 -07:00
Xi Ge
84dd4db0b1 Dependencies Scanner: report compiled Swift module paths if they are available
For the explicit module mode, swift-driver uses -compile-module-from-interface to
generate modules from interfaces found by the dependency scanner. However, we don't
need to build the binary module if up-to-date modules are available, either adjacent
to the interface file or in the prebuilt module cache directory. This patch teaches
dependencies scanner to report these ready-to-use binary modules.
2020-07-01 11:54:15 -07:00
Xi Ge
d2bf4473ae Revert "ModuleLoader: refactor computePrebuiltModulePath to facilitate dependencies scanner's invocation, NFC" 2020-07-01 09:53:58 -07:00
swift_jenkins
465eae8559 Merge remote-tracking branch 'origin/master' into master-next 2020-06-30 08:58:09 -07:00
Hamish Knight
7bc5440d17 [Frontend] Internalize createDependencyTracker
Expand the FrontendOptions to allow the enabling
of the dependency tracker for non-system
dependencies, and switch the previous clients of
`createDependencyTracker` over to using this
option. This ensures that the dependency tracker
is now set only during `CompilerInstance::setup`.
2020-06-29 15:26:26 -07:00
swift_jenkins
ea868c665f Merge remote-tracking branch 'origin/master' into master-next 2020-06-26 18:19:05 -07:00
Xi Ge
0816167abd Merge pull request #32564 from nkcsgexi/scanner-report-prebuilt-module
ModuleLoader: refactor computePrebuiltModulePath to facilitate dependencies scanner's invocation, NFC
2020-06-26 18:04:10 -07:00
Xi Ge
a5369475ab ModuleLoader: refactor computePrebuiltModulePath to facilitate dependencies scanner's invocation, NFC 2020-06-26 15:01:19 -07:00
Xi Ge
fb99e840cc ExplicitModuleLoader: use a temporary source manager for loading the explicit module map, NFC
We don't need the buffer for the explicit module map to be persistent in the ASTContext.
2020-06-26 14:44:20 -07:00
swift_jenkins
bbf76203eb Merge remote-tracking branch 'origin/master' into master-next 2020-06-23 09:54:53 -07:00
Xi Ge
05de54f635 ExplicitModules: use key names conforming to Swift naming convention in explicit Swift module maps. NFC 2020-06-22 22:22:05 -07:00
swift_jenkins
436280fdc1 Merge remote-tracking branch 'origin/master' into master-next 2020-06-19 12:58:12 -07:00
Xi Ge
0fd75b4eb9 ExplictModuleLoader: don't fail while no explicit Swift module map is specified
We will eventually move the protocol entirely to using a JSON file for
explicit Swift modules. Before we finish migrating, we should be forgiving
about using the legacy -swift-module-file argument.
2020-06-19 10:23:43 -07:00
swift_jenkins
6ba08d58c3 Merge remote-tracking branch 'origin/master' into master-next 2020-06-18 16:00:01 -07:00
Xi Ge
23ef061b14 ExplictModuleLoader: update acceptable JSON format to be more Codable friendly
Explicit Swift module map will be constructed from the swift-driver side using
the Codable protocol. We should change the format to facilitate that.
2020-06-18 10:44:36 -07:00
David Zarzycki
c0c976355c Adapt a swift/master change to master-next (StringRef vs std::string) 2020-06-18 06:14:00 -04:00
swift_jenkins
82453cf560 Merge remote-tracking branch 'origin/master' into master-next 2020-06-17 18:19:18 -07:00
Xi Ge
ec9cd91c1b ExplicitModuleLoader: take a JSON file that specifies details of explicit Swift modules
Instead of taking paths of Swift module files from front-end command line
arguments, we should take a JSON file specifying details of explicit modules.
The advantages is (1) .swiftdoc and .swiftsourceinfo can be associated
with a .swiftmodule file, and (2) module names are explicitly used as
keys in the JSON input so we don't need to eagerly deserialize a .swiftmodule
file to collect the module name.
2020-06-17 14:02:50 -07:00
swift_jenkins
caf00aebd6 Merge remote-tracking branch 'origin/master' into master-next 2020-06-17 11:29:28 -07:00
Alexis Laferrière
1c8ad2f615 Merge pull request #32423 from xymus/module-loading-order
[ModuleInterface] Prefer the swiftmodule in the SDK over the prebuilt-cache
2020-06-17 11:27:29 -07:00
Alexis Laferrière
b4f2e63df8 [ModuleInterface] Prefer the swiftmodule in the SDK over the prebuilt-cache
Fix the search order for module interfaces to respect the documented
behavior:

1. Local cache
2. Next to the .swiftinterface
3. Prebuilt cache

Fixing the order of the last two allows the XcodeDefault compiler to
prioritize swiftmodule files with SPI information.

rdar://problem/64097455
2020-06-17 08:36:08 -07:00
swift_jenkins
20ba5d3171 Merge remote-tracking branch 'origin/master' into master-next 2020-06-16 21:38:08 -07:00
Robert Widmann
260b6a1e2f Merge pull request #32409 from CodaFi/fixing-a-whole-where-the-rain-gets-in
Build Module Interfaces in WMO
2020-06-16 21:18:49 -07:00
swift_jenkins
90dd9dbae8 Merge remote-tracking branch 'origin/master' into master-next 2020-06-16 14:18:53 -07:00
Robert Widmann
0ca2399cab Build Module Interfaces in WMO
Building in incremental mode incurs the overhead associated with the
incremental dependency tracking infrastructure. Considering we're
throwing away all of this stuff anyways, let's just build in WMO to
avoid that.
2020-06-16 11:48:56 -07:00
Xi Ge
b6a8af599e DependenciesScanner: move -fapinotes-swift-version to extra PCM arguments
Swift interface files may specify the effective language version to use. When building
a PCM loadable for these textual interface files, we should respect the language
version. This patch moves -fapinotes-swift-version from the generic PCM
commands to the extra PCM arguments owned by each loading Swift module.
2020-06-16 11:38:28 -07:00
Xi Ge
00872ba53e DependencyScanner: add a new extraPcmArgs field for each Swift module
Building each Swift module explicitly requires dependency PCMs to be built
with the exactly same deployment target version. This means we may need to
build a Clang module multiple times with different target triples.

This patch removes the -target arguments from the reported PCM build
arguments and inserts extraPcmArgs fields to each Swift module.
swift-driver can combine the generic PCM arguments with these extra arguments
to get the command suitable for building a PCM specifically for
that loading Swift module.
2020-06-16 09:42:59 -07:00