forked from OSchip/llvm-project
[analyzer] Turn missing tablegen doc entry of a checker into fatal error
It turns out all checkers explicitly mention the `Documentation<>`. It makes sense to demand this, so emit a fatal tablegen error if such happens. Reviewed By: martong, Szelethus Differential Revision: https://reviews.llvm.org/D122244
This commit is contained in:
parent
b7c988811d
commit
63c4ca9d14
|
@ -76,14 +76,17 @@ static inline uint64_t getValueFromBitsInit(const BitsInit *B, const Record &R)
|
||||||
|
|
||||||
static std::string getCheckerDocs(const Record &R) {
|
static std::string getCheckerDocs(const Record &R) {
|
||||||
StringRef LandingPage;
|
StringRef LandingPage;
|
||||||
if (BitsInit *BI = R.getValueAsBitsInit("Documentation")) {
|
const BitsInit *BI = R.getValueAsBitsInit("Documentation");
|
||||||
uint64_t V = getValueFromBitsInit(BI, R);
|
if (!BI)
|
||||||
if (V == 1)
|
PrintFatalError(R.getLoc(), "missing Documentation<...> member for " +
|
||||||
LandingPage = "available_checks.html";
|
getCheckerFullName(&R));
|
||||||
else if (V == 2)
|
|
||||||
LandingPage = "alpha_checks.html";
|
uint64_t V = getValueFromBitsInit(BI, R);
|
||||||
}
|
if (V == 1)
|
||||||
|
LandingPage = "available_checks.html";
|
||||||
|
else if (V == 2)
|
||||||
|
LandingPage = "alpha_checks.html";
|
||||||
|
|
||||||
if (LandingPage.empty())
|
if (LandingPage.empty())
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue