Commit Graph

100 Commits

Author SHA1 Message Date
Robert Widmann
9fd5918786 Swap InputFileKind for ParseInputMode
Tying InputFile to this option meant that every input that was not one of the explictly-blessed kinds was modeled as a Swift file.

With the new InputFile that infers file kinds, we no longer need CompilerInvocation::setInputKind
2020-09-11 22:28:58 -06:00
Brent Royal-Gordon
cff4ddf13a [NFC] Adopt new ImportPath types and terminology
# Conflicts:
#	lib/IDE/CodeCompletion.cpp
2020-09-10 19:07:49 -07:00
Xi Ge
028a75572c ModuleInterface: remark potential version differences between SDK and prebuilt modules
Prebuilt-module directory now contains a SystemVersion.plist file copied from the SDK
it's built from. This patch teaches the compiler to remark this version and the SDK version
when -Rmodule-interface-rebuild is specified. The difference between these versions could
help us debug unusable prebuilt modules.
2020-09-04 11:45:05 -07:00
Xi Ge
e107182f1a Merge remote-tracking branch 'apple/master' into master-rebranch 2020-09-02 18:36:37 -07:00
Xi Ge
a4d731ed9f ModuleLoader: remove several walk-arounds for not having a persistent ClangImporterOptions available. NFC 2020-09-02 15:10:50 -07:00
swift_jenkins
258b72273c Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-24 21:36:02 -07:00
Brent Royal-Gordon
8fbd449501 Merge pull request #33114 from brentdax/check-your-interfaces-at-the-door
Verify that just-emitted module interfaces parse and typecheck
2020-08-24 20:33:58 -07:00
swift_jenkins
ce17c9b493 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-18 20:44:01 -07:00
Xi Ge
5c9b737c89 DependenciesScanner: prefer private Swift module interfaces if present
rdar://67257185
2020-08-18 13:09:07 -07:00
Nathan Hawes
f0c8b8e571 Manually merge remote-tracking branch 'upstream/master' into HEAD
Conflicts:
	include/swift/AST/PrettyStackTrace.h
2020-08-14 11:06:27 -07:00
Artem Chikin
cf773c3d0e [Explicit Module Loader] Refactor ESWL to use findModule instead of findModuleFilesInDirectory
And add isFramework to the Explicit Module Map and its parser.
2020-08-12 12:06:46 -07:00
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