@@ -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.
@@ -542,39 +519,6 @@ class ClangModuleDependencyStorage : public ModuleDependencyInfoStorageBase {
542519 }
543520};
544521
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-
578522// MARK: Module Dependency Info
579523// / Describes the dependencies of a given module.
580524// /
@@ -675,16 +619,6 @@ class ModuleDependencyInfo {
675619 CASFileSystemRootID, clangIncludeTreeRoot, moduleCacheKey, IsSystem));
676620 }
677621
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-
688622 // / Retrieve the module-level imports.
689623 ArrayRef<ScannerImportStatementInfo> getModuleImports () const {
690624 return storage->moduleImports ;
@@ -903,7 +837,7 @@ class ModuleDependencyInfo {
903837 bool isTestableImport (StringRef moduleName) const ;
904838
905839 // / Whether the dependencies are for a Swift module: either Textual, Source,
906- // / Binary, or Placeholder.
840+ // / or Binary
907841 bool isSwiftModule () const ;
908842
909843 // / Whether the dependencies are for a textual interface Swift module or a
@@ -919,9 +853,6 @@ class ModuleDependencyInfo {
919853 // / Whether the dependencies are for a binary Swift module.
920854 bool isSwiftBinaryModule () const ;
921855
922- // / Whether this represents a placeholder module stub
923- bool isSwiftPlaceholderModule () const ;
924-
925856 // / Whether the dependencies are for a Clang module.
926857 bool isClangModule () const ;
927858
@@ -940,10 +871,6 @@ class ModuleDependencyInfo {
940871 // / Retrieve the dependencies for a Clang module.
941872 const ClangModuleDependencyStorage *getAsClangModule () const ;
942873
943- // / Retrieve the dependencies for a placeholder dependency module stub.
944- const SwiftPlaceholderModuleDependencyStorage *
945- getAsPlaceholderDependencyModule () const ;
946-
947874 // / Add a dependency on the given module, if it was not already in the set.
948875 void
949876 addOptionalModuleImport (StringRef module , bool isExported,
0 commit comments