mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ABI checker: add a mechansim for specifying allowd ABI breakages
When the checker found a breakage listed in the user-specified list, the breage should be consumed internally without failing the check. rdar://68086477
This commit is contained in:
@@ -78,7 +78,7 @@ static StringRef getCategoryName(uint32_t ID) {
|
||||
case LocalDiagID::not_inheriting_convenience_inits:
|
||||
return "/* Class Inheritance Change */";
|
||||
default:
|
||||
return StringRef();
|
||||
return "/* Others */";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,3 +122,28 @@ swift::ide::api::ModuleDifferDiagsConsumer::~ModuleDifferDiagsConsumer() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool swift::ide::api::
|
||||
FilteringDiagnosticConsumer::shouldProceed(const DiagnosticInfo &Info) {
|
||||
if (allowedBreakages->empty()) {
|
||||
return true;
|
||||
}
|
||||
llvm::SmallString<256> Text;
|
||||
{
|
||||
llvm::raw_svector_ostream Out(Text);
|
||||
DiagnosticEngine::formatDiagnosticText(Out, Info.FormatString,
|
||||
Info.FormatArgs);
|
||||
}
|
||||
return allowedBreakages->count(Text.str()) == 0;
|
||||
}
|
||||
|
||||
void swift::ide::api::
|
||||
FilteringDiagnosticConsumer::handleDiagnostic(SourceManager &SM,
|
||||
const DiagnosticInfo &Info) {
|
||||
if (shouldProceed(Info)) {
|
||||
if (Info.Kind == DiagnosticKind::Error) {
|
||||
HasError = true;
|
||||
}
|
||||
subConsumer->handleDiagnostic(SM, Info);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user