30
30
#include " llvm/ADT/DenseSet.h"
31
31
#include " llvm/ADT/IntrusiveRefCntPtr.h"
32
32
#include " llvm/ADT/StringSet.h"
33
+ #include " llvm/CAS/ActionCache.h"
33
34
#include " llvm/CAS/CASProvidingFileSystem.h"
34
35
#include " llvm/CAS/CASReference.h"
35
36
#include " llvm/CAS/CachingOnDiskFileSystem.h"
36
37
#include " llvm/CAS/ObjectStore.h"
37
38
#include " llvm/Support/Error.h"
39
+ #include " llvm/Support/MemoryBuffer.h"
38
40
#include " llvm/Support/Mutex.h"
39
41
#include " llvm/Support/PrefixMapper.h"
40
42
#include " llvm/Support/VirtualFileSystem.h"
@@ -338,6 +340,12 @@ class SwiftSourceModuleDependenciesStorage
338
340
// / The Swift frontend invocation arguments to build bridging header.
339
341
std::vector<std::string> bridgingHeaderBuildCommandLine;
340
342
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
+
341
349
SwiftSourceModuleDependenciesStorage (
342
350
StringRef RootID, ArrayRef<StringRef> buildCommandLine,
343
351
ArrayRef<ScannerImportStatementInfo> moduleImports,
@@ -354,6 +362,7 @@ class SwiftSourceModuleDependenciesStorage
354
362
return new SwiftSourceModuleDependenciesStorage (*this );
355
363
}
356
364
365
+
357
366
static bool classof (const ModuleDependencyInfoStorageBase *base) {
358
367
return base->dependencyKind == ModuleDependencyKind::SwiftSource;
359
368
}
@@ -370,6 +379,11 @@ class SwiftSourceModuleDependenciesStorage
370
379
void addTestableImport (ImportPath::Module module ) {
371
380
testableImports.insert (module .front ().Item .str ());
372
381
}
382
+
383
+ void setChainedBridgingHeaderBuffer (StringRef path, StringRef buffer) {
384
+ chainedBridgingHeaderPath = path.str ();
385
+ chainedBridgingHeaderContent = buffer.str ();
386
+ }
373
387
};
374
388
375
389
// / Describes the dependencies of a pre-built Swift module (with no
@@ -769,11 +783,11 @@ class ModuleDependencyInfo {
769
783
setLinkLibraries (const ArrayRef<LinkLibrary> linkLibraries) {
770
784
storage->linkLibraries .assign (linkLibraries.begin (), linkLibraries.end ());
771
785
}
772
-
786
+
773
787
const ArrayRef<std::string> getAuxiliaryFiles () const {
774
788
return storage->auxiliaryFiles ;
775
789
}
776
-
790
+
777
791
void
778
792
setAuxiliaryFiles (const ArrayRef<std::string> auxiliaryFiles) {
779
793
storage->auxiliaryFiles .assign (auxiliaryFiles.begin (), auxiliaryFiles.end ());
@@ -961,11 +975,14 @@ class ModuleDependencyInfo {
961
975
void addSourceFile (StringRef sourceFile);
962
976
963
977
// / Add source files that the header input depends on.
964
- void addHeaderSourceFile (StringRef bridgingSourceFile );
978
+ void setHeaderSourceFiles ( const std::vector<std::string> &sourceFiles );
965
979
966
980
// / Add bridging header include tree.
967
981
void addBridgingHeaderIncludeTree (StringRef ID);
968
982
983
+ // / Set the chained bridging header buffer.
984
+ void setChainedBridgingHeaderBuffer (StringRef path, StringRef buffer);
985
+
969
986
// / Collect a map from a secondary module name to a list of cross-import
970
987
// / overlays, when this current module serves as the primary module.
971
988
llvm::StringMap<llvm::SmallSetVector<Identifier, 4 >>
@@ -1025,8 +1042,9 @@ class SwiftDependencyScanningService {
1025
1042
// / If use clang include tree.
1026
1043
bool UseClangIncludeTree = false ;
1027
1044
1028
- // / CAS ObjectStore Instance.
1045
+ // / CAS Instance.
1029
1046
std::shared_ptr<llvm::cas::ObjectStore> CAS;
1047
+ std::shared_ptr<llvm::cas::ActionCache> ActionCache;
1030
1048
1031
1049
// / File prefix mapper.
1032
1050
std::unique_ptr<llvm::PrefixMapper> Mapper;
@@ -1182,11 +1200,11 @@ class ModuleDependenciesCache {
1182
1200
// / Query all dependencies
1183
1201
ModuleDependencyIDSetVector
1184
1202
getAllDependencies (const ModuleDependencyID &moduleID) const ;
1185
-
1203
+
1186
1204
// / Query all Clang module dependencies.
1187
1205
ModuleDependencyIDSetVector
1188
1206
getClangDependencies (const ModuleDependencyID &moduleID) const ;
1189
-
1207
+
1190
1208
// / Query all directly-imported Swift dependencies
1191
1209
llvm::ArrayRef<ModuleDependencyID>
1192
1210
getImportedSwiftDependencies (const ModuleDependencyID &moduleID) const ;
0 commit comments