================
@@ -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"<", "&lt;", text)
     text = re.sub(r">", "&gt;", 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&lt;<a href="%s">%s</a>&gt;' % (url, name)
-        else:
+        if name not in CLANG_CLASSES:
+            print("Did not find %s in clang headers" % name)
             return m.group(0)
+        url = "https://clang.llvm.org/doxygen/classclang_1_1%s.html"; % name
----------------
DeinAlptraum wrote:

Imo the URL should be turned into a named constant at the top of the file, like 
all the other "magic" values

https://github.com/llvm/llvm-project/pull/203784
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to