Add missing format for built-in floating-point types

Many callers of init_float_type and arch_float_type still pass a NULL
floatformat.  This commit changes those callers where the floatformat
that is supposed to be use is obvious.  There are two categories where
this is the case:

- A number of built-in types are intended to match the platform ABI
  floating-point types (i.e. types that use gdbarch_float_bit etc.).
  Those places should use the platform ABI floating-point formats
  defined via gdbarch_float_format etc.

- A number of language built-in types should simply use IEEE floating-
  point formats, since the language actually defines that this is the
  format that must be used to implement floating-point types for this
  language.  (This affects Java, Go, and Rust.)  The same applies for
  to the predefined "RS/6000" stabs floating-point built-in types.

gdb/ChangeLog:

	* ada-lang.c (ada_language_arch_info): Use gdbarch-provided
	platform ABI floating-point formats for built-in types.
	* d-lang.c (build_d_types): Likewise.
	* f-lang.c (build_fortran_types): Likewise.
	* m2-lang.c (build_m2_types): Likewise.
	* mdebugread.c (basic_type): Likewise.

	* go-lang.c (build_go_types): Use IEEE floating-point formats
	for language built-in types as mandanted by the language.
	* jv-lang.c (build_java_types): Likewise.
	* rust-lang.c (rust_language_arch_info): Likewise.
	* stabsread.c (rs6000_builtin_type): Likewise.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
This commit is contained in:
Ulrich Weigand
2016-09-06 17:31:03 +02:00
parent c413c44801
commit 49f190bcb7
10 changed files with 49 additions and 26 deletions

View File

@ -2133,17 +2133,20 @@ rs6000_builtin_type (int typenum, struct objfile *objfile)
break;
case 12:
/* IEEE single precision (32 bit). */
rettype = init_float_type (objfile, 32, "float", NULL);
rettype = init_float_type (objfile, 32, "float",
floatformats_ieee_single);
break;
case 13:
/* IEEE double precision (64 bit). */
rettype = init_float_type (objfile, 64, "double", NULL);
rettype = init_float_type (objfile, 64, "double",
floatformats_ieee_double);
break;
case 14:
/* This is an IEEE double on the RS/6000, and different machines with
different sizes for "long double" should use different negative
type numbers. See stabs.texinfo. */
rettype = init_float_type (objfile, 64, "long double", NULL);
rettype = init_float_type (objfile, 64, "long double",
floatformats_ieee_double);
break;
case 15:
rettype = init_integer_type (objfile, 32, 0, "integer");
@ -2152,10 +2155,12 @@ rs6000_builtin_type (int typenum, struct objfile *objfile)
rettype = init_boolean_type (objfile, 32, 1, "boolean");
break;
case 17:
rettype = init_float_type (objfile, 32, "short real", NULL);
rettype = init_float_type (objfile, 32, "short real",
floatformats_ieee_single);
break;
case 18:
rettype = init_float_type (objfile, 64, "real", NULL);
rettype = init_float_type (objfile, 64, "real",
floatformats_ieee_double);
break;
case 19:
rettype = init_type (objfile, TYPE_CODE_ERROR, 0, "stringptr");