mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CachedDiags] Don't cache diagnostics if command-line failed
This commit is contained in:
@@ -2076,6 +2076,11 @@ int swift::performFrontend(ArrayRef<const char *> Args,
|
||||
auto finishDiagProcessing = [&](int retValue, bool verifierEnabled) -> int {
|
||||
FinishDiagProcessingCheckRAII.CalledFinishDiagProcessing = true;
|
||||
PDC.setSuppressOutput(false);
|
||||
if (auto *CDP = Instance->getCachingDiagnosticsProcessor()) {
|
||||
// Don't cache if build failed.
|
||||
if (retValue)
|
||||
CDP->endDiagnosticCapture();
|
||||
}
|
||||
bool diagnosticsError = Instance->getDiags().finishProcessing();
|
||||
// If the verifier is enabled and did not encounter any verification errors,
|
||||
// return 0 even if the compile failed. This behavior isn't ideal, but large
|
||||
|
||||
Reference in New Issue
Block a user