[libc-commits] [libc] [libc] added newhdrgen python script and class file (PR #96671)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Tue Jun 25 13:03:49 PDT 2024
================
@@ -0,0 +1,142 @@
+#!/usr/bin/env python
+#
+# ====- Generate headers 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
+#
+# ==-------------------------------------------------------------------------==#
+import yaml
+import os
+import re
+import argparse
+
+from header import HeaderFile
+from class_implementation.classes.macro import Macro
+from class_implementation.classes.type import Type
+from class_implementation.classes.function import Function
+from class_implementation.classes.include import Include
+from class_implementation.classes.enums import Enumeration
+from class_implementation.classes.object import Object
+
+
+def yaml_to_classes(yaml_data):
+ """
+ Convert YAML data to header classes.
+
+ Args:
+ yaml_data: The YAML data containing header specifications.
+
+ Returns:
+ HeaderFile: An instance of HeaderFile populated with the data.
+ """
+ header_name = yaml_data.get("header", "unknown.h")
----------------
nickdesaulniers wrote:
unknown.h?
https://github.com/llvm/llvm-project/pull/96671
More information about the libc-commits
mailing list