aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2016-09-06 17:27:55 +0200
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2016-09-06 17:27:55 +0200
commit19f392bc2a93d9e64d063b884cd6eca547c8dad0 (patch)
tree64968dc1b18a4cad8872489c2e9c39f5b5a7edcc /gdb/gdbtypes.h
parent88dfca6c43c11dea69db24cfb87e6821e63e29b2 (diff)
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>
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 579a34bc00..8b98237de8 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1672,8 +1672,21 @@ extern unsigned int type_length_units (struct type *type);
/* * Helper function to construct objfile-owned types. */
-extern struct type *init_type (enum type_code, int, int, const char *,
- struct objfile *);
+extern struct type *init_type (struct objfile *, enum type_code, int,
+ const char *);
+extern struct type *init_integer_type (struct objfile *, int, int,
+ const char *);
+extern struct type *init_character_type (struct objfile *, int, int,
+ const char *);
+extern struct type *init_boolean_type (struct objfile *, int, int,
+ const char *);
+extern struct type *init_float_type (struct objfile *, int, const char *,
+ const struct floatformat **);
+extern struct type *init_decfloat_type (struct objfile *, int, const char *);
+extern struct type *init_complex_type (struct objfile *, const char *,
+ struct type *);
+extern struct type *init_pointer_type (struct objfile *, int, const char *,
+ struct type *);
/* Helper functions to construct architecture-owned types. */
extern struct type *arch_type (struct gdbarch *, enum type_code, int,