mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ModuleLoader: emit a note when encountering a blocklisted module interface
This commit is contained in:
@@ -930,6 +930,9 @@ NOTE(modularization_issue_related_modules,none,
|
||||
"the %select{declaration|type}0 %1 moved between related modules; "
|
||||
"clang preprocessor macros may affect headers shared between these modules",
|
||||
(bool, DeclName))
|
||||
NOTE(interface_block_listed_broken,none,
|
||||
"textual interface for %0 is blocklisted as broken; "
|
||||
"interface verification errors are downgraded to warnings", (StringRef))
|
||||
|
||||
NOTE(modularization_issue_side_effect_extension_error,none,
|
||||
"could not deserialize extension",
|
||||
|
||||
@@ -189,10 +189,14 @@ bool ExplicitModuleInterfaceBuilder::collectDepsForSerialization(
|
||||
|
||||
static bool shouldDowngradeInterfaceVerificationError(const FrontendOptions &opts,
|
||||
ASTContext &ctx) {
|
||||
return opts.DowngradeInterfaceVerificationError ||
|
||||
ctx.blockListConfig.hasBlockListAction(opts.ModuleName,
|
||||
BlockListKeyKind::ModuleName,
|
||||
BlockListAction::DowngradeInterfaceVerificationFailure);
|
||||
if (ctx.blockListConfig.hasBlockListAction(opts.ModuleName,
|
||||
BlockListKeyKind::ModuleName,
|
||||
BlockListAction::DowngradeInterfaceVerificationFailure)) {
|
||||
ctx.Diags.diagnose(SourceLoc(), diag::interface_block_listed_broken,
|
||||
opts.ModuleName);
|
||||
return true;
|
||||
}
|
||||
return opts.DowngradeInterfaceVerificationError;
|
||||
}
|
||||
|
||||
std::error_code ExplicitModuleInterfaceBuilder::buildSwiftModuleFromInterface(
|
||||
|
||||
@@ -18,4 +18,8 @@
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -downgrade-typecheck-interface-error
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -blocklist-file %t/blocklist.yml
|
||||
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -blocklist-file %t/blocklist.yml &> %t/notes.txt
|
||||
// RUN: %FileCheck -check-prefix CHECK-NOTES --input-file %t/notes.txt %s
|
||||
// CHECK-NOTES: note: textual interface for Test is blocklisted as broken; interface verification errors are downgraded to warnings
|
||||
|
||||
public func foo() {}
|
||||
|
||||
Reference in New Issue
Block a user