This is the mail archive of the archer-commits@sourceware.org mailing list for the Archer 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]

[SCM] archer-keiths-expr-cumulative: Update w/accepted patches from upstream.


The branch, archer-keiths-expr-cumulative has been updated
       via  7de45a8852e8f4c9f2f29f9c7464314b13dec65a (commit)
      from  adcbbff07b63d96358e9e87c493f03ee9c3fa301 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 7de45a8852e8f4c9f2f29f9c7464314b13dec65a
Author: keiths <keiths@redhat.com>
Date:   Tue Nov 10 14:36:20 2009 -0800

    Update w/accepted patches from upstream.

-----------------------------------------------------------------------

Summary of changes:
 gdb/c-exp.y      |    9 ++-------
 gdb/eval.c       |   19 ++++++++-----------
 gdb/expression.h |    6 ++++--
 gdb/valops.c     |   23 ++++++++++++-----------
 4 files changed, 26 insertions(+), 31 deletions(-)

First 500 lines of diff:
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 5796de2..3511b8f 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -117,8 +117,6 @@ static int yylex (void);
 
 void yyerror (char *);
 
-/* Cleanup for 'nonempty_typelist' */
-static struct cleanup *typelist_cleanup;
 %}
 
 /* Although the yacc "value" of an expression is not used,
@@ -416,7 +414,7 @@ exp     :       exp '(' nonempty_typelist ')' const_or_volatile
 			    write_exp_elt_type ($<tvec>3[i + 1]);
 			  write_exp_elt_longcst((LONGEST) $<ivec>3[0]);
 			  write_exp_elt_opcode (TYPE_INSTANCE);
-			  do_cleanups (typelist_cleanup);
+			  free ($3);
 			}
 	;
 
@@ -949,7 +947,7 @@ array_mod:	'[' ']'
 func_mod:	'(' ')'
 			{ $$ = 0; }
 	|	'(' nonempty_typelist ')'
-			{ do_cleanups (typelist_cleanup); $$ = 0; }
+			{ free ($2); $$ = 0; }
 	;
 
 /* We used to try to recognize pointer to member types here, but
@@ -1154,15 +1152,12 @@ typename:	TYPENAME
 nonempty_typelist
 	:	type
 		{ $$ = (struct type **) malloc (sizeof (struct type *) * 2);
-		  typelist_cleanup = make_cleanup (free, $$);
 		  $<ivec>$[0] = 1;	/* Number of types in vector */
 		  $$[1] = $1;
 		}
 	|	nonempty_typelist ',' type
 		{ int len = sizeof (struct type *) * (++($<ivec>1[0]) + 1);
 		  $$ = (struct type **) realloc ((char *) $1, len);
-		  discard_cleanups (typelist_cleanup);
-		  typelist_cleanup = make_cleanup (free, $$);
 		  $$[$<ivec>$[0]] = $3;
 		}
 	;
diff --git a/gdb/eval.c b/gdb/eval.c
index 82b3cb6..725fa9c 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -653,15 +653,9 @@ ptrmath_type_p (struct type *type)
     }
 }
 
-/* Constructs a fake method with the given parameter types. */
-static void
-free_param_types (void *arg)
-{
-  struct type *type = (struct type *) arg;
-  xfree (TYPE_FIELDS (type));
-  xfree (TYPE_MAIN_TYPE (type));
-  xfree (type);
-}
+/* Constructs a fake method with the given parameter types.
+   This function is used by the parser to construct an "expected"
+   type for method overload resolution.  */
 
 static struct type *
 make_params (int num_types, struct type **param_types)
@@ -679,7 +673,6 @@ make_params (int num_types, struct type **param_types)
   while (num_types-- > 0)
     TYPE_FIELD_TYPE (type, num_types) = param_types[num_types];
 
-  make_cleanup (free_param_types, type);
   return type;
 }
 
