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] mips_push_arguments(): Save gdbarch_tdep result in local


I've just committed the change below.

This is an obvious and (at the moment) useless change.  I will be
submitting some other changes to mips_push_arguments() shortly which
reference ``tdep''.  This change will prevent mips_push_arguments()
from repeatedly fetching the tdep information during the course a
(single) call to mips_push_arguments().

I'm just trying to get the obvious stuff out of the way before submitting
the parts which need review...

	* mips-tdep.c (mips_push_arguments): Fetch gdbarch_tdep struct
	and save it in a local variable.  Use variable in later test.

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.83
diff -u -p -r1.83 mips-tdep.c
--- mips-tdep.c	31 Jul 2002 19:08:46 -0000	1.83
+++ mips-tdep.c	31 Jul 2002 20:01:13 -0000
@@ -2339,6 +2339,7 @@ mips_push_arguments (int nargs,
   int argnum;
   int len = 0;
   int stack_offset = 0;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
   /* Macros to round N up or down to the next A boundary; A must be
      a power of two. */
@@ -2515,7 +2516,7 @@ mips_push_arguments (int nargs,
 				  (len % MIPS_SAVED_REGSIZE != 0));
 	  /* Structures should be aligned to eight bytes (even arg registers)
 	     on MIPS_ABI_O32 if their first member has double precision. */
-	  if (gdbarch_tdep (current_gdbarch)->mips_abi == MIPS_ABI_O32
+	  if (tdep->mips_abi == MIPS_ABI_O32
 	      && mips_type_needs_double_align (arg_type))
 	    {
 	      if ((argreg & 1))


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