Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] reordered Function class parameters and moved yaml files #97329

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

RoseZhang03
Copy link
Contributor

@RoseZhang03 RoseZhang03 commented Jul 1, 2024

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.
Updated math.yaml file with the recently added math functions in spec.td

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.
@llvmbot llvmbot added the libc label Jul 1, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 1, 2024

@llvm/pr-subscribers-libc

Author: None (RoseZhang03)

Changes

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 --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,
             )

@aaryanshukla
Copy link
Contributor

LGTM!

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RoseZhang03 RoseZhang03 merged commit 4a1fdeb into llvm:main Jul 3, 2024
3 of 5 checks passed
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
…#97329)

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.
Updated math.yaml file with the recently added math functions in spec.td
@RoseZhang03 RoseZhang03 deleted the rosezhang9 branch July 10, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants