[libc-commits] [libc] [libc] reordered Function class parameters and moved yaml files (PR #97329)

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (RoseZhang03)

<details>
<summary>Changes</summary>

Reordered Function class parameter "standards" to make more logical
sense and to match the ordering in the add_function function.
Deleted the yaml_combined folder and moved contained files to the yaml
folder.


---
Full diff: https://github.com/llvm/llvm-project/pull/97329.diff


16 Files Affected:

- (modified) libc/newhdrgen/class_implementation/classes/function.py (+2-2) 
- (renamed) libc/newhdrgen/yaml/ctype.yaml () 
- (renamed) libc/newhdrgen/yaml/fenv.yaml () 
- (renamed) libc/newhdrgen/yaml/math.yaml () 
- (renamed) libc/newhdrgen/yaml/pthread.yaml () 
- (renamed) libc/newhdrgen/yaml/sched.yaml () 
- (renamed) libc/newhdrgen/yaml/signal.yaml () 
- (renamed) libc/newhdrgen/yaml/stdfix.yaml () 
- (renamed) libc/newhdrgen/yaml/stdio.yaml () 
- (renamed) libc/newhdrgen/yaml/stdlib.yaml () 
- (renamed) libc/newhdrgen/yaml/string.yaml () 
- (renamed) libc/newhdrgen/yaml/strings.yaml () 
- (renamed) libc/newhdrgen/yaml/sys_mman.yaml () 
- (renamed) libc/newhdrgen/yaml/sys_wait.yaml () 
- (renamed) libc/newhdrgen/yaml/time.yaml () 
- (modified) libc/newhdrgen/yaml_to_classes.py (+1-1) 


``````````diff
diff --git a/libc/newhdrgen/class_implementation/classes/function.py b/libc/newhdrgen/class_implementation/classes/function.py
index 3c464e48b6e3b..27219bfd3f611 100644
--- a/libc/newhdrgen/class_implementation/classes/function.py
+++ b/libc/newhdrgen/class_implementation/classes/function.py
@@ -11,14 +11,14 @@
 
 class Function:
     def __init__(
-        self, standards, return_type, name, arguments, guard=None, attributes=[]
+        self, return_type, name, arguments, standards, guard=None, attributes=[]
     ):
-        self.standards = standards
         self.return_type = return_type
         self.name = name
         self.arguments = [
             arg if isinstance(arg, str) else arg["type"] for arg in arguments
         ]
+        self.standards = standards
         self.guard = guard
         self.attributes = attributes or []
 
diff --git a/libc/newhdrgen/yaml_combined/ctype.yaml b/libc/newhdrgen/yaml/ctype.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/ctype.yaml
rename to libc/newhdrgen/yaml/ctype.yaml
diff --git a/libc/newhdrgen/yaml_combined/fenv.yaml b/libc/newhdrgen/yaml/fenv.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/fenv.yaml
rename to libc/newhdrgen/yaml/fenv.yaml
diff --git a/libc/newhdrgen/yaml_combined/math.yaml b/libc/newhdrgen/yaml/math.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/math.yaml
rename to libc/newhdrgen/yaml/math.yaml
diff --git a/libc/newhdrgen/yaml_combined/pthread.yaml b/libc/newhdrgen/yaml/pthread.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/pthread.yaml
rename to libc/newhdrgen/yaml/pthread.yaml
diff --git a/libc/newhdrgen/yaml_combined/sched.yaml b/libc/newhdrgen/yaml/sched.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/sched.yaml
rename to libc/newhdrgen/yaml/sched.yaml
diff --git a/libc/newhdrgen/yaml_combined/signal.yaml b/libc/newhdrgen/yaml/signal.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/signal.yaml
rename to libc/newhdrgen/yaml/signal.yaml
diff --git a/libc/newhdrgen/yaml_combined/stdfix.yaml b/libc/newhdrgen/yaml/stdfix.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/stdfix.yaml
rename to libc/newhdrgen/yaml/stdfix.yaml
diff --git a/libc/newhdrgen/yaml_combined/stdio.yaml b/libc/newhdrgen/yaml/stdio.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/stdio.yaml
rename to libc/newhdrgen/yaml/stdio.yaml
diff --git a/libc/newhdrgen/yaml_combined/stdlib.yaml b/libc/newhdrgen/yaml/stdlib.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/stdlib.yaml
rename to libc/newhdrgen/yaml/stdlib.yaml
diff --git a/libc/newhdrgen/yaml_combined/string.yaml b/libc/newhdrgen/yaml/string.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/string.yaml
rename to libc/newhdrgen/yaml/string.yaml
diff --git a/libc/newhdrgen/yaml_combined/strings.yaml b/libc/newhdrgen/yaml/strings.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/strings.yaml
rename to libc/newhdrgen/yaml/strings.yaml
diff --git a/libc/newhdrgen/yaml_combined/sys_mman.yaml b/libc/newhdrgen/yaml/sys_mman.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/sys_mman.yaml
rename to libc/newhdrgen/yaml/sys_mman.yaml
diff --git a/libc/newhdrgen/yaml_combined/sys_wait.yaml b/libc/newhdrgen/yaml/sys_wait.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/sys_wait.yaml
rename to libc/newhdrgen/yaml/sys_wait.yaml
diff --git a/libc/newhdrgen/yaml_combined/time.yaml b/libc/newhdrgen/yaml/time.yaml
similarity index 100%
rename from libc/newhdrgen/yaml_combined/time.yaml
rename to libc/newhdrgen/yaml/time.yaml
diff --git a/libc/newhdrgen/yaml_to_classes.py b/libc/newhdrgen/yaml_to_classes.py
index 7159dd9cc8881..8ca09267dbb3d 100644
--- a/libc/newhdrgen/yaml_to_classes.py
+++ b/libc/newhdrgen/yaml_to_classes.py
@@ -54,10 +54,10 @@ def yaml_to_classes(yaml_data):
         standards = (function_data.get("standards", None),)
         header.add_function(
             Function(
-                standards,
                 function_data["return_type"],
                 function_data["name"],
                 arguments,
+                standards,
                 guard,
                 attributes,
             )

``````````

</details>


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


More information about the libc-commits mailing list