[PATCH] D122244: [analyzer] Turn missing tablegen doc entry of a checker into fatal error

Bal√°zs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 03:15:08 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG63c4ca9d14ba: [analyzer] Turn missing tablegen doc entry of a checker into fatal error (authored by steakhal).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122244/new/

https://reviews.llvm.org/D122244

Files:
  clang/utils/TableGen/ClangSACheckersEmitter.cpp


Index: clang/utils/TableGen/ClangSACheckersEmitter.cpp
===================================================================
--- clang/utils/TableGen/ClangSACheckersEmitter.cpp
+++ 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<...> 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 "";
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122244.423576.patch
Type: text/x-patch
Size: 1002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220419/896ff910/attachment.bin>


More information about the cfe-commits mailing list