]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/mep-tdep.c
gdb: remove TYPE_LENGTH
[thirdparty/binutils-gdb.git] / gdb / mep-tdep.c
index 66b7656b3d5a78d08792cb7d74f407520e857ac6..555eb5e144f0564e711fdecd98c42d1cbe883c89 100644 (file)
@@ -1131,8 +1131,8 @@ mep_pseudo_cr32_read (struct gdbarch *gdbarch,
   int rawnum = mep_pseudo_to_raw[cookednum];
   gdb_byte buf64[8];
 
-  gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64));
-  gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4);
+  gdb_assert (register_type (gdbarch, rawnum)->length () == sizeof (buf64));
+  gdb_assert (register_type (gdbarch, cookednum)->length () == 4);
   status = regcache->raw_read (rawnum, buf64);
   if (status == REG_VALID)
     {
@@ -1217,8 +1217,8 @@ mep_pseudo_cr32_write (struct gdbarch *gdbarch,
   int rawnum = mep_pseudo_to_raw[cookednum];
   gdb_byte buf64[8];
   
-  gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64));
-  gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4);
+  gdb_assert (register_type (gdbarch, rawnum)->length () == sizeof (buf64));
+  gdb_assert (register_type (gdbarch, cookednum)->length () == 4);
   /* Slow, but legible.  */
   store_unsigned_integer (buf64, 8, byte_order,
                          extract_unsigned_integer (buf, 4, byte_order));
@@ -2075,7 +2075,7 @@ static const struct frame_unwind mep_frame_unwind = {
 static int
 mep_use_struct_convention (struct type *type)
 {
-  return (TYPE_LENGTH (type) > MEP_GPR_SIZE);
+  return (type->length () > MEP_GPR_SIZE);
 }
 
 
@@ -2094,15 +2094,15 @@ mep_extract_return_value (struct gdbarch *arch,
 
   /* Return values > MEP_GPR_SIZE bytes are returned in memory,
      pointed to by R0.  */
-  gdb_assert (TYPE_LENGTH (type) <= MEP_GPR_SIZE);
+  gdb_assert (type->length () <= MEP_GPR_SIZE);
 
   if (byte_order == BFD_ENDIAN_BIG)
-    offset = MEP_GPR_SIZE - TYPE_LENGTH (type);
+    offset = MEP_GPR_SIZE - type->length ();
   else
     offset = 0;
 
   /* Return values that do fit in a single register are returned in R0.  */
-  regcache->cooked_read_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type),
+  regcache->cooked_read_part (MEP_R0_REGNUM, offset, type->length (),
                              valbuf);
 }
 
@@ -2116,7 +2116,7 @@ mep_store_return_value (struct gdbarch *arch,
   int byte_order = gdbarch_byte_order (arch);
 
   /* Values that fit in a single register go in R0.  */
-  if (TYPE_LENGTH (type) <= MEP_GPR_SIZE)
+  if (type->length () <= MEP_GPR_SIZE)
     {
       /* Values that don't occupy a full register appear at the least
         significant end of the value.  This is the offset to where the
@@ -2124,11 +2124,11 @@ mep_store_return_value (struct gdbarch *arch,
       int offset;
 
       if (byte_order == BFD_ENDIAN_BIG)
-       offset = MEP_GPR_SIZE - TYPE_LENGTH (type);
+       offset = MEP_GPR_SIZE - type->length ();
       else
        offset = 0;
 
-      regcache->cooked_write_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type),
+      regcache->cooked_write_part (MEP_R0_REGNUM, offset, type->length (),
                                   valbuf);
     }
 
@@ -2156,7 +2156,7 @@ mep_return_value (struct gdbarch *gdbarch, struct value *function,
             returned in R0.  Fetch R0's value and then read the memory
             at that address.  */
          regcache_raw_read_unsigned (regcache, MEP_R0_REGNUM, &addr);
-         read_memory (addr, readbuf, TYPE_LENGTH (type));
+         read_memory (addr, readbuf, type->length ());
        }
       if (writebuf)
        {
@@ -2228,7 +2228,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv,
 
   for (i = 0; i < argc; i++)
     {
-      unsigned arg_len = TYPE_LENGTH (value_type (argv[i]));
+      unsigned arg_len = value_type (argv[i])->length ();
 
       if (arg_len > MEP_GPR_SIZE)
        {
@@ -2288,9 +2288,9 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       ULONGEST value;
 
       /* Arguments that fit in a GPR get expanded to fill the GPR.  */
-      if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE)
+      if (value_type (argv[i])->length () <= MEP_GPR_SIZE)
        value = extract_unsigned_integer (value_contents (argv[i]).data (),
-                                         TYPE_LENGTH (value_type (argv[i])),
+                                         value_type (argv[i])->length (),
                                          byte_order);
 
       /* Arguments too large to fit in a GPR get copied to the stack,