mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #61980 from xymus/index-fix-silencing-swiftinterface
[ModuleInterface] Fix silencing errors mode in swiftinterface rebuild
This commit is contained in:
@@ -1725,7 +1725,8 @@ InterfaceSubContextDelegateImpl::runInSubContext(StringRef moduleName,
|
||||
SourceLoc diagLoc,
|
||||
llvm::function_ref<std::error_code(ASTContext&, ModuleDecl*, ArrayRef<StringRef>,
|
||||
ArrayRef<StringRef>, StringRef)> action) {
|
||||
return runInSubCompilerInstance(moduleName, interfacePath, outputPath, diagLoc,
|
||||
return runInSubCompilerInstance(moduleName, interfacePath, outputPath,
|
||||
diagLoc, /*silenceErrors=*/false,
|
||||
[&](SubCompilerInstanceInfo &info){
|
||||
return action(info.Instance->getASTContext(),
|
||||
info.Instance->getMainModule(),
|
||||
@@ -1740,6 +1741,7 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
|
||||
StringRef interfacePath,
|
||||
StringRef outputPath,
|
||||
SourceLoc diagLoc,
|
||||
bool silenceErrors,
|
||||
llvm::function_ref<std::error_code(SubCompilerInstanceInfo&)> action) {
|
||||
// We are about to mess up the compiler invocation by using the compiler
|
||||
// arguments in the textual interface file. So copy to use a new compiler
|
||||
@@ -1834,7 +1836,8 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
|
||||
subInstance.getSourceMgr().setFileSystem(SM.getFileSystem());
|
||||
|
||||
ForwardingDiagnosticConsumer FDC(*Diags);
|
||||
subInstance.addDiagnosticConsumer(&FDC);
|
||||
if (!silenceErrors)
|
||||
subInstance.addDiagnosticConsumer(&FDC);
|
||||
std::string InstanceSetupError;
|
||||
if (subInstance.setup(subInvocation, InstanceSetupError)) {
|
||||
return std::make_error_code(std::errc::not_supported);
|
||||
|
||||
Reference in New Issue
Block a user