================
@@ -41,36 +51,23 @@
# pop-up. ids[name] keeps track of those ids.
ids = collections.defaultdict(int)
-# Cache for doxygen urls we have already verified.
-doxygen_probes = {}
-
-
def esc(text):
"""Escape any html in the given text."""
text = re.sub(r"&", "&", text)
text = re.sub(r"<", "<", text)
text = re.sub(r">", ">", text)
def link_if_exists(m):
- """Wrap a likely AST node name in a link to its clang docs.
+ """Wrap an AST node name in a link to its Doxygen page.
- We want to do this only if the page exists, in which case it will be
- referenced from the class index page.
+ Existence is determined by scanning local clang headers.
"""
name = m.group(1)
- 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
- 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]:
- return r'Matcher<<a href="%s">%s</a>>' % (url, name)
- else:
+ if name not in CLANG_CLASSES:
+ print("Did not find %s in clang headers" % name)
----------------
DeinAlptraum wrote:
We could also take this opportunity to replace the old modulo-operator string
formatting with one of the newer methods (`.format` or `f`-strings). Though tbf
there's a lot more of that all over this file so not necessary.
https://github.com/llvm/llvm-project/pull/203784
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits