Merge remote-tracking branch 'origin/main' into rebranch

This commit is contained in:
swift-ci
2021-10-06 10:17:29 -07:00
270 changed files with 52347 additions and 2972 deletions

View File

@@ -199,8 +199,10 @@ public:
namespace path = llvm::sys::path;
static bool serializedASTLooksValid(const llvm::MemoryBuffer &buf) {
auto VI = serialization::validateSerializedAST(buf.getBuffer());
static bool serializedASTLooksValid(const llvm::MemoryBuffer &buf,
bool requiresOSSAModules) {
auto VI = serialization::validateSerializedAST(buf.getBuffer(),
requiresOSSAModules);
return VI.status == serialization::Status::Valid;
}
@@ -498,7 +500,8 @@ class ModuleInterfaceLoaderImpl {
LLVM_DEBUG(llvm::dbgs() << "Validating deps of " << path << "\n");
auto validationInfo = serialization::validateSerializedAST(
buf.getBuffer(), /*ExtendedValidationInfo=*/nullptr, &allDeps);
buf.getBuffer(), requiresOSSAModules,
/*ExtendedValidationInfo=*/nullptr, &allDeps);
if (validationInfo.status != serialization::Status::Valid) {
rebuildInfo.setSerializationStatus(path, validationInfo.status);
@@ -539,7 +542,7 @@ class ModuleInterfaceLoaderImpl {
// First, make sure the underlying module path exists and is valid.
auto modBuf = fs.getBufferForFile(fwd.underlyingModulePath);
if (!modBuf || !serializedASTLooksValid(*modBuf.get()))
if (!modBuf || !serializedASTLooksValid(*modBuf.get(), requiresOSSAModules))
return false;
// Next, check the dependencies in the forwarding file.
@@ -647,12 +650,6 @@ class ModuleInterfaceLoaderImpl {
}
std::pair<std::string, std::string> getCompiledModuleCandidates() {
// If we require ossa modules, then we /always/ rebuild the module interface
// regardless of the module loading mode.
if (requiresOSSAModules) {
return {};
}
std::pair<std::string, std::string> result;
// Keep track of whether we should attempt to load a .swiftmodule adjacent
// to the .swiftinterface.