mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanning] Add a field of source-imported dependencies
For the main source module, provide info on which dependencies are directly imported into the user program, explicitly ('import' statement) or implicitly (e.g. stdlib). Thist list does not include Swift overlay dependencies, cross-import dependencies, bridging header dependencies.
This commit is contained in:
@@ -424,6 +424,9 @@ void writeJSON(llvm::raw_ostream &out,
|
||||
bool hasOverlayDependencies =
|
||||
swiftTextualDeps->swift_overlay_module_dependencies &&
|
||||
swiftTextualDeps->swift_overlay_module_dependencies->count > 0;
|
||||
bool hasSourceImportedDependencies =
|
||||
swiftTextualDeps->source_import_module_dependencies &&
|
||||
swiftTextualDeps->source_import_module_dependencies->count > 0;
|
||||
bool commaAfterBridgingHeaderPath = hasOverlayDependencies;
|
||||
bool commaAfterFramework =
|
||||
hasBridgingHeader || commaAfterBridgingHeaderPath;
|
||||
@@ -448,6 +451,11 @@ void writeJSON(llvm::raw_ostream &out,
|
||||
/*trailingComma=*/true);
|
||||
writeMacroDependencies(out, swiftTextualDeps->macro_dependencies, 5,
|
||||
/*trailingComma=*/true);
|
||||
if (hasSourceImportedDependencies) {
|
||||
writeDependencies(out, swiftTextualDeps->source_import_module_dependencies,
|
||||
"sourceImportedDependencies", 5,
|
||||
/*trailingComma=*/true);
|
||||
}
|
||||
writeJSONSingleField(out, "isFramework", swiftTextualDeps->is_framework,
|
||||
5, commaAfterFramework);
|
||||
/// Bridging header and its source file dependencies, if any.
|
||||
|
||||
Reference in New Issue
Block a user