[libc-commits] [libc] [libc] implemented add_function to yaml hdrgen (PR #97079)

via libc-commits libc-commits at lists.llvm.org
Mon Jul 1 10:26:07 PDT 2024


================
@@ -103,16 +102,92 @@ def fill_public_api(header_str, h_def_content):
     return h_def_content.replace("%%public_api()", header_str, 1)
 
 
-def main(yaml_file, h_def_file, output_dir):
+def parse_function_details(details):
+    """
+    Parse function details from a list of strings and return a Function object.
+
+    Args:
+        details: A list containing function details
+
+    Returns:
+        Function: An instance of Function initialized with the details.
+    """
+    return_type, name, arguments, standards, guard, attributes = details
+    standards = standards.split(",") if standards != "null" else []
+    arguments = [arg.strip() for arg in arguments.split(",")]
+    attributes = attributes.split(",") if attributes != "null" else []
+
+    return Function(
+        name=name,
----------------
RoseZhang03 wrote:

Ordering here is different

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


More information about the libc-commits mailing list