gdb: remove target_gdbarch
[binutils-gdb.git] / gdb / bfin-tdep.c
index c681e6c01b5e6deda2a4c20481c153925c632dcb..4b9067a2d0f78f6e70bd43e152debb14b1e4c6a2 100644 (file)
@@ -509,7 +509,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
 
   for (i = nargs - 1; i >= 0; i--)
     {
-      struct type *value_type = value_enclosing_type (args[i]);
+      struct type *value_type = args[i]->enclosing_type ();
 
       total_len += align_up (value_type->length (), 4);
     }
@@ -525,12 +525,12 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
 
   for (i = nargs - 1; i >= 0; i--)
     {
-      struct type *value_type = value_enclosing_type (args[i]);
+      struct type *value_type = args[i]->enclosing_type ();
       struct type *arg_type = check_typedef (value_type);
       int container_len = align_up (arg_type->length (), 4);
 
       sp -= container_len;
-      write_memory (sp, value_contents (args[i]).data (), container_len);
+      write_memory (sp, args[i]->contents ().data (), container_len);
     }
 
   /* Initialize R0, R1, and R2 to the first 3 words of parameters.  */
@@ -778,7 +778,6 @@ bfin_abi (struct gdbarch *gdbarch)
 static struct gdbarch *
 bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
-  struct gdbarch *gdbarch;
   enum bfin_abi abi;
 
   abi = BFIN_ABI_FLAT;
@@ -798,8 +797,9 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       return arches->gdbarch;
     }
 
-  bfin_gdbarch_tdep *tdep = new bfin_gdbarch_tdep;
-  gdbarch = gdbarch_alloc (&info, tdep);
+  gdbarch *gdbarch
+    = gdbarch_alloc (&info, gdbarch_tdep_up (new bfin_gdbarch_tdep));
+  bfin_gdbarch_tdep *tdep = gdbarch_tdep<bfin_gdbarch_tdep> (gdbarch);
 
   tdep->bfin_abi = abi;