aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-types.c
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-03-18 12:37:52 +0000
committerNick Alcock <nick.alcock@oracle.com>2021-03-18 12:40:40 +0000
commit81982d20fac4ae6981097a2d609093e8698fd179 (patch)
tree62ce36d903e94cac575d47cd5dc2aa172f59f5f5 /libctf/ctf-types.c
parent534444b1ee161f342d303fd6549310963ce233c9 (diff)
downloadgdb-81982d20fac4ae6981097a2d609093e8698fd179.zip
gdb-81982d20fac4ae6981097a2d609093e8698fd179.tar.gz
gdb-81982d20fac4ae6981097a2d609093e8698fd179.tar.bz2
libctf: eliminate dtd_u, part 3: functions
One more member vanishes from the dtd_u, leaving only the member for struct/union/enum members. There's not much to do here, since as of commit afd78bd6f0a30ba5 we use the same representation (type sizes, etc) in the dtu_argv as we will use in the final vlen, with one exception: the vlen has alignment padding, and the dtu_argv did not. Simplify things by adding suitable padding in both cases. libctf/ChangeLog 2021-03-18 Nick Alcock <nick.alcock@oracle.com> * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove. * ctf-create.c (ctf_dtd_delete): No longer free it. (ctf_add_function): Use the dtd_vlen, not dtu_argv. Properly align. * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen. * ctf-types.c (ctf_func_type_info): Just use the vlen. (ctf_func_type_args): Likewise.
Diffstat (limited to 'libctf/ctf-types.c')
-rw-r--r--libctf/ctf-types.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libctf/ctf-types.c b/libctf/ctf-types.c
index 8c983d5..1e1ce8e 100644
--- a/libctf/ctf-types.c
+++ b/libctf/ctf-types.c
@@ -1678,7 +1678,7 @@ ctf_func_type_info (ctf_dict_t *fp, ctf_id_t type, ctf_funcinfo_t *fip)
if ((dtd = ctf_dynamic_type (fp, type)) == NULL)
args = (uint32_t *) ((uintptr_t) tp + increment);
else
- args = dtd->dtd_u.dtu_argv;
+ args = (uint32_t *) dtd->dtd_vlen;
if (fip->ctc_argc != 0 && args[fip->ctc_argc - 1] == 0)
{
@@ -1715,7 +1715,7 @@ ctf_func_type_args (ctf_dict_t *fp, ctf_id_t type, uint32_t argc, ctf_id_t *argv
if ((dtd = ctf_dynamic_type (fp, type)) == NULL)
args = (uint32_t *) ((uintptr_t) tp + increment);
else
- args = dtd->dtd_u.dtu_argv;
+ args = (uint32_t *) dtd->dtd_vlen;
for (argc = MIN (argc, f.ctc_argc); argc != 0; argc--)
*argv++ = *args++;