Merge branch 'main' into tbkka-assertions2

This commit is contained in:
Tim Kientzle
2024-06-18 17:52:00 -07:00
committed by GitHub
741 changed files with 12849 additions and 4479 deletions

View File

@@ -252,14 +252,14 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
cache.configureForContextHash(getContextHash());
unsigned outputPathFileID, interfaceFileID,
compiledModuleCandidatesArrayID, buildCommandLineArrayID,
extraPCMArgsArrayID, contextHashID, isFramework, bridgingHeaderFileID,
extraPCMArgsArrayID, contextHashID, isFramework, isStatic, bridgingHeaderFileID,
sourceFilesArrayID, bridgingSourceFilesArrayID,
bridgingModuleDependenciesArrayID, overlayDependencyIDArrayID,
CASFileSystemRootID, bridgingHeaderIncludeTreeID, moduleCacheKeyID;
SwiftInterfaceModuleDetailsLayout::readRecord(
Scratch, outputPathFileID, interfaceFileID,
compiledModuleCandidatesArrayID, buildCommandLineArrayID,
extraPCMArgsArrayID, contextHashID, isFramework, bridgingHeaderFileID,
extraPCMArgsArrayID, contextHashID, isFramework, isStatic, bridgingHeaderFileID,
sourceFilesArrayID, bridgingSourceFilesArrayID,
bridgingModuleDependenciesArrayID, overlayDependencyIDArrayID,
CASFileSystemRootID, bridgingHeaderIncludeTreeID, moduleCacheKeyID);
@@ -294,6 +294,9 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
std::vector<StringRef> extraPCMRefs;
for (auto &arg : *extraPCMArgs)
extraPCMRefs.push_back(arg);
std::vector<StringRef> compiledCandidatesRefs;
for (auto &cc : compiledCandidatesRefs)
compiledCandidatesRefs.push_back(cc);
auto rootFileSystemID = getIdentifier(CASFileSystemRootID);
if (!rootFileSystemID)
@@ -302,11 +305,12 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
if (!moduleCacheKeyID)
llvm::report_fatal_error("Bad moduleCacheKey");
// TODO: LinkLibraries
// Form the dependencies storage object
auto moduleDep = ModuleDependencyInfo::forSwiftInterfaceModule(
outputModulePath.value(), optionalSwiftInterfaceFile.value(),
*compiledModuleCandidates, buildCommandRefs, extraPCMRefs,
*contextHash, isFramework, *rootFileSystemID, *moduleCacheKey);
compiledCandidatesRefs, buildCommandRefs, {}, extraPCMRefs,
*contextHash, isFramework, isStatic, *rootFileSystemID, *moduleCacheKey);
// Add imports of this module
for (const auto &moduleName : currentModuleImports)
@@ -485,13 +489,14 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
unsigned compiledModulePathID, moduleDocPathID, moduleSourceInfoPathID,
overlayDependencyIDArrayID, headerImportID,
headerModuleDependenciesArrayID,
headerImportsSourceFilesArrayID, isFramework,
headerImportsSourceFilesArrayID, isFramework, isStatic,
moduleCacheKeyID;
SwiftBinaryModuleDetailsLayout::readRecord(
Scratch, compiledModulePathID, moduleDocPathID,
moduleSourceInfoPathID, overlayDependencyIDArrayID,
headerImportID, headerModuleDependenciesArrayID,
headerImportsSourceFilesArrayID, isFramework, moduleCacheKeyID);
headerImportsSourceFilesArrayID, isFramework, isStatic,
moduleCacheKeyID);
auto compiledModulePath = getIdentifier(compiledModulePathID);
if (!compiledModulePath)
@@ -509,11 +514,12 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
if (!headerImport)
llvm::report_fatal_error("Bad binary direct dependencies: no header import");
// TODO: LinkLibraries
// Form the dependencies storage object
auto moduleDep = ModuleDependencyInfo::forSwiftBinaryModule(
*compiledModulePath, *moduleDocPath, *moduleSourceInfoPath,
currentModuleImports, currentOptionalModuleImports,
*headerImport, isFramework, *moduleCacheKey);
currentModuleImports, currentOptionalModuleImports, {},
*headerImport, isFramework, isStatic, *moduleCacheKey);
auto headerModuleDependencies = getStringArray(headerModuleDependenciesArrayID);
if (!headerModuleDependencies)
@@ -620,10 +626,11 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
if (!moduleCacheKeyID)
llvm::report_fatal_error("Bad moduleCacheKey");
// TODO: LinkLibraries
// Form the dependencies storage object
auto moduleDep = ModuleDependencyInfo::forClangModule(
*pcmOutputPath, *mappedPCMPath, *moduleMapPath, *contextHash,
*commandLineArgs, *fileDependencies, *capturedPCMArgs,
*commandLineArgs, *fileDependencies, *capturedPCMArgs, {},
*rootFileSystemID, *clangIncludeTreeRoot, *moduleCacheKey, isSystem);
// Add dependencies of this module
@@ -985,7 +992,8 @@ void ModuleDependenciesCacheSerializer::writeModuleInfo(
ModuleIdentifierArrayKind::CompiledModuleCandidates),
getArrayID(moduleID, ModuleIdentifierArrayKind::BuildCommandLine),
getArrayID(moduleID, ModuleIdentifierArrayKind::ExtraPCMArgs),
getIdentifier(swiftTextDeps->contextHash), swiftTextDeps->isFramework,
getIdentifier(swiftTextDeps->contextHash),
swiftTextDeps->isFramework, swiftTextDeps->isStatic,
bridgingHeaderFileId,
getArrayID(moduleID, ModuleIdentifierArrayKind::SourceFiles),
getArrayID(moduleID, ModuleIdentifierArrayKind::BridgingSourceFiles),
@@ -1041,7 +1049,7 @@ void ModuleDependenciesCacheSerializer::writeModuleInfo(
getArrayID(moduleID, ModuleIdentifierArrayKind::DependencyHeaders),
getArrayID(moduleID, ModuleIdentifierArrayKind::HeaderInputModuleDependencies),
getArrayID(moduleID, ModuleIdentifierArrayKind::HeaderInputDependencySourceFiles),
swiftBinDeps->isFramework,
swiftBinDeps->isFramework, swiftBinDeps->isStatic,
getIdentifier(swiftBinDeps->moduleCacheKey));
break;