Fast dependency scanning for Swift

Implement a new "fast" dependency scanning option,
`-scan-dependencies`, in the Swift frontend that determines all
of the source file and module dependencies for a given set of
Swift sources. It covers four forms of modules:

1) Swift (serialized) module files, by reading the module header
2) Swift interface files, by parsing the source code to find imports
3) Swift source modules, by parsing the source code to find imports
4) Clang modules, using Clang's fast dependency scanning tool

A single `-scan-dependencies` operation maps out the full
dependency graph for the given Swift source files, including all
of the Swift and Clang modules that may need to be built, such
that all of the work can be scheduled up front by the Swift
driver or any other build system that understands this
option. The dependency graph is emitted as JSON, which can be
consumed by these other tools.
This commit is contained in:
Doug Gregor
2020-01-04 22:49:54 -08:00
parent 46703b4ba1
commit 33cdd61835
36 changed files with 1454 additions and 10 deletions

View File

@@ -132,6 +132,8 @@ public:
EmitPCM, ///< Emit precompiled Clang module from a module map
DumpPCM, ///< Dump information about a precompiled Clang module
ScanDependencies, ///< Scan dependencies of Swift source files
};
/// Indicates the action the user requested that the frontend perform.