Frontend: Honor warning suppression when parsing arguments from swiftinterfaces.

Diagnostics are suppressed when parsing swiftinterface files, since the
warnings emitted from compiling the swiftinterface of a dependency would just
be a nuisance. It follows that warnings generated when parsing the arguments in
a swiftinterface file should also be suppressed, but that wasn't happening
because the diagnostic engine of the main compile was used for parsing. Pass
the diagnostic engine of the compiler subinstance instead, and proactively
suppress warnings before parsing begins.

Resolves rdar://142814164.
This commit is contained in:
Allan Shortlidge
2025-01-14 22:33:00 -08:00
parent 8dd7669816
commit 3c5ae232dc
4 changed files with 37 additions and 14 deletions

View File

@@ -0,0 +1,7 @@
// RUN: %target-swift-frontend -compile-module-from-interface %S/Inputs/suppress-warnings/SuppressWarnings.swiftinterface -o /dev/null -module-name SuppressWarnings 2>&1 | %FileCheck %s --allow-empty
// RUN: %target-swift-frontend -typecheck %s -I %S/Inputs/suppress-warnings/ 2>&1 | %FileCheck %s --allow-empty
// Warnings should not be emitted when compiling SuppressWarnings from its interface
// CHECK-NOT: warning
import SuppressWarnings