[libc-commits] [libc] [libc][docs] introduce docgen (PR #87682)

via libc-commits libc-commits at lists.llvm.org
Thu Apr 4 15:18:30 PDT 2024


================
@@ -0,0 +1,77 @@
+#!/usr/bin/env python
+#
+# ====- Generate documentation for libc functions  ------------*- python -*--==#
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+# ==-------------------------------------------------------------------------==#
+from argparse import ArgumentParser
+from pathlib import Path
+import sys
+import yaml
+
+
+def load_api():
+    p = Path(Path(__file__).resolve().parent, "api.yml")
+    api = p.read_text(encoding="utf-8")
+    return yaml.load(api, Loader=yaml.FullLoader)
+
+
+# TODO: we may need to get more sophisticated for less generic implementations.
+# Does libc/src/{hname minus .h suffix}/{fname}.cpp exist?
+def is_implemented(hname, fname):
----------------
overmighty wrote:

The last time I checked, type hints were ignored by CPython/the Python interpreter, and just used by language servers.

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


More information about the libc-commits mailing list