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) {
|
||||
StringRef LandingPage;
|
||||
if (BitsInit *BI = R.getValueAsBitsInit("Documentation")) {
|
||||
uint64_t V = getValueFromBitsInit(BI, R);
|
||||
if (V == 1)
|
||||
LandingPage = "available_checks.html";
|
||||
else if (V == 2)
|
||||
LandingPage = "alpha_checks.html";
|
||||
}
|
||||
|
||||
const BitsInit *BI = R.getValueAsBitsInit("Documentation");
|
||||
if (!BI)
|
||||
PrintFatalError(R.getLoc(), "missing Documentation<...> member for " +
|
||||
getCheckerFullName(&R));
|
||||
|
||||
uint64_t V = getValueFromBitsInit(BI, R);
|
||||
if (V == 1)
|
||||
LandingPage = "available_checks.html";
|
||||
else if (V == 2)
|
||||
LandingPage = "alpha_checks.html";
|
||||
|
||||
if (LandingPage.empty())
|
||||
return "";
|
||||
|
||||
|
|
Loading…
Reference in New Issue