@@ -69,30 +69,7 @@ enum class ModuleDependencyKind : int8_t {
6969 Clang,
7070 // Used to model the translation unit's source module
7171 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
9673};
9774
9875// / This is used to idenfity a specific macro plugin dependency.
@@ -537,39 +514,6 @@ class ClangModuleDependencyStorage : public ModuleDependencyInfoStorageBase {
537514 }
538515};
539516
540- // / Describes an placeholder Swift module dependency module stub.
541- // /
542- // / This class is mostly an implementation detail for \c ModuleDependencyInfo.
543-
544- class SwiftPlaceholderModuleDependencyStorage
545- : public ModuleDependencyInfoStorageBase {
546- public:
547- SwiftPlaceholderModuleDependencyStorage (StringRef compiledModulePath,
548- StringRef moduleDocPath,
549- StringRef sourceInfoPath)
550- : ModuleDependencyInfoStorageBase(ModuleDependencyKind::SwiftPlaceholder, {}, {},
551- {}),
552- compiledModulePath (compiledModulePath), moduleDocPath(moduleDocPath),
553- sourceInfoPath (sourceInfoPath) {}
554-
555- ModuleDependencyInfoStorageBase *clone () const override {
556- return new SwiftPlaceholderModuleDependencyStorage (*this );
557- }
558-
559- // / The path to the .swiftmodule file.
560- const std::string compiledModulePath;
561-
562- // / The path to the .swiftModuleDoc file.
563- const std::string moduleDocPath;
564-
565- // / The path to the .swiftSourceInfo file.
566- const std::string sourceInfoPath;
567-
568- static bool classof (const ModuleDependencyInfoStorageBase *base) {
569- return base->dependencyKind == ModuleDependencyKind::SwiftPlaceholder;
570- }
571- };
572-
573517// MARK: Module Dependency Info
574518// / Describes the dependencies of a given module.
575519// /
@@ -670,16 +614,6 @@ class ModuleDependencyInfo {
670614 CASFileSystemRootID, clangIncludeTreeRoot, moduleCacheKey, IsSystem));
671615 }
672616
673- // / Describe a placeholder dependency swift module.
674- static ModuleDependencyInfo
675- forPlaceholderSwiftModuleStub (StringRef compiledModulePath,
676- StringRef moduleDocPath,
677- StringRef sourceInfoPath) {
678- return ModuleDependencyInfo (
679- std::make_unique<SwiftPlaceholderModuleDependencyStorage>(
680- compiledModulePath, moduleDocPath, sourceInfoPath));
681- }
682-
683617 // / Retrieve the module-level imports.
684618 ArrayRef<ScannerImportStatementInfo> getModuleImports () const {
685619 return storage->moduleImports ;
@@ -898,7 +832,7 @@ class ModuleDependencyInfo {
898832 bool isTestableImport (StringRef moduleName) const ;
899833
900834 // / Whether the dependencies are for a Swift module: either Textual, Source,
901- // / Binary, or Placeholder.
835+ // / or Binary
902836 bool isSwiftModule () const ;
903837
904838 // / Whether the dependencies are for a textual interface Swift module or a
@@ -914,9 +848,6 @@ class ModuleDependencyInfo {
914848 // / Whether the dependencies are for a binary Swift module.
915849 bool isSwiftBinaryModule () const ;
916850
917- // / Whether this represents a placeholder module stub
918- bool isSwiftPlaceholderModule () const ;
919-
920851 // / Whether the dependencies are for a Clang module.
921852 bool isClangModule () const ;
922853
@@ -935,10 +866,6 @@ class ModuleDependencyInfo {
935866 // / Retrieve the dependencies for a Clang module.
936867 const ClangModuleDependencyStorage *getAsClangModule () const ;
937868
938- // / Retrieve the dependencies for a placeholder dependency module stub.
939- const SwiftPlaceholderModuleDependencyStorage *
940- getAsPlaceholderDependencyModule () const ;
941-
942869 // / Add a dependency on the given module, if it was not already in the set.
943870 void
944871 addOptionalModuleImport (StringRef module , bool isExported,
0 commit comments