-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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] newheadergen: created sys folder for yaml files, make appropriate updates to CMake file for sys folder #98693
Conversation
…ate updates to CMake file for sys folder Moved sys yaml files into the sys folder. After CMake patch lands, will make appropriate changes to account for yaml, header, and .h.def files that are located within the sys folder.
@llvm/pr-subscribers-libc Author: None (RoseZhang03) ChangesMoved sys yaml files into the sys folder. Full diff: https://github.com/llvm/llvm-project/pull/98693.diff 18 Files Affected:
diff --git a/libc/newhdrgen/yaml/sys_auxv.yaml b/libc/newhdrgen/yaml/sys/sys_auxv.yaml
similarity index 87%
rename from libc/newhdrgen/yaml/sys_auxv.yaml
rename to libc/newhdrgen/yaml/sys/sys_auxv.yaml
index bbf756a1ffe6a..072f63b36865c 100644
--- a/libc/newhdrgen/yaml/sys_auxv.yaml
+++ b/libc/newhdrgen/yaml/sys/sys_auxv.yaml
@@ -1,6 +1,4 @@
header: sys-auxv.h
-standards:
- - GNUExtensions
macros: []
types: []
enums: []
diff --git a/libc/newhdrgen/yaml/sys_epoll.yaml b/libc/newhdrgen/yaml/sys/sys_epoll.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_epoll.yaml
rename to libc/newhdrgen/yaml/sys/sys_epoll.yaml
diff --git a/libc/newhdrgen/yaml/sys_ioctl.yaml b/libc/newhdrgen/yaml/sys/sys_ioctl.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_ioctl.yaml
rename to libc/newhdrgen/yaml/sys/sys_ioctl.yaml
diff --git a/libc/newhdrgen/yaml/sys_mman.yaml b/libc/newhdrgen/yaml/sys/sys_mman.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_mman.yaml
rename to libc/newhdrgen/yaml/sys/sys_mman.yaml
diff --git a/libc/newhdrgen/yaml/sys_prctl.yaml b/libc/newhdrgen/yaml/sys/sys_prctl.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_prctl.yaml
rename to libc/newhdrgen/yaml/sys/sys_prctl.yaml
diff --git a/libc/newhdrgen/yaml/sys_random.yaml b/libc/newhdrgen/yaml/sys/sys_random.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_random.yaml
rename to libc/newhdrgen/yaml/sys/sys_random.yaml
diff --git a/libc/newhdrgen/yaml/sys_resource.yaml b/libc/newhdrgen/yaml/sys/sys_resource.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_resource.yaml
rename to libc/newhdrgen/yaml/sys/sys_resource.yaml
diff --git a/libc/newhdrgen/yaml/sys_select.yaml b/libc/newhdrgen/yaml/sys/sys_select.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_select.yaml
rename to libc/newhdrgen/yaml/sys/sys_select.yaml
diff --git a/libc/newhdrgen/yaml/sys_sendfile.yaml b/libc/newhdrgen/yaml/sys/sys_sendfile.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_sendfile.yaml
rename to libc/newhdrgen/yaml/sys/sys_sendfile.yaml
diff --git a/libc/newhdrgen/yaml/sys_socket.yaml b/libc/newhdrgen/yaml/sys/sys_socket.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_socket.yaml
rename to libc/newhdrgen/yaml/sys/sys_socket.yaml
diff --git a/libc/newhdrgen/yaml/sys_stat.yaml b/libc/newhdrgen/yaml/sys/sys_stat.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_stat.yaml
rename to libc/newhdrgen/yaml/sys/sys_stat.yaml
diff --git a/libc/newhdrgen/yaml/sys_statvfs.yaml b/libc/newhdrgen/yaml/sys/sys_statvfs.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_statvfs.yaml
rename to libc/newhdrgen/yaml/sys/sys_statvfs.yaml
diff --git a/libc/newhdrgen/yaml/sys_syscall.yaml b/libc/newhdrgen/yaml/sys/sys_syscall.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_syscall.yaml
rename to libc/newhdrgen/yaml/sys/sys_syscall.yaml
diff --git a/libc/newhdrgen/yaml/sys_time.yaml b/libc/newhdrgen/yaml/sys/sys_time.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_time.yaml
rename to libc/newhdrgen/yaml/sys/sys_time.yaml
diff --git a/libc/newhdrgen/yaml/sys_types.yaml b/libc/newhdrgen/yaml/sys/sys_types.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_types.yaml
rename to libc/newhdrgen/yaml/sys/sys_types.yaml
diff --git a/libc/newhdrgen/yaml/sys_utsname.yaml b/libc/newhdrgen/yaml/sys/sys_utsname.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_utsname.yaml
rename to libc/newhdrgen/yaml/sys/sys_utsname.yaml
diff --git a/libc/newhdrgen/yaml/sys_wait.yaml b/libc/newhdrgen/yaml/sys/sys_wait.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/sys_wait.yaml
rename to libc/newhdrgen/yaml/sys/sys_wait.yaml
diff --git a/libc/newhdrgen/yaml_to_classes.py b/libc/newhdrgen/yaml_to_classes.py
index 6bccda8e03640..4a5c4a0cd82eb 100644
--- a/libc/newhdrgen/yaml_to_classes.py
+++ b/libc/newhdrgen/yaml_to_classes.py
@@ -232,6 +232,13 @@ def main(yaml_file, h_def_file, output_dir, add_function=None):
output_file_name = Path(h_def_file).stem
output_file_path = Path(output_dir) / output_file_name
+ # with open(yaml_file, "r") as f:
+ # yaml_data = yaml.safe_load(f)
+
+ # header_name = yaml_data[header]
+ # if len(header_name) >= 6 and header_name[0:4] == "sys-":
+ # output_file_path = Path(output_dir) / sys / output_file_name
+
with open(output_file_path, "w") as f:
f.write(final_header_content)
|
libc/newhdrgen/yaml_to_classes.py
Outdated
@@ -232,6 +232,15 @@ def main(yaml_file, h_def_file, output_dir, add_function=None): | |||
output_file_name = Path(h_def_file).stem | |||
output_file_path = Path(output_dir) / output_file_name | |||
|
|||
# with open(yaml_file, "r") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you mean to leave this in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a placeholder for now while I wait for the CMake to come out. I'm not sure if I can manually add sys to the file path here or if I will have to make an alternate path in the CMake file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case I'd say it's probably best to leave this out of this patch. Commented out code is often confusing when reading a file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, feel free to land after addressing comments
libc/newhdrgen/yaml_to_classes.py
Outdated
@@ -232,6 +232,15 @@ def main(yaml_file, h_def_file, output_dir, add_function=None): | |||
output_file_name = Path(h_def_file).stem | |||
output_file_path = Path(output_dir) / output_file_name | |||
|
|||
# with open(yaml_file, "r") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case I'd say it's probably best to leave this out of this patch. Commented out code is often confusing when reading a file
…ate updates to CMake file for sys folder (llvm#98693) Moved sys yaml files into the sys folder. After CMake patch lands, will make appropriate changes to account for yaml, header, and .h.def files that are located within the sys folder in a separate patch.
…ate updates to CMake file for sys folder (llvm#98693) Moved sys yaml files into the sys folder. After CMake patch lands, will make appropriate changes to account for yaml, header, and .h.def files that are located within the sys folder in a separate patch.
Moved sys yaml files into the sys folder.
After CMake patch lands, will make appropriate changes to account for
yaml, header, and .h.def files that are located within the sys folder in a separate patch.