Move type_byte_order earlier
authorTom Tromey <tromey@adacore.com>
Mon, 25 Nov 2019 18:14:50 +0000 (11:14 -0700)
committerTom Tromey <tromey@adacore.com>
Wed, 4 Dec 2019 16:31:18 +0000 (09:31 -0700)
I failed to notice that the scalar_storage_order patch put
type_byte_order at the end of gdbtypes.c.  The end of the file is
normally where the file's _initialize function goes.  This moves
type_byte_order earlier, into a more relevant section.

gdb/ChangeLog
2019-12-04  Tom Tromey  <tromey@adacore.com>

* gdbtypes.c (type_byte_order): Move earlier.  Assert for unknown
endian-ness.

Change-Id: I4666431ecbb32ec98918f39f72d22c86b2bc8dde

gdb/ChangeLog
gdb/gdbtypes.c

index ffae6086301e8ddbed07d37556a508a70ea52a90..af3962160e5ec9403d4c01b9ab4a0a681c9c0f6b 100644 (file)
@@ -1,3 +1,8 @@
+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)
index 06096344b4afc3a6e94c17594e13c3b663e9d013..737ebfecc55875d6215cd7061078e354b7901c20 100644 (file)
@@ -3423,6 +3423,26 @@ is_unique_ancestor (struct type *base, struct value *val)
                                    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.  */
 
@@ -5701,21 +5721,3 @@ _initialize_gdbtypes (void)
                           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;
-}
This page took 0.032003 seconds and 4 git commands to generate.