@@ -1766,7 +1759,11 @@ evaluate_subexp_standard (struct type *expect_type,
 
       expect_type = make_params (nargs, arg_types);
       *(pos) += 3 + nargs;
-      return evaluate_subexp_standard (expect_type, exp, pos, noside);
+      arg1 = evaluate_subexp_standard (expect_type, exp, pos, noside);
+      xfree (TYPE_FIELDS (expect_type));
+      xfree (TYPE_MAIN_TYPE (expect_type));
+      xfree (expect_type);
+      return arg1;
 
     case TYPE_INSTANCE_LOOKUP:
       {
diff --git a/gdb/expression.h b/gdb/expression.h
index 471cb33..ff9cc77 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -89,8 +89,10 @@ enum exp_opcode
     STRUCTOP_MPTR,
 
     /* TYPE_INSTANCE is used when the user specifies a specific
-       type instantiation for overloaded methods/functions. The format
-       is: TYPE_INSTANCE num_types type0 ... typeN num_types TYPE_INSTANCE*/
+       type instantiation for overloaded methods/functions.
+
+       The format is:
+       TYPE_INSTANCE num_types type0 ... typeN num_types TYPE_INSTANCE  */
     TYPE_INSTANCE,
 
     /* TYPE_INSTANCE_LOOKUP is used when the user specifies a specific
diff --git a/gdb/valops.c b/gdb/valops.c
index 8cd9474..3ad54ec 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2833,13 +2833,14 @@ value_aggregate_elt (struct type *curtype, char *name,
 }
 
 /* Compares the two method/function types T1 and T2 for "equality" 
-   with respect to the the methods' parameters. If the types of the
-   two parameter lists are the same, returns 1; 0 otherwise. This
+   with respect to the the methods' parameters.  If the types of the
+   two parameter lists are the same, returns 1; 0 otherwise.  This
    comparison may ignore any artificial parameters in T1 if
-   SKIP_ARTIFICIAL is non-zero. This function will ALWAYS skip
+   SKIP_ARTIFICIAL is non-zero.  This function will ALWAYS skip
    the first artificial parameter in T1, assumed to be a 'this' pointer.
 
-   The type T2 is expected to have come from make_params (in eval.c). */
+   The type T2 is expected to have come from make_params (in eval.c).  */
+
 static int
 compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
 {
@@ -2859,8 +2860,8 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
 
   /* Now compare parameters */
 
-  /* Special case: a method taking void. T1 will contain no
-     non-artificial fields, and T2 will contain TYPE_CODE_VOID. */
+  /* Special case: a method taking void.  T1 will contain no
+     non-artificial fields, and T2 will contain TYPE_CODE_VOID.  */
   if ((TYPE_NFIELDS (t1) - start) == 0 && TYPE_NFIELDS (t2) == 1
       && TYPE_CODE (TYPE_FIELD_TYPE (t2, 0)) == TYPE_CODE_VOID)
     return 1;
@@ -2979,10 +2980,10 @@ value_struct_elt_for_reference (struct type *domain, int offset,
 	  else
 	    {
 	      int ii;
-	      /* Skip artificial methods. This is necessary if, for example,
+	      /* Skip artificial methods.  This is necessary if, for example,
 		 the user wants to "print subclass::subclass" with only
-		 one defined user constructor. There is no ambiguity in this
-		 case. */
+		 one user-defined constructor.  There is no ambiguity in this
+		 case.  */
 	      for (ii = 0; ii < TYPE_FN_FIELDLIST_LENGTH (t, i);
 		   ++ii)
 		{
@@ -2991,12 +2992,12 @@ value_struct_elt_for_reference (struct type *domain, int offset,
 		}
 
 	      /* Desired method is ambiguous if more than one method is
-		 defined. */
+		 defined.  */
 	      if (len > 1)
 		error (_("non-unique member `%s' requires type instantiation"), name);
 
 	      /* This assumes, of course, that all artificial methods appear
-		 BEFORE any concrete methods. */
+		 BEFORE any concrete methods.  */
 	      j = TYPE_FN_FIELDLIST_LENGTH (t, i) - 1;
 	    }
 


hooks/post-receive
--
Repository for Project Archer.


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