mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Implement silencing errors on rebuild with a new engine
This commit is contained in:
@@ -320,11 +320,19 @@ bool ImplicitModuleInterfaceBuilder::buildSwiftModuleInternal(
|
||||
llvm::RestorePrettyStackState(savedInnerPrettyStackState);
|
||||
};
|
||||
|
||||
Optional<DiagnosticEngine> localDiags;
|
||||
DiagnosticEngine *rebuildDiags = diags;
|
||||
if (silenceInterfaceDiagnostics) {
|
||||
// To silence diagnostics, use a local temporary engine.
|
||||
localDiags.emplace(sourceMgr);
|
||||
rebuildDiags = &*localDiags;
|
||||
}
|
||||
|
||||
SubError = (bool)subASTDelegate.runInSubCompilerInstance(
|
||||
moduleName, interfacePath, OutPath, diagnosticLoc,
|
||||
[&](SubCompilerInstanceInfo &info) {
|
||||
auto EBuilder = ExplicitModuleInterfaceBuilder(
|
||||
*info.Instance, diags, sourceMgr, moduleCachePath, backupInterfaceDir,
|
||||
*info.Instance, rebuildDiags, sourceMgr, moduleCachePath, backupInterfaceDir,
|
||||
prebuiltCachePath, ABIDescriptorPath, extraDependencies, diagnosticLoc,
|
||||
dependencyTracker);
|
||||
return EBuilder.buildSwiftModuleFromInterface(
|
||||
|
||||
Reference in New Issue
Block a user