-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] added yaml_combined files, frontend for new headergen #96833
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
Conversation
these are the yaml files that have combined functions from different libraries Rose will be adding the rest of the yaml in the next pr Missing assert.yaml -- work in progress
@llvm/pr-subscribers-libc Author: None (aaryanshukla) Changesfrontend hdrgen,these are the yaml files that have combined functions from different Patch is 105.41 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/96833.diff 14 Files Affected:
diff --git a/libc/newhdrgen/yaml_combined/ctype.yaml b/libc/newhdrgen/yaml_combined/ctype.yaml
new file mode 100644
index 0000000000000..74d2b6071c6d0
--- /dev/null
+++ b/libc/newhdrgen/yaml_combined/ctype.yaml
@@ -0,0 +1,137 @@
+header: ctype.h
+macros: []
+types: []
+enums: []
+objects: []
+functions:
+ - name: isalnum
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isalpha
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isblank
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: iscntrl
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isdigit
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isgraph
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: islower
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isprint
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: ispunct
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isspace
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isupper
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: isxdigit
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: tolower
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: toupper
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ functions:
+ - name: isascii
+ standards:
+ - POSIX
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: toascii
+ standards:
+ - GNUExtensions
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+
+
diff --git a/libc/newhdrgen/yaml_combined/fenv.yaml b/libc/newhdrgen/yaml_combined/fenv.yaml
new file mode 100644
index 0000000000000..a191723e8a003
--- /dev/null
+++ b/libc/newhdrgen/yaml_combined/fenv.yaml
@@ -0,0 +1,135 @@
+header: fenv.h
+macros: []
+types:
+ - type_name: fenv_t
+ - type_name: fexcept_t
+enums: []
+objects: []
+functions:
+ - name: feclearexcept
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: fetestexcept
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: fetestexceptflag
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: const fexcept_t *
+ - type: int
+ guard: null
+ attributes: []
+ - name: feraiseexcept
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: fesetround
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: fegetround
+ standards:
+ - stdc
+ return_type: int
+ arguments: []
+ guard: null
+ attributes: []
+ - name: fegetenv
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: fenv_t *
+ guard: null
+ attributes: []
+ - name: fesetenv
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: const fenv_t *
+ guard: null
+ attributes: []
+ - name: fegetexceptflag
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: fexcept_t *
+ - type: int
+ guard: null
+ attributes: []
+ - name: fesetexcept
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ attributes: []
+ - name: fesetexceptflag
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: const fexcept_t *
+ - type: int
+ guard: null
+ attributes: []
+ - name: feholdexcept
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: fenv_t *
+ guard: null
+ attributes: []
+ - name: feupdateenv
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: const fenv_t *
+ guard: null
+ attributes: []
+ - name: fedisableexcept
+ standards:
+ - GNUExtensions
+ return_type: int
+ arguments:
+ - type: int
+ guard: null
+ - name: feenableexcept
+ standards:
+ - GNUExtensions
+ return_type: int
+ arguments:
+ - type: int
+ attributes: []
+ - name: fegetexcept
+ standards:
+ - GNUExtensions
+ return_type: int
+ arguments: []
+ guard: null
+ attributes: []
diff --git a/libc/newhdrgen/yaml_combined/math.yaml b/libc/newhdrgen/yaml_combined/math.yaml
new file mode 100644
index 0000000000000..cbd66ab9c02d3
--- /dev/null
+++ b/libc/newhdrgen/yaml_combined/math.yaml
@@ -0,0 +1,2331 @@
+header: math.h
+macros: []
+types:
+ - type_name: float_t
+ - type_name: double_t
+ - type_name: float128
+enums: []
+objects: []
+functions:
+ - name: copysign
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: copysignf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: copysignl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: copysignf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: copysignf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: ceil
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ guard: null
+ attributes: []
+ - name: ceilf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ guard: null
+ attributes: []
+ - name: ceill
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ guard: null
+ attributes: []
+ - name: ceilf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: ceilf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fabs
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ attributes:
+ - __LIBC_CONST_ATTR
+ guard: null
+ - name: fabsf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ guard: null
+ attributes: []
+ - name: fabsl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fabsf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fabsf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fdim
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fdimf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fdiml
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fdimf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fdimf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: floor
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ guard: null
+ attributes: []
+ - name: floorf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ guard: null
+ attributes: []
+ - name: floorl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ guard: null
+ attributes: []
+ - name: floorf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: floorf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fmin
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fminf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fminl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fminf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fminf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: null
+ attributes: []
+ - name: fmax
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fmaxf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fmaxl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fmaxf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fmaxf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: null
+ attributes: []
+ - name: fmaximum
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fmaximumf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fmaximuml
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fmaximumf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fmaximumf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fmaximum_num
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fmaximum_numf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fmaximum_numl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fmaximum_numf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fmaximum_numf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fmaximum_mag
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fmaximum_magf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fmaximum_magl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fmaximum_magf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fmaximum_magf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fmaximum_mag_num
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fmaximum_mag_numf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fmaximum_mag_numl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fmaximum_mag_numf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fmaximum_mag_numf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fminimum
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fminimumf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fminimuml
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fminimumf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fminimumf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fminimum_num
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fminimum_numf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fminimum_numl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fminimum_numf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fminimum_numf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fminimum_mag
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fminimum_magf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fminimum_magl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fminimum_magf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fminimum_magf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fminimum_mag_num
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fminimum_mag_numf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fminimum_mag_numl
+ standards:
+ - stdc
+ return_type: long double
+ arguments:
+ - type: long double
+ - type: long double
+ guard: null
+ attributes: []
+ - name: fminimum_mag_numf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fminimum_mag_numf128
+ standards:
+ - stdc
+ return_type: float128
+ arguments:
+ - type: float128
+ - type: float128
+ guard: LIBC_TYPES_HAS_FLOAT128
+ attributes: []
+ - name: fma
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fmaf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: f16fmaf
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: float
+ - type: float
+ - type: float
+ guard: LIBC_TYPES_HAS_FLOAT16
+ attributes: []
+ - name: fmod
+ standards:
+ - stdc
+ return_type: double
+ arguments:
+ - type: double
+ - type: double
+ guard: null
+ attributes: []
+ - name: fmodf
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
+ - type: float
+ guard: null
+ attributes: []
+ - name: fmodl
+ ...
[truncated]
|
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 as an initial set
- reduced boilerplate and changed script to update - updated function.py to handle guard/attributes as none
✅ With the latest revision this PR passed the Python code formatter. |
-attributes is being appended to the result, so if empty we need to use an empty list, else error - isinstance used in arguments in the case arguments is []
- type: void * | ||
guard: null | ||
attributes: | ||
- noreturn |
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.
this should go in return_type as __Noreturn void (spec.td file says to treat noreturn as a type)
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.
fixed!
These are the yaml files that have combined functions from different libraries
Rose will be adding the rest of the yaml in the next pr
Missing assert.yaml -- work in progress