Unify init_type and arch_type interface and helpers
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 6 Sep 2016 15:27:55 +0000 (17:27 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 6 Sep 2016 15:27:55 +0000 (17:27 +0200)
commit19f392bc2a93d9e64d063b884cd6eca547c8dad0
tree64968dc1b18a4cad8872489c2e9c39f5b5a7edcc
parent88dfca6c43c11dea69db24cfb87e6821e63e29b2
Unify init_type and arch_type interface and helpers

This adds a number of helper routines for creating objfile-owned types;
these correspond 1:1 to the already existing helper routines for creating
gdbarch-owned types, and are intended to be used instead of init_type.
A shared fragment of init_float_type and arch_float_type is extracted into
a separate subroutine verify_subroutine.

The commit also brings the interface of init_type in line with the one for
arch_type.  In particular, this means removing the FLAGS argument; callers
now set the required flags directly.  (Since most callers use the new
helper routines, very few callers actually need to set any additional
flags directly any more.)

Note that this means all the TYPE_FLAGS_... defined are no longer needed
anywhere; they will be removed by a follow-on commit.

All users of init_type are changed to use on of the new helpers where
possible.  No functional change intended.

gdb/ChangeLog:

* gdbtypes.h (init_type): Remove FLAGS argument.  Move OBJFILE
argument to first position.
(init_integer_type): New prototype.
(init_character_type): Likewise.
(init_boolean_type): Likewise.
(init_float_type): Likewise.
(init_decfloat_type): Likewise.
(init_complex_type): Likewise.
(init_pointer_type): Likewise.
* gdbtypes.c (verify_floatflormat): New function.
(init_type): Remove FLAGS argument and processing.  Move OBJFILE
argument to first position.
(init_integer_type): New function.
(init_character_type): Likewise.
(init_boolean_type): Likewise.
(init_float_type): Likewise.
(init_decfloat_type): Likewise.
(init_complex_type): Likewise.
(init_pointer_type): Likewise.
(arch_float_type): Use verify_floatflormat.
(objfile_type): Use init_..._type helpers instead of calling
init_type directly.
* dwarf2read.c (fixup_go_packaging): Update to changed init_type
prototype.
(read_namespace_type): Likewise.
(read_module_type): Likewise.
(read_typedef): Likewise.
(read_unspecified_type): Likewise.
(build_error_marker_type): Likewise.
(read_base_type): Use init_..._type helpers.
* mdebugread.c (basic_type): Use init_..._type helpers.
(parse_type): Update to changed init_type prototype.
(cross_ref): Likewise.
* stabsread.c (rs6000_builtin_type): Use init_..._type helpers.
(read_sun_builtin_type): Likewise.
(read_sun_floating_type): Likewise.
(read_range_type): Likewise.  Also update to changed init_type
prototype.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
gdb/ChangeLog
gdb/dwarf2read.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/mdebugread.c
gdb/stabsread.c