libgccjit: Add some reflection functions [PR96889]
authorAntoni Boucher <bouanto@zoho.com>
Sat, 20 Nov 2021 01:44:34 +0000 (20:44 -0500)
committerAntoni Boucher <bouanto@zoho.com>
Sat, 20 Nov 2021 01:45:12 +0000 (20:45 -0500)
commitcfe8dbd9c08a5bce497646467c9d30942ec3efe0
treecb2e214e560dfefffe386c811b5882b6db2ef651
parent9c0773984c8ec6dc1838f94177b4594b74650765
libgccjit: Add some reflection functions [PR96889]

2021-11-19  Antoni Boucher  <bouanto@zoho.com>

gcc/jit/
PR target/96889
* docs/topics/compatibility.rst (LIBGCCJIT_ABI_16): New ABI tag.
* docs/topics/functions.rst: Add documentation for the
functions gcc_jit_function_get_return_type and
gcc_jit_function_get_param_count
* docs/topics/types.rst: Add documentation for the functions
gcc_jit_function_type_get_return_type,
gcc_jit_function_type_get_param_count,
gcc_jit_function_type_get_param_type,
gcc_jit_type_unqualified, gcc_jit_type_dyncast_array,
gcc_jit_type_is_bool,
gcc_jit_type_dyncast_function_ptr_type,
gcc_jit_type_is_integral, gcc_jit_type_is_pointer,
gcc_jit_type_dyncast_vector,
gcc_jit_vector_type_get_element_type,
gcc_jit_vector_type_get_num_units,
gcc_jit_struct_get_field, gcc_jit_type_is_struct,
and gcc_jit_struct_get_field_count
* libgccjit.c:
(gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
gcc_jit_function_type_get_return_type,
gcc_jit_function_type_get_param_count,
gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
gcc_jit_vector_type_get_element_type,
gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
functions.
(struct gcc_jit_function_type, struct gcc_jit_vector_type):
New types.
* libgccjit.h:
(gcc_jit_function_get_return_type, gcc_jit_function_get_param_count,
gcc_jit_function_type_get_return_type,
gcc_jit_function_type_get_param_count,
gcc_jit_function_type_get_param_type, gcc_jit_type_unqualified,
gcc_jit_type_dyncast_array, gcc_jit_type_is_bool,
gcc_jit_type_dyncast_function_ptr_type, gcc_jit_type_is_integral,
gcc_jit_type_is_pointer, gcc_jit_type_dyncast_vector,
gcc_jit_vector_type_get_element_type,
gcc_jit_vector_type_get_num_units, gcc_jit_struct_get_field,
gcc_jit_type_is_struct, gcc_jit_struct_get_field_count): New
function declarations.
(struct gcc_jit_function_type, struct gcc_jit_vector_type):
New types.
* jit-recording.h: New functions (is_struct and is_vector)
* libgccjit.map (LIBGCCJIT_ABI_16): New ABI tag.

gcc/testsuite/
PR target/96889
* jit.dg/all-non-failing-tests.h: Add test-reflection.c.
* jit.dg/test-reflection.c: New test.
gcc/jit/docs/topics/compatibility.rst
gcc/jit/docs/topics/functions.rst
gcc/jit/docs/topics/types.rst
gcc/jit/jit-recording.h
gcc/jit/libgccjit.c
gcc/jit/libgccjit.h
gcc/jit/libgccjit.map
gcc/testsuite/jit.dg/all-non-failing-tests.h
gcc/testsuite/jit.dg/test-reflection.c [new file with mode: 0644]