Simplify floatformat_from_type
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 27 Sep 2017 17:03:36 +0000 (19:03 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 27 Sep 2017 17:03:36 +0000 (19:03 +0200)
commit0db7851f9f490f0b60689df5a218ccce60896e3d
treeccce381147799faf5e545b0364d041898a603605
parent77b7c781e9f03cdd903dad76f47ea0bb25277b06
Simplify floatformat_from_type

For historical reasons, the TYPE_FLOATFORMAT element is still set to hold
an array of two floatformat structs, one for big-endian and the other for
little-endian.  When accessing the element via floatformat_from_type,
the code would check the type's byte order and return the appropriate
floatformat.

However, these days this is quite unnecessary, since the type's byte order
is already known at the time the type is allocated and the floatformat is
installed into TYPE_FLOATFORMAT.  Therefore, we can just install the correct
version here.

Also, moves the (now trivially simple) floatformat_from_type accessor to
gdbtypes.{c,h}, since it doesn't really need to be in doublest.c now.

gdb/ChangeLog
2017-09-27  Ulrich Weigand  <uweigand@de.ibm.com>

* doublest.h (floatformat_from_type): Move to gdbtypes.h.
* doublest.c (floatformat_from_type): Move to gdbtypes.c.

* gdbtypes.h (union type_specific): Make field floatformat hold
just a single struct floatformat, not an array.
(floatformat_from_type): Move here.
* gdbtypes.c (floatformat_from_type): Move here.  Update to
changed TYPE_FLOATFORMAT definition.
(verify_floatformat): Update to changed TYPE_FLOATFORMAT.
(recursive_dump_type): Likewise.
(init_float_type): Install correct floatformat for byte order.
(arch_float_type): Likewise.
gdb/ChangeLog
gdb/doublest.c
gdb/doublest.h
gdb/gdbtypes.c
gdb/gdbtypes.h
This page took 0.024976 seconds and 4 git commands to generate.