Reorganize code to handle TYPE_CODE_{STRUCT,UNION} on 'c_type_print_base'
authorSergio Durigan Junior <sergiodj@redhat.com>
Mon, 11 Dec 2017 16:57:19 +0000 (11:57 -0500)
committerSergio Durigan Junior <sergiodj@redhat.com>
Fri, 15 Dec 2017 20:06:26 +0000 (15:06 -0500)
commita27ed7d613ec91c3a79965d6bdab1fa96d559c85
treefab9939e191a32287887e8fa528e5b108e9fc23a
parentfc076a47fd716ca75447d432251abc67a19ef908
Reorganize code to handle TYPE_CODE_{STRUCT,UNION} on 'c_type_print_base'

While doing the 'ptype /o' work, I noticed that 'c_type_print_base'
was very long, with a big amount of code just to handle the case of
TYPE_CODE_{STRUCT,UNION}.  This made working with the function a bit
difficult, specially because of the level of indentation.

This commit moves this part of the code to their own functions.  Now
we have a 'c_type_print_base_struct_union' with most of the code, and
also 'need_access_label_p', which is a subset of the code that was
also a good candidate for having its own function.

gdb/ChangeLog:
2017-12-15  Sergio Durigan Junior  <sergiodj@redhat.com>

* c-typeprint.c (need_access_label_p): New function.
(c_type_print_base_struct_union): New function.
(c_type_print_base): Move code to handle
TYPE_CODE_{STRUCT,UNION} to the functions mentioned above.
gdb/ChangeLog
gdb/c-typeprint.c