@@ -336,17 +336,25 @@ class ModuleInterfaceCheckerImpl: public ModuleInterfaceChecker {
336336 ASTContext &Ctx;
337337 std::string CacheDir;
338338 std::string PrebuiltCacheDir;
339+ std::string BackupInterfaceDir;
339340 ModuleInterfaceLoaderOptions Opts;
340341 RequireOSSAModules_t RequiresOSSAModules;
341342
342343public:
343344 explicit ModuleInterfaceCheckerImpl (ASTContext &Ctx, StringRef cacheDir,
344345 StringRef prebuiltCacheDir,
346+ StringRef BackupInterfaceDir,
345347 ModuleInterfaceLoaderOptions opts,
346348 RequireOSSAModules_t requiresOSSAModules)
347349 : Ctx(Ctx), CacheDir(cacheDir), PrebuiltCacheDir(prebuiltCacheDir),
350+ BackupInterfaceDir(BackupInterfaceDir),
348351 Opts(opts), RequiresOSSAModules(requiresOSSAModules) {}
349-
352+ explicit ModuleInterfaceCheckerImpl (ASTContext &Ctx, StringRef cacheDir,
353+ StringRef prebuiltCacheDir,
354+ ModuleInterfaceLoaderOptions opts,
355+ RequireOSSAModules_t requiresOSSAModules):
356+ ModuleInterfaceCheckerImpl(Ctx, cacheDir, prebuiltCacheDir, StringRef(),
357+ opts, requiresOSSAModules) {}
350358 std::vector<std::string>
351359 getCompiledModuleCandidatesForInterface (StringRef moduleName,
352360 StringRef interfacePath) override ;
@@ -359,6 +367,8 @@ class ModuleInterfaceCheckerImpl: public ModuleInterfaceChecker {
359367 ArrayRef<std::string> candidates,
360368 StringRef outPath) override ;
361369 bool isCached (StringRef DepPath);
370+ std::string getBackupPublicModuleInterfacePath (StringRef moduleName,
371+ StringRef interfacePath) override ;
362372};
363373
364374// / A ModuleLoader that runs a subordinate \c CompilerInvocation and
@@ -414,7 +424,8 @@ class ModuleInterfaceLoader : public SerializedModuleLoaderBase {
414424 SourceManager &SourceMgr, DiagnosticEngine &Diags,
415425 const SearchPathOptions &SearchPathOpts, const LangOptions &LangOpts,
416426 const ClangImporterOptions &ClangOpts, StringRef CacheDir,
417- StringRef PrebuiltCacheDir, StringRef ModuleName, StringRef InPath,
427+ StringRef PrebuiltCacheDir, StringRef BackupInterfaceDir,
428+ StringRef ModuleName, StringRef InPath,
418429 StringRef OutPath, bool SerializeDependencyHashes,
419430 bool TrackSystemDependencies, ModuleInterfaceLoaderOptions Opts,
420431 RequireOSSAModules_t RequireOSSAModules);
@@ -423,7 +434,9 @@ class ModuleInterfaceLoader : public SerializedModuleLoaderBase {
423434struct InterfaceSubContextDelegateImpl : InterfaceSubContextDelegate {
424435private:
425436 SourceManager &SM;
426- DiagnosticEngine &Diags;
437+ public:
438+ DiagnosticEngine *Diags;
439+ private:
427440 llvm::BumpPtrAllocator Allocator;
428441 llvm::StringSaver ArgSaver;
429442 std::vector<StringRef> GenericArgs;
@@ -439,7 +452,7 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
439452 // Diagnose this inside the interface file, if possible.
440453 loc = SM.getLocFromExternalSource (interfacePath, 1 , 1 );
441454 }
442- return Diags. diagnose (loc, ID, std::move (Args)...);
455+ return Diags-> diagnose (loc, ID, std::move (Args)...);
443456 }
444457 void
445458 inheritOptionsForBuildingInterface (const SearchPathOptions &SearchPathOpts,
@@ -452,11 +465,12 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
452465 SourceLoc diagnosticLoc);
453466public:
454467 InterfaceSubContextDelegateImpl (
455- SourceManager &SM, DiagnosticEngine & Diags,
468+ SourceManager &SM, DiagnosticEngine * Diags,
456469 const SearchPathOptions &searchPathOpts, const LangOptions &langOpts,
457470 const ClangImporterOptions &clangImporterOpts,
458471 ModuleInterfaceLoaderOptions LoaderOpts, bool buildModuleCacheDirIfAbsent,
459472 StringRef moduleCachePath, StringRef prebuiltCachePath,
473+ StringRef backupModuleInterfaceDir,
460474 bool serializeDependencyHashes, bool trackSystemDependencies,
461475 RequireOSSAModules_t requireOSSAModules);
462476 std::error_code runInSubContext (StringRef moduleName,
0 commit comments