[libc-commits] [libc] [libc][docs] Fix docgen macro lookup for underscored headers (PR #194367)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Mon Apr 27 13:47:57 PDT 2026


================
@@ -112,5 +112,7 @@ def __get_macro_files(self) -> Generator[Path, None, None]:
         instead use a hyphen in the name.
         libc/include/llvm-libc-macros/sys-mman-macros.h
         """
-        stem = self.stem.replace("/", "-")
+        # Some POSIX headers use underscores in the header name but hyphens in
+        # the macro file name, e.g. nl_types.h -> nl-types-macros.h.
+        stem = self.stem.replace("/", "-").replace("_", "-")
----------------
michaelrj-google wrote:

in general I prefer the simplest solution. As a short term fix I think the PR only renaming nl_types is the best solution, then a followup PR to move all the relevant POSIX headers along with the docgen change would make sense.

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


More information about the libc-commits mailing list