@@ -300,15 +300,13 @@ struct ModuleInterfaceLoaderOptions {
300
300
bool disableImplicitSwiftModule = false ;
301
301
bool disableBuildingInterface = false ;
302
302
bool downgradeInterfaceVerificationError = false ;
303
- bool ignoreInterfaceProvidedOptions = false ;
304
303
std::string mainExecutablePath;
305
304
ModuleInterfaceLoaderOptions (const FrontendOptions &Opts):
306
305
remarkOnRebuildFromInterface (Opts.RemarkOnRebuildFromModuleInterface),
307
306
disableInterfaceLock (Opts.DisableInterfaceFileLock),
308
307
disableImplicitSwiftModule (Opts.DisableImplicitModules),
309
308
disableBuildingInterface (Opts.DisableBuildingInterface),
310
309
downgradeInterfaceVerificationError (Opts.DowngradeInterfaceVerificationError),
311
- ignoreInterfaceProvidedOptions(Opts.IgnoreInterfaceProvidedOptions),
312
310
mainExecutablePath(Opts.MainExecutablePath)
313
311
{
314
312
switch (Opts.RequestedAction ) {
@@ -442,6 +440,21 @@ class ModuleInterfaceLoader : public SerializedModuleLoaderBase {
442
440
bool SerializeDependencyHashes,
443
441
bool TrackSystemDependencies, ModuleInterfaceLoaderOptions Opts,
444
442
RequireOSSAModules_t RequireOSSAModules);
443
+
444
+ // / Unconditionally build \p InPath (a swiftinterface file) to \p OutPath (as
445
+ // / a swiftmodule file).
446
+ // /
447
+ // / Unlike the above `buildSwiftModuleFromSwiftInterface`, this method
448
+ // / bypasses the instantiation of a `CompilerInstance` from the compiler
449
+ // / configuration flags in the interface and instead directly uses the
450
+ // / supplied \p Instance
451
+ static bool buildExplicitSwiftModuleFromSwiftInterface (
452
+ CompilerInstance &Instance, const StringRef moduleCachePath,
453
+ const StringRef backupInterfaceDir, const StringRef prebuiltCachePath,
454
+ const StringRef ABIDescriptorPath, StringRef interfacePath,
455
+ StringRef outputPath, bool ShouldSerializeDeps,
456
+ ArrayRef<std::string> CompiledCandidates,
457
+ DependencyTracker *tracker = nullptr );
445
458
};
446
459
447
460
struct InterfaceSubContextDelegateImpl : InterfaceSubContextDelegate {
@@ -460,13 +473,8 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
460
473
InFlightDiagnostic diagnose (StringRef interfacePath,
461
474
SourceLoc diagnosticLoc,
462
475
Diag<ArgTypes...> ID,
463
- typename detail::PassArgument<ArgTypes>::type... Args) {
464
- SourceLoc loc = diagnosticLoc;
465
- if (diagnosticLoc.isInvalid ()) {
466
- // Diagnose this inside the interface file, if possible.
467
- loc = SM.getLocFromExternalSource (interfacePath, 1 , 1 );
468
- }
469
- return Diags->diagnose (loc, ID, std::move (Args)...);
476
+ typename detail::PassArgument<ArgTypes>::type... Args) {
477
+ return InterfaceSubContextDelegateImpl::diagnose (interfacePath, diagnosticLoc, SM, Diags, ID, std::move (Args)...);
470
478
}
471
479
void
472
480
inheritOptionsForBuildingInterface (const SearchPathOptions &SearchPathOpts,
@@ -476,8 +484,7 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
476
484
SmallVectorImpl<const char *> &SubArgs,
477
485
std::string &CompilerVersion,
478
486
StringRef interfacePath,
479
- SourceLoc diagnosticLoc,
480
- bool ignoreInterfaceProvidedOptions);
487
+ SourceLoc diagnosticLoc);
481
488
public:
482
489
InterfaceSubContextDelegateImpl (
483
490
SourceManager &SM, DiagnosticEngine *Diags,
@@ -488,19 +495,33 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
488
495
StringRef backupModuleInterfaceDir,
489
496
bool serializeDependencyHashes, bool trackSystemDependencies,
490
497
RequireOSSAModules_t requireOSSAModules);
498
+
499
+ template <typename ...ArgTypes>
500
+ static InFlightDiagnostic diagnose (StringRef interfacePath,
501
+ SourceLoc diagnosticLoc,
502
+ SourceManager &SM,
503
+ DiagnosticEngine *Diags,
504
+ Diag<ArgTypes...> ID,
505
+ typename detail::PassArgument<ArgTypes>::type... Args) {
506
+ SourceLoc loc = diagnosticLoc;
507
+ if (diagnosticLoc.isInvalid ()) {
508
+ // Diagnose this inside the interface file, if possible.
509
+ loc = SM.getLocFromExternalSource (interfacePath, 1 , 1 );
510
+ }
511
+ return Diags->diagnose (loc, ID, std::move (Args)...);
512
+ }
513
+
491
514
std::error_code runInSubContext (StringRef moduleName,
492
515
StringRef interfacePath,
493
516
StringRef outputPath,
494
517
SourceLoc diagLoc,
495
- bool ignoreInterfaceProvidedOptions,
496
518
llvm::function_ref<std::error_code(ASTContext&, ModuleDecl*,
497
519
ArrayRef<StringRef>, ArrayRef<StringRef>,
498
520
StringRef)> action) override ;
499
521
std::error_code runInSubCompilerInstance (StringRef moduleName,
500
522
StringRef interfacePath,
501
523
StringRef outputPath,
502
524
SourceLoc diagLoc,
503
- bool ignoreInterfaceProvidedOptions,
504
525
llvm::function_ref<std::error_code(SubCompilerInstanceInfo&)> action) override ;
505
526
506
527
~InterfaceSubContextDelegateImpl () = default ;
0 commit comments