Frontend: add a flag to downgrade all module interface verification errors to warnings

Ideally, module interface verification should fail the build when fatal error occurs when
type checking emitted module interfaces. However, we found it's hard to stage this phase in
because the ideal case requires all Swift adopters to have valid interfaces. This new front-end flag allows
driver to downgrade all interface verification errors to warnings as an intermediate step.
This commit is contained in:
Xi Ge
2021-11-09 15:08:17 -08:00
parent d682049d25
commit f77ca2e2ae
7 changed files with 60 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
// RUN: %empty-directory(%t)
// RUN: echo "// swift-interface-format-version: 1.0" > %t/Main.swiftinterface
// RUN: echo "// swift-module-flags: -module-name Foo" >> %t/Main.swiftinterface
// RUN: echo "malfunctioned" >> %t/Main.swiftinterface
// RUN: %target-swift-frontend -typecheck-module-from-interface %t/Main.swiftinterface -module-name Foo -downgrade-typecheck-interface-error &> %t/results.txt
// RUN: %FileCheck --input-file %t/results.txt %s
// CHECK: warning:
// CHECK-NOT: error: