diff --git a/clang/utils/TableGen/ClangSACheckersEmitter.cpp b/clang/utils/TableGen/ClangSACheckersEmitter.cpp --- a/clang/utils/TableGen/ClangSACheckersEmitter.cpp +++ b/clang/utils/TableGen/ClangSACheckersEmitter.cpp @@ -76,14 +76,17 @@ 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 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 "";