+2019-12-04 Tom Tromey <tromey@adacore.com>
+
+ * gdbtypes.c (type_byte_order): Move earlier. Assert for unknown
+ endian-ness.
+
2019-12-04 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (dwarf2_init_float_type)
value_address (val), val) == 1;
}
+/* See gdbtypes.h. */
+
+enum bfd_endian
+type_byte_order (const struct type *type)
+{
+ bfd_endian byteorder = gdbarch_byte_order (get_type_arch (type));
+ if (TYPE_ENDIANITY_NOT_DEFAULT (type))
+ {
+ if (byteorder == BFD_ENDIAN_BIG)
+ return BFD_ENDIAN_LITTLE;
+ else
+ {
+ gdb_assert (byteorder == BFD_ENDIAN_LITTLE);
+ return BFD_ENDIAN_BIG;
+ }
+ }
+
+ return byteorder;
+}
+
\f
/* Overload resolution. */
show_strict_type_checking,
&setchecklist, &showchecklist);
}
-
-/* See gdbtypes.h. */
-enum bfd_endian
-type_byte_order (const struct type *type)
-{
- bfd_endian byteorder = gdbarch_byte_order (get_type_arch (type));
- if (TYPE_ENDIANITY_NOT_DEFAULT (type))
- {
- if (byteorder == BFD_ENDIAN_BIG)
- return BFD_ENDIAN_LITTLE;
- else if (byteorder == BFD_ENDIAN_LITTLE)
- return BFD_ENDIAN_BIG;
- else
- return BFD_ENDIAN_UNKNOWN;
- }
-
- return byteorder;
-}