diff options
Diffstat (limited to 'libc/utils/docgen/header.py')
| -rw-r--r-- | libc/utils/docgen/header.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libc/utils/docgen/header.py b/libc/utils/docgen/header.py index dde210078db2..5bf524a64b69 100644 --- a/libc/utils/docgen/header.py +++ b/libc/utils/docgen/header.py @@ -14,7 +14,7 @@ class Header: Maintains implementation information about a standard header file: * where does its implementation dir live * where is its macros file - * where is its docgen json file + * where is its docgen yaml file By convention, the macro-only part of a header file is in a header-specific file somewhere in the directory tree with root at @@ -42,7 +42,7 @@ class Header: self.stem = header_name.rstrip(".h") self.docgen_root = Path(__file__).parent self.libc_root = self.docgen_root.parent.parent - self.docgen_json = self.docgen_root / Path(header_name).with_suffix(".json") + self.docgen_yaml = self.docgen_root / Path(header_name).with_suffix(".yaml") self.fns_dir = Path(self.libc_root, "src", self.stem) self.macros_dir = Path(self.libc_root, "include", "llvm-libc-macros") @@ -83,5 +83,10 @@ class Header: macro file might be located in a subdirectory: libc/include/llvm-libc-macros/fcntl-macros.h libc/include/llvm-libc-macros/linux/fcntl-macros.h + + When a header would be nested in a dir (such as arpa/, sys/, etc) we + instead use a hyphen in the name. + libc/include/llvm-libc-macros/sys-mman-macros.h """ - return self.macros_dir.glob(f"**/{self.stem}-macros.h") + stem = self.stem.replace("/", "-") + return self.macros_dir.glob(f"**/{stem}-macros.h") |
