This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] sh64-tdep: clean up unused variables.


This simply removes a bunch of gdbarch_tdep variables that are
initialized by a function call but never used.

2003-11-12  Michael Snyder  <msnyder@redhat.com>

	* sh64-tdep.c (translate_insn_rn, is_media_pseudo, 
	sh64_media_reg_base_num, sh64_compact_reg_base_num, 
	sh64_nofp_frame_init_saved_regs, sh64_push_arguments,
	sh64_extract_return_value, sh64_show_media_regs, 
	sh64_show_compact_regs, sh_sh64_register_byte, sh64_register_type, 
	sh_sh64_register_convert_to_virtual, sh_sh64_register_convert_to_raw,
	sh64_pseudo_register_read, sh64_pseudo_register_write, 
	sh64_do_pseudo_register, sh_compact_print_registers_info):
	Delete unused variable 'tdep'.

Index: sh64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh64-tdep.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -p -w -b -r1.13 -r1.14
*** sh64-tdep.c	12 Nov 2003 22:12:59 -0000	1.13
--- sh64-tdep.c	12 Nov 2003 22:45:41 -0000	1.14
*************** gdb_print_insn_sh (bfd_vma memaddr, disa
*** 706,713 ****
  static int 
  translate_insn_rn (int rn, int media_mode)
  {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- 
    /* FIXME: this assumes that the number rn is for a not pseudo
       register only.  */
    if (media_mode)
--- 706,711 ----
*************** fpp_reg_base_num (int fpp_regnum)
*** 829,838 ****
  static int
  is_media_pseudo (int rn)
  {
!   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
! 
!   return (rn >= DR0_REGNUM 
! 	  && rn <= FV_LAST_REGNUM);
  }
  
  static int
--- 827,833 ----
  static int
  is_media_pseudo (int rn)
  {
!   return (rn >= DR0_REGNUM && rn <= FV_LAST_REGNUM);
  }
  
  static int
*************** static int
*** 845,851 ****
  sh64_media_reg_base_num (int reg_nr)
  {
    int base_regnum = -1;
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    if (reg_nr >= DR0_REGNUM
        && reg_nr <= DR_LAST_REGNUM)
--- 840,845 ----
*************** static int
*** 928,934 ****
  sh64_compact_reg_base_num (int reg_nr)
  {
    int base_regnum = -1;
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    /* general register N maps to general register N */
    if (reg_nr >= R0_C_REGNUM 
--- 922,927 ----
*************** sh64_push_arguments (int nargs, struct v
*** 1496,1502 ****
    int len;
    int argreg_size;
    int fp_args[12];
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    memset (fp_args, 0, sizeof (fp_args));
  
--- 1490,1495 ----
*************** sh64_extract_return_value (struct type *
*** 1669,1675 ****
    int offset;
    int return_register;
    int len = TYPE_LENGTH (type);
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    
    if (TYPE_CODE (type) == TYPE_CODE_FLT)
      {
--- 1662,1667 ----
*************** static void
*** 1769,1775 ****
  sh64_show_media_regs (void)
  {
    int i;
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    printf_filtered ("PC=%s SR=%016llx \n",
  		   paddr (read_register (PC_REGNUM)),
--- 1761,1766 ----
*************** static void
*** 1808,1814 ****
  sh64_show_compact_regs (void)
  {
    int i;
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    printf_filtered ("PC=%s \n",
  		   paddr (read_register (PC_C_REGNUM)));
--- 1799,1804 ----
*************** static int
*** 1930,1936 ****
  sh_sh64_register_byte (int reg_nr)
  {
    int base_regnum = -1;
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    /* If it is a pseudo register, get the number of the first floating
       point register that is part of it.  */
--- 1920,1925 ----
*************** sh_sh64_build_float_register_type (int h
*** 2026,2033 ****
  static struct type *
  sh64_register_type (struct gdbarch *gdbarch, int reg_nr)
  {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- 
    if ((reg_nr >= FP0_REGNUM
         && reg_nr <= FP_LAST_REGNUM)
        || (reg_nr >= FP0_C_REGNUM
--- 2015,2020 ----
*************** static void
*** 2059,2066 ****
  sh_sh64_register_convert_to_virtual (int regnum, struct type *type,
  				     char *from, char *to)
  {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- 
    if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
      {
        /* It is a no-op.  */
--- 2046,2051 ----
*************** static void
*** 2086,2093 ****
  sh_sh64_register_convert_to_raw (struct type *type, int regnum,
  				 const void *from, void *to)
  {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- 
    if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
      {
        /* It is a no-op.  */
--- 2071,2076 ----
*************** sh64_pseudo_register_read (struct gdbarc
*** 2116,2122 ****
    int portion;
    int offset = 0;
    char temp_buffer[MAX_REGISTER_SIZE];
-   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
  
    if (reg_nr >= DR0_REGNUM 
        && reg_nr <= DR_LAST_REGNUM)
--- 2099,2104 ----
*************** sh64_pseudo_register_write (struct gdbar
*** 2285,2291 ****
    int base_regnum, portion;
    int offset;
    char temp_buffer[MAX_REGISTER_SIZE];
-   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
  
    if (reg_nr >= DR0_REGNUM
        && reg_nr <= DR_LAST_REGNUM)
--- 2267,2272 ----
*************** static void
*** 2600,2606 ****
  sh64_do_pseudo_register (int regnum)
  {
    /* All the sh64-compact mode registers are pseudo registers.  */
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    if (regnum < NUM_REGS 
        || regnum >= NUM_REGS + NUM_PSEUDO_REGS_SH_MEDIA + NUM_PSEUDO_REGS_SH_COMPACT)
--- 2581,2586 ----
*************** sh_print_registers_info (struct gdbarch 
*** 2735,2741 ****
  static void
  sh_compact_do_registers_info (int regnum, int fpregs)
  {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    if (regnum != -1)		/* do one specified register */
      {
        if (*(REGISTER_NAME (regnum)) == '\0')
--- 2715,2720 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]