ABI checker: when invoking via build system, explicitly mention ABI breakge in diagnostics

The error messages emitted from the ABI checker are mostly explanations of breakages. We should
explicitly mention why they are emitted to differentiate them from other compiler diagnostics.

rdar://68864860
This commit is contained in:
Xi Ge
2020-09-14 10:38:15 -07:00
parent fc6b14faf7
commit 00577acacd
3 changed files with 22 additions and 16 deletions

View File

@@ -409,10 +409,16 @@ StringRef SDKNodeDecl::getScreenInfo() const {
auto &Ctx = getSDKContext();
llvm::SmallString<64> SS;
llvm::raw_svector_ostream OS(SS);
if (Ctx.getOpts().PrintModule)
OS << ModuleName;
if (!HeaderName.empty())
OS << "(" << HeaderName << ")";
if (Ctx.getOpts().CompilerStyle) {
// Compiler style we don't need source info
OS << (Ctx.checkingABI() ? "ABI breakage" : "API breakage");
} else {
// Print more source info.
if (Ctx.getOpts().PrintModule)
OS << ModuleName;
if (!HeaderName.empty())
OS << "(" << HeaderName << ")";
}
if (!OS.str().empty())
OS << ": ";
bool IsExtension = false;