ABIChecker: add an option to avoid diagnosing about certain given SPI groups

rdar://92032848
This commit is contained in:
Xi Ge
2022-06-04 22:27:40 -07:00
parent 0567a9b142
commit dfb53212d8
4 changed files with 35 additions and 1 deletions

View File

@@ -161,6 +161,7 @@ struct CheckerOptions {
bool Migrator;
StringRef LocationFilter;
std::vector<std::string> ToolArgs;
llvm::StringSet<> SPIGroupNamesToIgnore;
};
class SDKContext {
@@ -417,6 +418,12 @@ public:
if (isObjc())
return;
}
// Don't emit SPIs if the group name is out-out.
for (auto spi: getSPIGroups()) {
if (Ctx.getOpts().SPIGroupNamesToIgnore.contains(spi)) {
return;
}
}
Ctx.getDiags(Loc).diagnose(Loc, ID, getScreenInfo(), std::move(Args)...);
}
};