[PATCH] D155134: [clang][docs] Defensively turn off exception behavior in dump_ast_matchers.py

Rashmi Mudduluru via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 15:37:00 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1e62587a48a3: [clang][docs] Defensively turn off exception behavior in dump_ast_matchers.py (authored by t-rasmud).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155134

Files:
  clang/docs/tools/dump_ast_matchers.py


Index: clang/docs/tools/dump_ast_matchers.py
===================================================================
--- clang/docs/tools/dump_ast_matchers.py
+++ clang/docs/tools/dump_ast_matchers.py
@@ -15,7 +15,8 @@
 try:
     CLASS_INDEX_PAGE = urlopen(CLASS_INDEX_PAGE_URL).read().decode("utf-8")
 except Exception as e:
-    raise Exception("Unable to get %s: %s" % (CLASS_INDEX_PAGE_URL, e))
+    CLASS_INDEX_PAGE = None
+    print("Unable to get %s: %s" % (CLASS_INDEX_PAGE_URL, e))
 
 MATCHERS_FILE = "../../include/clang/ASTMatchers/ASTMatchers.h"
 
@@ -58,7 +59,10 @@
         url = "https://clang.llvm.org/doxygen/classclang_1_1%s.html" % name
         if url not in doxygen_probes:
             search_str = 'href="classclang_1_1%s.html"' % name
-            doxygen_probes[url] = search_str in CLASS_INDEX_PAGE
+            if CLASS_INDEX_PAGE is not None:
+                doxygen_probes[url] = search_str in CLASS_INDEX_PAGE
+            else:
+                doxygen_probes[url] = True
             if not doxygen_probes[url]:
                 print("Did not find %s in class index page" % name)
         if doxygen_probes[url]:
@@ -186,7 +190,7 @@
     """
     if declaration.strip():
 
-        if re.match(r"^\s?(#|namespace|using)", declaration):
+        if re.match(r"^\s?(#|namespace|using|template <typename NodeType> using|})", declaration):
             return
 
         # Node matchers are defined by writing:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155134.541762.patch
Type: text/x-patch
Size: 1437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230718/ed355a23/attachment.bin>


More information about the cfe-commits mailing list