@@ -69,30 +69,7 @@ enum class ModuleDependencyKind : int8_t {
69
69
Clang,
70
70
// Used to model the translation unit's source module
71
71
SwiftSource,
72
- // Placeholder dependencies are a kind of dependencies used only by the
73
- // dependency scanner. They are swift modules that the scanner will not be
74
- // able to locate in its search paths and which are the responsibility of the
75
- // scanner's client to ensure are provided.
76
- //
77
- // Placeholder dependencies will be specified in the scanner's output
78
- // dependency graph where it is the responsibility of the scanner's client to
79
- // ensure required post-processing takes place to "resolve" them. In order to
80
- // do so, the client (swift driver, or any other client build system) is
81
- // expected to have access to a full dependency graph of all placeholder
82
- // dependencies and be able to replace placeholder nodes in the dependency
83
- // graph with their full dependency trees, `uniquing` common dependency module
84
- // nodes in the process.
85
- //
86
- // One example where placeholder dependencies are employed is when using
87
- // SwiftPM in Explicit Module Build mode. SwiftPM constructs a build plan for
88
- // all targets ahead-of-time. When planning a build for a target that depends
89
- // on other targets, the dependency scanning action is not able to locate
90
- // dependency target modules, because they have not yet been built. Instead,
91
- // the build system treats them as placeholder dependencies and resolves them
92
- // with `actual` dependencies in a post-processing step once dependency graphs
93
- // of all targets, individually, have been computed.
94
- SwiftPlaceholder,
95
- LastKind = SwiftPlaceholder + 1
72
+ LastKind = SwiftSource + 1
96
73
};
97
74
98
75
// / This is used to idenfity a specific macro plugin dependency.
@@ -542,39 +519,6 @@ class ClangModuleDependencyStorage : public ModuleDependencyInfoStorageBase {
542
519
}
543
520
};
544
521
545
- // / Describes an placeholder Swift module dependency module stub.
546
- // /
547
- // / This class is mostly an implementation detail for \c ModuleDependencyInfo.
548
-
549
- class SwiftPlaceholderModuleDependencyStorage
550
- : public ModuleDependencyInfoStorageBase {
551
- public:
552
- SwiftPlaceholderModuleDependencyStorage (StringRef compiledModulePath,
553
- StringRef moduleDocPath,
554
- StringRef sourceInfoPath)
555
- : ModuleDependencyInfoStorageBase(ModuleDependencyKind::SwiftPlaceholder, {}, {},
556
- {}),
557
- compiledModulePath (compiledModulePath), moduleDocPath(moduleDocPath),
558
- sourceInfoPath (sourceInfoPath) {}
559
-
560
- ModuleDependencyInfoStorageBase *clone () const override {
561
- return new SwiftPlaceholderModuleDependencyStorage (*this );
562
- }
563
-
564
- // / The path to the .swiftmodule file.
565
- const std::string compiledModulePath;
566
-
567
- // / The path to the .swiftModuleDoc file.
568
- const std::string moduleDocPath;
569
-
570
- // / The path to the .swiftSourceInfo file.
571
- const std::string sourceInfoPath;
572
-
573
- static bool classof (const ModuleDependencyInfoStorageBase *base) {
574
- return base->dependencyKind == ModuleDependencyKind::SwiftPlaceholder;
575
- }
576
- };
577
-
578
522
// MARK: Module Dependency Info
579
523
// / Describes the dependencies of a given module.
580
524
// /
@@ -675,16 +619,6 @@ class ModuleDependencyInfo {
675
619
CASFileSystemRootID, clangIncludeTreeRoot, moduleCacheKey, IsSystem));
676
620
}
677
621
678
- // / Describe a placeholder dependency swift module.
679
- static ModuleDependencyInfo
680
- forPlaceholderSwiftModuleStub (StringRef compiledModulePath,
681
- StringRef moduleDocPath,
682
- StringRef sourceInfoPath) {
683
- return ModuleDependencyInfo (
684
- std::make_unique<SwiftPlaceholderModuleDependencyStorage>(
685
- compiledModulePath, moduleDocPath, sourceInfoPath));
686
- }
687
-
688
622
// / Retrieve the module-level imports.
689
623
ArrayRef<ScannerImportStatementInfo> getModuleImports () const {
690
624
return storage->moduleImports ;
@@ -903,7 +837,7 @@ class ModuleDependencyInfo {
903
837
bool isTestableImport (StringRef moduleName) const ;
904
838
905
839
// / Whether the dependencies are for a Swift module: either Textual, Source,
906
- // / Binary, or Placeholder.
840
+ // / or Binary
907
841
bool isSwiftModule () const ;
908
842
909
843
// / Whether the dependencies are for a textual interface Swift module or a
@@ -919,9 +853,6 @@ class ModuleDependencyInfo {
919
853
// / Whether the dependencies are for a binary Swift module.
920
854
bool isSwiftBinaryModule () const ;
921
855
922
- // / Whether this represents a placeholder module stub
923
- bool isSwiftPlaceholderModule () const ;
924
-
925
856
// / Whether the dependencies are for a Clang module.
926
857
bool isClangModule () const ;
927
858
@@ -940,10 +871,6 @@ class ModuleDependencyInfo {
940
871
// / Retrieve the dependencies for a Clang module.
941
872
const ClangModuleDependencyStorage *getAsClangModule () const ;
942
873
943
- // / Retrieve the dependencies for a placeholder dependency module stub.
944
- const SwiftPlaceholderModuleDependencyStorage *
945
- getAsPlaceholderDependencyModule () const ;
946
-
947
874
// / Add a dependency on the given module, if it was not already in the set.
948
875
void
949
876
addOptionalModuleImport (StringRef module , bool isExported,
0 commit comments