@@ -301,17 +301,19 @@ collectDepsForSerialization(clang::vfs::FileSystem &FS,
301
301
return false ;
302
302
}
303
303
304
- static bool buildSwiftModuleFromSwiftInterface (
304
+ bool ParseableInterfaceModuleLoader:: buildSwiftModuleFromSwiftInterface (
305
305
clang::vfs::FileSystem &FS, DiagnosticEngine &Diags, SourceLoc DiagLoc,
306
- CompilerInvocation &SubInvocation, StringRef ModuleCachePath ,
307
- DependencyTracker *OuterTracker) {
306
+ CompilerInvocation &SubInvocation, StringRef InPath, StringRef OutPath ,
307
+ StringRef ModuleCachePath, DependencyTracker *OuterTracker) {
308
308
bool SubError = false ;
309
309
bool RunSuccess = llvm::CrashRecoveryContext ().RunSafelyOnThread ([&] {
310
310
// Note that we don't assume ModuleCachePath is the same as the Clang
311
311
// module cache path at this point.
312
312
if (!ModuleCachePath.empty ())
313
313
(void )llvm::sys::fs::create_directory (ModuleCachePath);
314
314
315
+ configureSubInvocationInputsAndOutputs (SubInvocation, InPath, OutPath);
316
+
315
317
FrontendOptions &FEOpts = SubInvocation.getFrontendOptions ();
316
318
const auto &InputInfo = FEOpts.InputsAndOutputs .firstInput ();
317
319
StringRef InPath = InputInfo.file ();
@@ -514,14 +516,13 @@ std::error_code ParseableInterfaceModuleLoader::findModuleFilesInDirectory(
514
516
createInvocationForBuildingFromInterface (Ctx, ModuleID.first .str (),
515
517
CacheDir);
516
518
computeCachedOutputPath (Ctx, SubInvocation, InPath, OutPath);
517
- configureSubInvocationInputsAndOutputs (SubInvocation, InPath, OutPath);
518
519
519
520
// Evaluate if we need to run this sub-invocation, and if so run it.
520
521
if (!swiftModuleIsUpToDate (FS, ModuleID, OutPath, Diags,
521
522
dependencyTracker)) {
522
- if (:: buildSwiftModuleFromSwiftInterface (FS, Diags, ModuleID.second ,
523
- SubInvocation, CacheDir ,
524
- dependencyTracker))
523
+ if (buildSwiftModuleFromSwiftInterface (FS, Diags, ModuleID.second ,
524
+ SubInvocation, InPath, OutPath ,
525
+ CacheDir, dependencyTracker))
525
526
return std::make_error_code (std::errc::invalid_argument);
526
527
}
527
528
}
@@ -549,13 +550,13 @@ ParseableInterfaceModuleLoader::buildSwiftModuleFromSwiftInterface(
549
550
StringRef InPath, StringRef OutPath) {
550
551
CompilerInvocation SubInvocation =
551
552
createInvocationForBuildingFromInterface (Ctx, ModuleName, CacheDir);
552
- configureSubInvocationInputsAndOutputs (SubInvocation, InPath, OutPath);
553
553
554
554
auto &FS = *Ctx.SourceMgr .getFileSystem ();
555
555
auto &Diags = Ctx.Diags ;
556
- return ::buildSwiftModuleFromSwiftInterface (FS, Diags, /* DiagLoc*/ SourceLoc (),
557
- SubInvocation, /* CachePath*/ " " ,
558
- /* OuterTracker*/ nullptr );
556
+ return buildSwiftModuleFromSwiftInterface (FS, Diags, /* DiagLoc*/ SourceLoc (),
557
+ SubInvocation, InPath, OutPath,
558
+ /* CachePath*/ " " ,
559
+ /* OuterTracker*/ nullptr );
559
560
}
560
561
561
562
// / Diagnose any scoped imports in \p imports, i.e. those with a non-empty
0 commit comments