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.