[clang] [ASTMatchers][Docs] make dump_ast_matchers.py read classes from sources (PR #203784)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 25 06:06:34 PDT 2026
================
@@ -6,17 +6,27 @@
import collections
import re
import os
-from urllib.request import urlopen
+CURRENT_DIR = os.path.dirname(__file__)
-CLASS_INDEX_PAGE_URL = "https://clang.llvm.org/doxygen/classes.html"
-try:
- CLASS_INDEX_PAGE = urlopen(CLASS_INDEX_PAGE_URL).read().decode("utf-8")
-except Exception as e:
- CLASS_INDEX_PAGE = None
- print("Unable to get %s: %s" % (CLASS_INDEX_PAGE_URL, e))
-CURRENT_DIR = os.path.dirname(__file__)
+def _build_local_class_set():
+ """Return the set of class names declared in clang/include/clang/AST/"""
+ classes = set()
+ ast_dir = os.path.join(CURRENT_DIR, "../../include/clang/AST")
----------------
Endilll wrote:
Would be nice to switch to `pathlib`, now that you're touching all the usages of `os.path`.
https://github.com/llvm/llvm-project/pull/203784
More information about the cfe-commits
mailing list