Remove register_gdbarch_init
[binutils-gdb.git] / gdb / nds32-tdep.c
index 06b129bdd313af3dda3f675e5b949f3f3444821e..5b555236d46302c59a7232ccdbf4c67d6bf4a6a4 100644 (file)
@@ -289,7 +289,7 @@ typedef BP_MANIPULATION (nds32_break_insn) nds32_breakpoint;
 static int
 nds32_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int num)
 {
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   const int FSR = 38;
   const int FDR = FSR + 32;
 
@@ -390,7 +390,7 @@ nds32_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
   /* The NDS32 reggroup contains registers whose name is prefixed
      by reggroup name.  */
   reg_name = gdbarch_register_name (gdbarch, regnum);
-  group_name = reggroup_name (reggroup);
+  group_name = reggroup->name ();
   return !strncmp (reg_name, group_name, strlen (group_name));
 }
 \f
@@ -432,7 +432,7 @@ nds32_pseudo_register_read (struct gdbarch *gdbarch,
                            readable_regcache *regcache, int regnum,
                            gdb_byte *buf)
 {
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   gdb_byte reg_buf[8];
   int offset, fdr_regnum;
   enum register_status status;
@@ -471,7 +471,7 @@ nds32_pseudo_register_write (struct gdbarch *gdbarch,
                             struct regcache *regcache, int regnum,
                             const gdb_byte *buf)
 {
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   gdb_byte reg_buf[8];
   int offset, fdr_regnum;
 
@@ -608,7 +608,7 @@ static CORE_ADDR
 nds32_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
                        CORE_ADDR limit_pc, struct nds32_frame_cache *cache)
 {
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
   /* Current scanning status.  */
   int in_prologue_bb = 0;
@@ -1169,7 +1169,7 @@ static int
 nds32_analyze_epilogue (struct gdbarch *gdbarch, CORE_ADDR pc,
                        struct nds32_frame_cache *cache)
 {
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
   CORE_ADDR limit_pc;
   uint32_t insn, insn_len;
@@ -1220,7 +1220,7 @@ nds32_analyze_epilogue (struct gdbarch *gdbarch, CORE_ADDR pc,
 static int
 nds32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
   int insn_type = INSN_NORMAL;
   int ret_found = 0;
@@ -1424,7 +1424,7 @@ nds32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   int i;
   ULONGEST regval;
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   struct type *func_type = value_type (function);
   int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
   int abi_split = nds32_abi_split (tdep->elf_abi);
@@ -1652,7 +1652,7 @@ nds32_extract_return_value (struct gdbarch *gdbarch, struct type *type,
                            struct regcache *regcache, gdb_byte *valbuf)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
   int calling_use_fpr;
   int len;
@@ -1742,7 +1742,7 @@ nds32_store_return_value (struct gdbarch *gdbarch, struct type *type,
                          struct regcache *regcache, const gdb_byte *valbuf)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  nds32_gdbarch_tdep *tdep = (nds32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
   int abi_use_fpr = nds32_abi_use_fpr (tdep->elf_abi);
   int calling_use_fpr;
   int len;
@@ -1965,7 +1965,7 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        best_arch = gdbarch_list_lookup_by_info (best_arch->next, &info))
     {
       nds32_gdbarch_tdep *idep
-       = (nds32_gdbarch_tdep *) gdbarch_tdep (best_arch->gdbarch);
+       = gdbarch_tdep<nds32_gdbarch_tdep> (best_arch->gdbarch);
 
       if (idep->elf_abi != elf_abi)
        continue;
@@ -2093,7 +2093,7 @@ void
 _initialize_nds32_tdep ()
 {
   /* Initialize gdbarch.  */
-  register_gdbarch_init (bfd_arch_nds32, nds32_gdbarch_init);
+  gdbarch_register (bfd_arch_nds32, nds32_gdbarch_init);
 
   initialize_tdesc_nds32 ();
   nds32_init_reggroups ();