[libc-commits] [libc] [libc] added newhdrgen class implementation (PR #96710)

via libc-commits libc-commits at lists.llvm.org
Wed Jun 26 10:11:18 PDT 2024


================
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+#
+# ====-- Function class for libc function headers -------------*- 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
+#
+# ==-------------------------------------------------------------------------==#
+
+
+class Function:
+    def __init__(
+        self, standards, return_type, name, arguments, guard=None, attributes=[]
+    ):
+        self.standard = standards
+        self.return_type = return_type
+        self.name = name
+        self.arguments = [arg["type"] for arg in arguments]
----------------
aaryanshukla wrote:

The way we use arguments in the Yaml file is carrying the parameter type so we can identify it as type in arguments. 
```
- name: call_once
    standard: stdc
    return_type: void
    arguments:
      - type: once_flag *
      - type: __call_once_func_
```

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


More information about the libc-commits mailing list