[clang] Forcefully require new attributes to be documented (PR #203296)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 11 09:19:57 PDT 2026


================
@@ -5568,6 +5568,49 @@ static void WriteDocumentation(const RecordKeeper &Records,
   OS << "\n\n\n";
 }
 
+void GetListOfUndocumentedAttributes(
+    const RecordKeeper &Records,
+    std::vector<const Record *> &UndocumentedAttrs) {
+  const Record *Documentation = Records.getDef("GlobalDocumentation");
+  if (!Documentation) {
+    PrintFatalError("The Documentation top-level definition is missing.");
+    return;
+  }
+
+  for (const auto *A : Records.getAllDerivedDefinitions("Attr")) {
+    const Record &Attr = *A;
+    std::vector<const Record *> Docs =
+        Attr.getValueAsListOfDefs("Documentation");
+    for (const auto *D : Docs) {
+      const Record &Doc = *D;
+      const Record *Category = Doc.getValueAsDef("Category");
+      if (Category->getValueAsString("Name") == "Undocumented")
+        UndocumentedAttrs.push_back(A);
+    }
+  }
+}
+
+void EmitClangUndocumentedAttrlist(const llvm::RecordKeeper &Records,
----------------
AaronBallman wrote:

Whoops, good catch, that was a typo on my part.

https://github.com/llvm/llvm-project/pull/203296


More information about the cfe-commits mailing list