3030#include " llvm/ADT/DenseSet.h"
3131#include " llvm/ADT/IntrusiveRefCntPtr.h"
3232#include " llvm/ADT/StringSet.h"
33+ #include " llvm/CAS/ActionCache.h"
3334#include " llvm/CAS/CASProvidingFileSystem.h"
3435#include " llvm/CAS/CASReference.h"
3536#include " llvm/CAS/CachingOnDiskFileSystem.h"
3637#include " llvm/CAS/ObjectStore.h"
3738#include " llvm/Support/Error.h"
39+ #include " llvm/Support/MemoryBuffer.h"
3840#include " llvm/Support/Mutex.h"
3941#include " llvm/Support/PrefixMapper.h"
4042#include " llvm/Support/VirtualFileSystem.h"
@@ -338,6 +340,12 @@ class SwiftSourceModuleDependenciesStorage
338340 // / The Swift frontend invocation arguments to build bridging header.
339341 std::vector<std::string> bridgingHeaderBuildCommandLine;
340342
343+ // / The chained bridging header path if used.
344+ std::string chainedBridgingHeaderPath;
345+
346+ // / The chained bridging header source buffer if used.
347+ std::string chainedBridgingHeaderContent;
348+
341349 SwiftSourceModuleDependenciesStorage (
342350 StringRef RootID, ArrayRef<StringRef> buildCommandLine,
343351 ArrayRef<ScannerImportStatementInfo> moduleImports,
@@ -354,6 +362,7 @@ class SwiftSourceModuleDependenciesStorage
354362 return new SwiftSourceModuleDependenciesStorage (*this );
355363 }
356364
365+
357366 static bool classof (const ModuleDependencyInfoStorageBase *base) {
358367 return base->dependencyKind == ModuleDependencyKind::SwiftSource;
359368 }
@@ -370,6 +379,11 @@ class SwiftSourceModuleDependenciesStorage
370379 void addTestableImport (ImportPath::Module module ) {
371380 testableImports.insert (module .front ().Item .str ());
372381 }
382+
383+ void setChainedBridgingHeaderBuffer (StringRef path, StringRef buffer) {
384+ chainedBridgingHeaderPath = path.str ();
385+ chainedBridgingHeaderContent = buffer.str ();
386+ }
373387};
374388
375389// / Describes the dependencies of a pre-built Swift module (with no
@@ -769,11 +783,11 @@ class ModuleDependencyInfo {
769783 setLinkLibraries (const ArrayRef<LinkLibrary> linkLibraries) {
770784 storage->linkLibraries .assign (linkLibraries.begin (), linkLibraries.end ());
771785 }
772-
786+
773787 const ArrayRef<std::string> getAuxiliaryFiles () const {
774788 return storage->auxiliaryFiles ;
775789 }
776-
790+
777791 void
778792 setAuxiliaryFiles (const ArrayRef<std::string> auxiliaryFiles) {
779793 storage->auxiliaryFiles .assign (auxiliaryFiles.begin (), auxiliaryFiles.end ());
@@ -961,11 +975,14 @@ class ModuleDependencyInfo {
961975 void addSourceFile (StringRef sourceFile);
962976
963977 // / Add source files that the header input depends on.
964- void addHeaderSourceFile (StringRef bridgingSourceFile );
978+ void setHeaderSourceFiles ( const std::vector<std::string> &sourceFiles );
965979
966980 // / Add bridging header include tree.
967981 void addBridgingHeaderIncludeTree (StringRef ID);
968982
983+ // / Set the chained bridging header buffer.
984+ void setChainedBridgingHeaderBuffer (StringRef path, StringRef buffer);
985+
969986 // / Collect a map from a secondary module name to a list of cross-import
970987 // / overlays, when this current module serves as the primary module.
971988 llvm::StringMap<llvm::SmallSetVector<Identifier, 4 >>
@@ -1025,8 +1042,9 @@ class SwiftDependencyScanningService {
10251042 // / If use clang include tree.
10261043 bool UseClangIncludeTree = false ;
10271044
1028- // / CAS ObjectStore Instance.
1045+ // / CAS Instance.
10291046 std::shared_ptr<llvm::cas::ObjectStore> CAS;
1047+ std::shared_ptr<llvm::cas::ActionCache> ActionCache;
10301048
10311049 // / File prefix mapper.
10321050 std::unique_ptr<llvm::PrefixMapper> Mapper;
@@ -1182,11 +1200,11 @@ class ModuleDependenciesCache {
11821200 // / Query all dependencies
11831201 ModuleDependencyIDSetVector
11841202 getAllDependencies (const ModuleDependencyID &moduleID) const ;
1185-
1203+
11861204 // / Query all Clang module dependencies.
11871205 ModuleDependencyIDSetVector
11881206 getClangDependencies (const ModuleDependencyID &moduleID) const ;
1189-
1207+
11901208 // / Query all directly-imported Swift dependencies
11911209 llvm::ArrayRef<ModuleDependencyID>
11921210 getImportedSwiftDependencies (const ModuleDependencyID &moduleID) const ;
0 commit comments