@@ -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.
@@ -537,39 +514,6 @@ class ClangModuleDependencyStorage : public ModuleDependencyInfoStorageBase {
537
514
}
538
515
};
539
516
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
-
573
517
// MARK: Module Dependency Info
574
518
// / Describes the dependencies of a given module.
575
519
// /
@@ -670,16 +614,6 @@ class ModuleDependencyInfo {
670
614
CASFileSystemRootID, clangIncludeTreeRoot, moduleCacheKey, IsSystem));
671
615
}
672
616
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
-
683
617
// / Retrieve the module-level imports.
684
618
ArrayRef<ScannerImportStatementInfo> getModuleImports () const {
685
619
return storage->moduleImports ;
@@ -898,7 +832,7 @@ class ModuleDependencyInfo {
898
832
bool isTestableImport (StringRef moduleName) const ;
899
833
900
834
// / Whether the dependencies are for a Swift module: either Textual, Source,
901
- // / Binary, or Placeholder.
835
+ // / or Binary
902
836
bool isSwiftModule () const ;
903
837
904
838
// / Whether the dependencies are for a textual interface Swift module or a
@@ -914,9 +848,6 @@ class ModuleDependencyInfo {
914
848
// / Whether the dependencies are for a binary Swift module.
915
849
bool isSwiftBinaryModule () const ;
916
850
917
- // / Whether this represents a placeholder module stub
918
- bool isSwiftPlaceholderModule () const ;
919
-
920
851
// / Whether the dependencies are for a Clang module.
921
852
bool isClangModule () const ;
922
853
@@ -935,10 +866,6 @@ class ModuleDependencyInfo {
935
866
// / Retrieve the dependencies for a Clang module.
936
867
const ClangModuleDependencyStorage *getAsClangModule () const ;
937
868
938
- // / Retrieve the dependencies for a placeholder dependency module stub.
939
- const SwiftPlaceholderModuleDependencyStorage *
940
- getAsPlaceholderDependencyModule () const ;
941
-
942
869
// / Add a dependency on the given module, if it was not already in the set.
943
870
void
944
871
addOptionalModuleImport (StringRef module , bool isExported,
0 commit comments