]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2003-09-19 David Carlton <carlton@kealia.com>
authorDavid Carlton <carlton@bactrian.org>
Sat, 20 Sep 2003 00:32:31 +0000 (00:32 +0000)
committerDavid Carlton <carlton@bactrian.org>
Sat, 20 Sep 2003 00:32:31 +0000 (00:32 +0000)
* expression.h (enum exp_opcode): Revert to mainline's OP_FUNCALL,
OP_SCOPE.
* ada-exp.y, m2-exp.y, objc-exp.y, p-exp.y: Ditto.
* jv-exp.y (push_qualified_expression_name): Ditto.
* ada-lang.c (ada_resolve_subexp, replace_operator_with_call)
(ada_evaluate_subexp): Ditto.
* eval.c (evaluate_subexp_standard): Ditto.
* expprint.c (print_subexp, dump_subexp): Ditto.
* parse.c (length_of_subexp, prefixify_subexp): Ditto.
* c-exp.y: Ditto, and add comment.
* cp-support.c (make_symbol_overload_list): Delete 'block'
argument; change calls to make_symbol_overload_list_using
appropriately.
(make_symbol_overload_list_using): Delete 'block' argument;
replace it by get_selected_block (0).
* cp-support.h: Delete 'block' argument from
make_symbol_overload_list.
* valops.c (find_overload_match): Delete 'block' argument, and
update calls using it.
(find_oload_champ_namespace, find_oload_champ_namespace_loop)
(value_aggregate_elt, value_struct_elt_for_reference)
(value_namespace_elt): Ditto.
(value_maybe_namespace_elt): Delete 'block' argument, and use
get_selected_block (0) instead.
* value.h: Delete 'block' argument from value_struct_elt,
value_find_oload.

16 files changed:
gdb/ChangeLog
gdb/ada-exp.y
gdb/ada-lang.c
gdb/c-exp.y
gdb/cp-support.c
gdb/cp-support.h
gdb/eval.c
gdb/expprint.c
gdb/expression.h
gdb/jv-exp.y
gdb/m2-exp.y
gdb/objc-exp.y
gdb/p-exp.y
gdb/parse.c
gdb/valops.c
gdb/value.h

index 9c2c05197ce2d0aecda4ca70b93e0fd01e646c8c..6adec6fdf25dca778b1e68f9f36f517afa1d3388 100644 (file)
@@ -1,3 +1,32 @@
+2003-09-19  David Carlton  <carlton@kealia.com>
+
+       * expression.h (enum exp_opcode): Revert to mainline's OP_FUNCALL,
+       OP_SCOPE.
+       * ada-exp.y, m2-exp.y, objc-exp.y, p-exp.y: Ditto.
+       * jv-exp.y (push_qualified_expression_name): Ditto.
+       * ada-lang.c (ada_resolve_subexp, replace_operator_with_call)
+       (ada_evaluate_subexp): Ditto.
+       * eval.c (evaluate_subexp_standard): Ditto.
+       * expprint.c (print_subexp, dump_subexp): Ditto.
+       * parse.c (length_of_subexp, prefixify_subexp): Ditto.
+       * c-exp.y: Ditto, and add comment.
+       * cp-support.c (make_symbol_overload_list): Delete 'block'
+       argument; change calls to make_symbol_overload_list_using
+       appropriately.
+       (make_symbol_overload_list_using): Delete 'block' argument;
+       replace it by get_selected_block (0).
+       * cp-support.h: Delete 'block' argument from
+       make_symbol_overload_list.
+       * valops.c (find_overload_match): Delete 'block' argument, and
+       update calls using it.
+       (find_oload_champ_namespace, find_oload_champ_namespace_loop)
+       (value_aggregate_elt, value_struct_elt_for_reference)
+       (value_namespace_elt): Ditto.
+       (value_maybe_namespace_elt): Delete 'block' argument, and use
+       get_selected_block (0) instead.
+       * value.h: Delete 'block' argument from value_struct_elt,
+       value_find_oload.
+
 2003-09-17  David Carlton  <carlton@kealia.com>
 
        * Merge with mainline; tag is carlton_dictionary-20030917-merge.
index c82913d9ae1b150cd78b952651d5184d117b459d..8d9bc045b8ce2c12b55005c1d47162a4f6897456 100644 (file)
@@ -233,7 +233,6 @@ simple_exp :        simple_exp '(' arglist ')'
                        {
                          write_exp_elt_opcode (OP_FUNCALL);
                          write_exp_elt_longcst ($3);
-                         write_exp_elt_block (expression_context_block);
                          write_exp_elt_opcode (OP_FUNCALL);
                        }
        ;
@@ -903,7 +902,6 @@ write_object_renaming (orig_left_context, renaming)
          { 
            write_exp_elt_opcode (OP_FUNCALL);
            write_exp_elt_longcst ((LONGEST) 1);
-           write_exp_elt_block (expression_context_block);
            write_exp_elt_opcode (OP_FUNCALL);
          }
        else if (slice_state == LOWER_BOUND)
index fdeea165baf76525f1389278227cf00e9bca6f34..13d393db9e202d7c05403765f2002ca9b1011725 100644 (file)
@@ -1974,9 +1974,6 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
       break;
 
     case OP_FUNCALL:
-      /* FIXME: carlton/2002-01-20: I don't understand this well
-        enough to know if it should be changed after I added the
-        current block to an OP_FUNCALL.  */
       nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
       /* FIXME:  OP_UNRESOLVED_VALUE should be defined in expression.h */
       /*      if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE)        
@@ -2793,11 +2790,10 @@ replace_operator_with_call (struct expression **expp, int pc, int nargs,
 
   newexp->elts[pc].opcode = newexp->elts[pc + 2].opcode = OP_FUNCALL;
   newexp->elts[pc + 1].longconst = (LONGEST) nargs;
-  newexp->elts[pc + 2].block = block;
 
-  newexp->elts[pc + 4].opcode = newexp->elts[pc + 6].opcode = OP_VAR_VALUE;
-  newexp->elts[pc + 5].block = block;
-  newexp->elts[pc + 6].symbol = sym;
+  newexp->elts[pc + 3].opcode = newexp->elts[pc + 6].opcode = OP_VAR_VALUE;
+  newexp->elts[pc + 4].block = block;
+  newexp->elts[pc + 5].symbol = sym;
 
   *expp = newexp;
   xfree (exp);
@@ -6998,7 +6994,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       return value_array (tem2, tem3, argvec);
 
     case OP_FUNCALL:
-      (*pos) += 3;
+      (*pos) += 2;
 
       /* Allocate arg vector, including space for the function to be
          called in argvec[0] and a terminating NULL */
index a03568f8486de2da4417bed4505ea230a29c69d2..03726864a2aba3e1344dfb39d1de9e45b7a18057 100644 (file)
@@ -333,7 +333,6 @@ exp :       exp '('
                arglist ')'     %prec ARROW
                        { write_exp_elt_opcode (OP_FUNCALL);
                          write_exp_elt_longcst ((LONGEST) end_arglist ());
-                         write_exp_elt_block (expression_context_block);
                          write_exp_elt_opcode (OP_FUNCALL); }
        ;
 
@@ -603,9 +602,6 @@ qualified_name:     typebase COLONCOLON name
 
                          write_exp_elt_opcode (OP_SCOPE);
                          write_exp_elt_type (type);
-                         /* If it's a namespace, we need to know the
-                            block.  */
-                         write_exp_elt_block (expression_context_block);
                          write_exp_string ($3);
                          write_exp_elt_opcode (OP_SCOPE);
                        }
@@ -629,7 +625,6 @@ qualified_name:     typebase COLONCOLON name
                          destructor_name_p (tmp_token.ptr, type);
                          write_exp_elt_opcode (OP_SCOPE);
                          write_exp_elt_type (type);
-                         write_exp_elt_block (expression_context_block);
                          write_exp_string (tmp_token);
                          write_exp_elt_opcode (OP_SCOPE);
                        }
@@ -899,6 +894,24 @@ typebase  /* Implements (approximately): (type-qualifier)* type-specifier */
        | qualified_type
        ;
 
+/* FIXME: carlton/2003-09-19: This leads to lots of reduce-reduce
+   conflicts, because the parser doesn't know whether or not to use
+   qualified_name or qualified_type.  There's no good way to fix this
+   with the grammar as it stands; as far as I can tell, some of the
+   problems arise from ambiguities that GDB introduces ('start' can be
+   either an expression or a type), but some of it is inherent to the
+   nature of C++ (you want to treat the input "(FOO)" fairly
+   differently depending on whether FOO is an expression or a type,
+   and if FOO is a complex expression, this can be hard to determine
+   at the right time.
+
+   Perhaps we could fix this by making the lexer smarter.  (Some of
+   this functionality used to be in the lexer, but in a way that
+   worked even less well than the current solution.)  Ideally, the
+   code in question could be shared by the lexer and by decode_line_1.
+   I'm not holding my breath waiting for somebody to get around to
+   cleaning this up, however...  */
+
 qualified_type: typebase COLONCOLON name
                {
                  struct type *type = $1;
index 795470312757329dbdceec1299844320f7bff5f6..037f355825d23a260cd44b87b2f4515d7ac87d20 100644 (file)
@@ -54,8 +54,7 @@ static void overload_list_add_symbol (struct symbol *sym,
                                      const char *oload_name);
 
 static void make_symbol_overload_list_using (const char *func_name,
-                                            const char *namespace,
-                                            const struct block *block);
+                                            const char *namespace);
 
 static void make_symbol_overload_list_qualified (const char *func_name);
 
@@ -525,13 +524,9 @@ overload_list_add_symbol (struct symbol *sym, const char *oload_name)
    used in finding all overloaded instances of a function name.  This
    has been modified from make_symbol_completion_list.  */
 
-/* FIXME: carlton/2003-01-30: Should BLOCK be here?  Maybe it's better
-   to use get_selected_block (0).  */
-
 struct symbol **
 make_symbol_overload_list (const char *func_name,
-                          const char *namespace,
-                          const struct block *block)
+                          const char *namespace)
 {
   struct cleanup *old_cleanups;
 
@@ -543,8 +538,7 @@ make_symbol_overload_list (const char *func_name,
 
   old_cleanups = make_cleanup (xfree, sym_return_val);
 
-  make_symbol_overload_list_using (func_name, namespace,
-                                  block);
+  make_symbol_overload_list_using (func_name, namespace);
 
   discard_cleanups (old_cleanups);
 
@@ -558,8 +552,7 @@ make_symbol_overload_list (const char *func_name,
 
 static void
 make_symbol_overload_list_using (const char *func_name,
-                                const char *namespace,
-                                const struct block *block)
+                                const char *namespace)
 {
   const struct using_direct *current;
 
@@ -567,15 +560,14 @@ make_symbol_overload_list_using (const char *func_name,
      look in the appropriate namespaces for new functions to match
      on.  */
 
-  for (current = block_using (block);
+  for (current = block_using (get_selected_block (0));
        current != NULL;
        current = current->next)
     {
       if (strcmp (namespace, current->outer) == 0)
        {
          make_symbol_overload_list_using (func_name,
-                                          current->inner,
-                                          block);
+                                          current->inner);
        }
     }
 
index 08c1e23e7cbb83a8f266aedf1df0b353e60057d5..563ca3744e62015ae6844bd96a6f997a5dcdde46 100644 (file)
@@ -64,8 +64,7 @@ extern char *cp_func_name (const char *full_name);
 extern char *remove_params (const char *demangled_name);
 
 extern struct symbol **make_symbol_overload_list (const char *,
-                                                 const char *,
-                                                 const struct block *);
+                                                 const char *);
 
 /* Functions/variables from cp-namespace.c.  */
 
index d3ebb3e0d6353e132ba0658d2011e42cd902c685..6b504c6e20a9ab8da4a062c9d96d858e66e4f82a 100644 (file)
@@ -397,7 +397,6 @@ evaluate_subexp_standard (struct type *expect_type,
   long mem_offset;
   struct type **arg_types;
   int save_pos1;
-  const struct block *current_block;
 
   pc = (*pos)++;
   op = exp->elts[pc].opcode;
@@ -405,14 +404,13 @@ evaluate_subexp_standard (struct type *expect_type,
   switch (op)
     {
     case OP_SCOPE:
-      tem = longest_to_int (exp->elts[pc + 3].longconst);
-      (*pos) += 5 + BYTES_TO_EXP_ELEM (tem + 1);
+      tem = longest_to_int (exp->elts[pc + 2].longconst);
+      (*pos) += 4 + BYTES_TO_EXP_ELEM (tem + 1);
       arg1 = value_aggregate_elt (exp->elts[pc + 1].type,
-                                 exp->elts[pc + 2].block,
-                                 &exp->elts[pc + 4].string,
+                                 &exp->elts[pc + 3].string,
                                  noside);
       if (arg1 == NULL)
-       error ("There is no field named %s", &exp->elts[pc + 4].string);
+       error ("There is no field named %s", &exp->elts[pc + 3].string);
       return arg1;
 
     case OP_LONG:
@@ -949,11 +947,9 @@ evaluate_subexp_standard (struct type *expect_type,
       break;
 
     case OP_FUNCALL:
-      (*pos) += 3;
+      (*pos) += 2;
       op = exp->elts[*pos].opcode;
       nargs = longest_to_int (exp->elts[pc + 1].longconst);
-      current_block = exp->elts[pc + 2].block;
-
       /* Allocate arg vector, including space for the function to be
          called in argvec[0] and a terminating NULL */
       argvec = (struct value **) alloca (sizeof (struct value *) * (nargs + 3));
@@ -1125,7 +1121,6 @@ evaluate_subexp_standard (struct type *expect_type,
                                   1 /* method */,
                                   0 /* strict match */ ,
                                   &arg2 /* the object */, NULL,
-                                  current_block,
                                   &valp, NULL, &static_memfuncp);
 
 
@@ -1184,7 +1179,6 @@ evaluate_subexp_standard (struct type *expect_type,
                                   0 /* strict match */ ,
                                   NULL,
                                   exp->elts[save_pos1+2].symbol /* the function */ ,
-                                  current_block,
                                   NULL, &symp, NULL);
 
              /* Now fix the expression being evaluated */
@@ -1921,8 +1915,8 @@ evaluate_subexp_standard (struct type *expect_type,
        {
          if (op == OP_SCOPE)
            {
-             int temm = longest_to_int (exp->elts[pc + 4].longconst);
-             (*pos) += 4 + BYTES_TO_EXP_ELEM (temm + 1);
+             int temm = longest_to_int (exp->elts[pc + 3].longconst);
+             (*pos) += 3 + BYTES_TO_EXP_ELEM (temm + 1);
            }
          else
            evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
index 1eb4ec6919d5912a3e84a5810fc6fb0d3da364c0..a3001b1b338c65f8fb3da6b2083cc98ab0260a71 100644 (file)
@@ -82,9 +82,9 @@ print_subexp (struct expression *exp, int *pos,
       assoc = 0;
       fputs_filtered (type_name_no_tag (exp->elts[pc + 1].type), stream);
       fputs_filtered ("::", stream);
-      nargs = longest_to_int (exp->elts[pc + 3].longconst);
-      (*pos) += 5 + BYTES_TO_EXP_ELEM (nargs + 1);
-      fputs_filtered (&exp->elts[pc + 4].string, stream);
+      nargs = longest_to_int (exp->elts[pc + 2].longconst);
+      (*pos) += 4 + BYTES_TO_EXP_ELEM (nargs + 1);
+      fputs_filtered (&exp->elts[pc + 3].string, stream);
       return;
 
     case OP_LONG:
@@ -147,7 +147,7 @@ print_subexp (struct expression *exp, int *pos,
       return;
 
     case OP_FUNCALL:
-      (*pos) += 3;
+      (*pos) += 2;
       nargs = longest_to_int (exp->elts[pc + 1].longconst);
       print_subexp (exp, pos, stream, PREC_SUFFIX);
       fputs_filtered (" (", stream);
@@ -919,7 +919,7 @@ dump_subexp (struct expression *exp, struct ui_file *stream, int elt)
        nargs = longest_to_int (exp->elts[elt].longconst);
 
        fprintf_filtered (stream, "Number of args: %d", nargs);
-       elt += 3;
+       elt += 2;
 
        for (i = 1; i <= nargs + 1; i++)
          elt = dump_subexp (exp, stream, elt);
@@ -981,11 +981,11 @@ dump_subexp (struct expression *exp, struct ui_file *stream, int elt)
        type_print (exp->elts[elt].type, NULL, stream, 0);
        fprintf_filtered (stream, ") ");
 
-       len = longest_to_int (exp->elts[elt + 2].longconst);
-       elem_name = &exp->elts[elt + 3].string;
+       len = longest_to_int (exp->elts[elt + 1].longconst);
+       elem_name = &exp->elts[elt + 2].string;
 
        fprintf_filtered (stream, "Field name: `%.*s'", len, elem_name);
-       elt += 5 + BYTES_TO_EXP_ELEM (len + 1);
+       elt += 4 + BYTES_TO_EXP_ELEM (len + 1);
       }
       break;
     default:
index 6d7a490e26792cbd381bba9bb333f95d3663f463..da95fcbcf6215d6599e927fc0486b8dacca89a81 100644 (file)
@@ -176,12 +176,11 @@ enum exp_opcode
     OP_INTERNALVAR,
 
     /* OP_FUNCALL is followed by an integer in the next exp_element.
-       The integer is the number of args to the function call.  That
-       many plus one values from following subexpressions are used,
-       the first one being the function.  Next comes the current
-       block: this is used when doing operator overloading in C++.
-       Finally, there is a repeat of OP_FUNCALL, making four
-       exp_elements.  */
+       The integer is the number of args to the function call.
+       That many plus one values from following subexpressions
+       are used, the first one being the function.
+       The integer is followed by a repeat of OP_FUNCALL,
+       making three exp_elements.  */
     OP_FUNCALL,
 
     /* OP_OBJC_MSGCALL is followed by a string in the next exp_element and then an
@@ -195,9 +194,6 @@ enum exp_opcode
        and function calls are  all exactly the same syntactically. They may 
        only be dismabiguated at runtime.  Thus this operator, which 
        indicates that we have found something of the form <name> ( <stuff> ) */
-
-    /* NOTE: carlton/2003-01-20: Now that I've added a block to
-       OP_FUNCALL, it's no longer exactly like OP_FUNCALL.  */
     OP_F77_UNDETERMINED_ARGLIST,
 
     /* The following OP is a special one, it introduces a F77 complex
@@ -296,10 +292,9 @@ enum exp_opcode
     /* Objective C: "@selector" pseudo-operator */
     OP_OBJC_SELECTOR,
 
-    /* OP_SCOPE surrounds a type name, a block, and a field name.  The
-       type name and block are encoded as one element, but the field
-       name stays as a string, which, of course, is variable
-       length.  */
+    /* OP_SCOPE surrounds a type name and a field name.  The type
+       name is encoded as one element, but the field name stays as
+       a string, which, of course, is variable length.  */
     OP_SCOPE,
 
     /* Used to represent named structure field values in brace
index 36589fb6323be5509c793dad7ff5ba2966802506..f6eb50ceabf94c9711b74d4b749c1f00197d81ea 100644 (file)
@@ -1342,7 +1342,6 @@ push_qualified_expression_name (struct stoken name, int dot_index)
          token.length = dot_index;
          write_exp_elt_opcode (OP_SCOPE);
          write_exp_elt_type (typ);
-         write_exp_elt_block (NULL);
          write_exp_string (token);
          write_exp_elt_opcode (OP_SCOPE); 
          if (dot_index < name.length)
index 0e4ad02720ccfa90931f5a437dd8976f95fbfd74..b8dd17807138ac48c775ec7ce9eb5e37a261092a 100644 (file)
@@ -360,7 +360,6 @@ exp :       exp '('
                arglist ')'     %prec DOT
                        { write_exp_elt_opcode (OP_FUNCALL);
                          write_exp_elt_longcst ((LONGEST) end_arglist ());
-                         write_exp_elt_block (expression_context_block);
                          write_exp_elt_opcode (OP_FUNCALL); }
        ;
 
index 9931f4dedce8efe9abe0bbdf525e44b613e05bd1..1c3e2a41f1036091fde344a789f3838cdc148398 100644 (file)
@@ -398,7 +398,6 @@ exp :       exp '('
                arglist ')'     %prec ARROW
                        { write_exp_elt_opcode (OP_FUNCALL);
                          write_exp_elt_longcst ((LONGEST) end_arglist ());
-                         write_exp_elt_block (expression_context_block);
                          write_exp_elt_opcode (OP_FUNCALL); }
        ;
 
@@ -669,7 +668,6 @@ qualified_name:     typebase COLONCOLON name
 
                          write_exp_elt_opcode (OP_SCOPE);
                          write_exp_elt_type (type);
-                         write_exp_elt_block (NULL);
                          write_exp_string ($3);
                          write_exp_elt_opcode (OP_SCOPE);
                        }
@@ -693,7 +691,6 @@ qualified_name:     typebase COLONCOLON name
                          tmp_token.ptr[tmp_token.length] = 0;
                          write_exp_elt_opcode (OP_SCOPE);
                          write_exp_elt_type (type);
-                         write_exp_elt_block (NULL);
                          write_exp_string (tmp_token);
                          write_exp_elt_opcode (OP_SCOPE);
                        }
index 9ce3eb6d7d1e5fe26c8ff403629dd32b498909c8..22b3dcd54d6eee666fa4e9fd10c5f51912b83fde 100644 (file)
@@ -331,7 +331,6 @@ exp :       exp '('
                arglist ')'     %prec ARROW
                        { write_exp_elt_opcode (OP_FUNCALL);
                          write_exp_elt_longcst ((LONGEST) end_arglist ());
-                         write_exp_elt_block (expression_context_block);
                          write_exp_elt_opcode (OP_FUNCALL); 
                          pop_current_type (); }
        ;
@@ -594,7 +593,6 @@ qualified_name:     typebase COLONCOLON name
 
                          write_exp_elt_opcode (OP_SCOPE);
                          write_exp_elt_type (type);
-                         write_exp_elt_block (NULL);
                          write_exp_string ($3);
                          write_exp_elt_opcode (OP_SCOPE);
                        }
index 8589f643e9c63430a4ca6f0bdc31e74a0a001b70..61be5433b131c8808ed8048ca63aee0b8f552213 100644 (file)
@@ -803,7 +803,7 @@ length_of_subexp (struct expression *expr, int endpos)
       /* C++  */
     case OP_SCOPE:
       oplen = longest_to_int (expr->elts[endpos - 2].longconst);
-      oplen = 6 + BYTES_TO_EXP_ELEM (oplen + 1);
+      oplen = 5 + BYTES_TO_EXP_ELEM (oplen + 1);
       break;
 
     case OP_LONG:
@@ -826,10 +826,6 @@ length_of_subexp (struct expression *expr, int endpos)
       break;
 
     case OP_FUNCALL:
-      oplen = 4;
-      args = 1 + longest_to_int (expr->elts[endpos - 3].longconst);
-      break;
-
     case OP_F77_UNDETERMINED_ARGLIST:
       oplen = 3;
       args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
@@ -952,7 +948,7 @@ prefixify_subexp (struct expression *inexpr,
       /* C++  */
     case OP_SCOPE:
       oplen = longest_to_int (inexpr->elts[inend - 2].longconst);
-      oplen = 6 + BYTES_TO_EXP_ELEM (oplen + 1);
+      oplen = 5 + BYTES_TO_EXP_ELEM (oplen + 1);
       break;
 
     case OP_LONG:
@@ -975,10 +971,6 @@ prefixify_subexp (struct expression *inexpr,
       break;
 
     case OP_FUNCALL:
-      oplen = 4;
-      args = 1 + longest_to_int (inexpr->elts[inend - 3].longconst);
-      break;
-
     case OP_F77_UNDETERMINED_ARGLIST:
       oplen = 3;
       args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
index 543595d2788927d3a958b5120df24b04b2299d94..e4f871a3619dfded6c47f2f78727deef17989034 100644 (file)
@@ -63,7 +63,6 @@ static struct value *search_struct_method (char *, struct value **,
                                       int, int *, struct type *);
 
 static int find_oload_champ_namespace (struct type **arg_types, int nargs,
-                                      const struct block *current_block,
                                       const char *func_name,
                                       const char *qualified_name,
                                       struct symbol ***oload_syms,
@@ -71,7 +70,6 @@ static int find_oload_champ_namespace (struct type **arg_types, int nargs,
 
 static
 int find_oload_champ_namespace_loop (struct type **arg_types, int nargs,
-                                    const struct block *current_block,
                                     const char *func_name,
                                     const char *qualified_name,
                                     int namespace_len,
@@ -103,17 +101,13 @@ static struct value *value_struct_elt_for_reference (struct type *domain,
                                                     struct type *curtype,
                                                     const char *name,
                                                     struct type *intype,
-                                                    const struct block *
-                                                    block,
                                                     enum noside noside);
 
 static struct value *value_namespace_elt (const struct type *curtype,
-                                         const struct block *block,
                                          const char *name,
                                          enum noside noside);
 
 static struct value *value_maybe_namespace_elt (const struct type *curtype,
-                                               const struct block *block,
                                                const char *name,
                                                enum noside noside);
 
@@ -1933,7 +1927,6 @@ value_find_oload_method_list (struct value **argp, char *method, int offset,
 int
 find_overload_match (struct type **arg_types, int nargs, char *name, int method,
                     int lax, struct value **objp, struct symbol *fsym,
-                    const struct block *current_block,
                     struct value **valp, struct symbol **symp, int *staticp)
 {
   struct value *obj = (objp ? *objp : NULL);
@@ -2003,7 +1996,6 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
       make_cleanup (xfree, oload_champ_bv);
 
       oload_champ = find_oload_champ_namespace (arg_types, nargs,
-                                               current_block,
                                                func_name,
                                                qualified_name,
                                                &oload_syms,
@@ -2104,7 +2096,6 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
 
 static int
 find_oload_champ_namespace (struct type **arg_types, int nargs,
-                           const struct block *current_block,
                            const char *func_name,
                            const char *qualified_name,
                            struct symbol ***oload_syms,
@@ -2113,7 +2104,7 @@ find_oload_champ_namespace (struct type **arg_types, int nargs,
   int oload_champ;
 
   find_oload_champ_namespace_loop (arg_types, nargs,
-                                  current_block, func_name,
+                                  func_name,
                                   qualified_name, 0,
                                   oload_syms, oload_champ_bv,
                                   &oload_champ);
@@ -2135,7 +2126,6 @@ find_oload_champ_namespace (struct type **arg_types, int nargs,
 
 static int
 find_oload_champ_namespace_loop (struct type **arg_types, int nargs,
-                                const struct block *current_block,
                                 const char *func_name,
                                 const char *qualified_name,
                                 int namespace_len,
@@ -2171,7 +2161,7 @@ find_oload_champ_namespace_loop (struct type **arg_types, int nargs,
     {
       searched_deeper = 1;
 
-      if (find_oload_champ_namespace_loop (arg_types, nargs, current_block,
+      if (find_oload_champ_namespace_loop (arg_types, nargs,
                                           func_name, qualified_name,
                                           next_namespace_len,
                                           oload_syms, oload_champ_bv,
@@ -2195,8 +2185,7 @@ find_oload_champ_namespace_loop (struct type **arg_types, int nargs,
   strncpy (new_namespace, qualified_name, namespace_len);
   new_namespace[namespace_len] = '\0';
   new_oload_syms = make_symbol_overload_list (func_name,
-                                             new_namespace,
-                                             current_block);
+                                             new_namespace);
   while (new_oload_syms[num_fns])
     ++num_fns;
 
@@ -2465,14 +2454,13 @@ check_field (struct value *arg1, const char *name)
 }
 
 /* C++: Given an aggregate type CURTYPE, and a member name NAME,
-   return the appropriate member.  BLOCK is the current block; it is
-   used if TYPE is a namespace.  This function is used to resolve user
-   expressions of the form "DOMAIN::NAME".  For more details on what
-   happens, see the comment before value_struct_elt_for_reference.  */
+   return the appropriate member.  This function is used to resolve
+   user expressions of the form "DOMAIN::NAME".  For more details on
+   what happens, see the comment before
+   value_struct_elt_for_reference.  */
 
 struct value *
 value_aggregate_elt (struct type *curtype,
-                    const struct block *block,
                     const char *name,
                     enum noside noside)
 {
@@ -2481,9 +2469,9 @@ value_aggregate_elt (struct type *curtype,
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
       return value_struct_elt_for_reference (curtype, 0, curtype, name, NULL,
-                                            block, noside);
+                                            noside);
     case TYPE_CODE_NAMESPACE:
-      return value_namespace_elt (curtype, block, name, noside);
+      return value_namespace_elt (curtype, name, noside);
     default:
       error ("Internal error: non-aggregate type to value_aggregate_elt");
     }
@@ -2500,7 +2488,6 @@ static struct value *
 value_struct_elt_for_reference (struct type *domain, int offset,
                                struct type *curtype, const char *name,
                                struct type *intype,
-                               const struct block *block,
                                enum noside noside)
 {
   struct type *t = curtype;
@@ -2621,7 +2608,6 @@ value_struct_elt_for_reference (struct type *domain, int offset,
                                          TYPE_BASECLASS (t, i),
                                          name,
                                          intype,
-                                         block,
                                          noside);
       if (v)
        return v;
@@ -2630,20 +2616,18 @@ value_struct_elt_for_reference (struct type *domain, int offset,
   /* As a last chance, look it up using lookup_symbol_namespace: this
      works for types.  */
 
-  return value_maybe_namespace_elt (curtype, block, name, noside);
+  return value_maybe_namespace_elt (curtype, name, noside);
 }
 
 /* C++: Return the member NAME of the namespace given by the type
-   CURTYPE.  Look this up within BLOCK: in particular, apply the using
-   directives from within BLOCK.  */
+   CURTYPE.  */
 
 static struct value *
 value_namespace_elt (const struct type *curtype,
-                    const struct block *block,
                     const char *name,
                     enum noside noside)
 {
-  struct value *retval = value_maybe_namespace_elt (curtype, block, name,
+  struct value *retval = value_maybe_namespace_elt (curtype, name,
                                                    noside);
 
   if (retval == NULL)
@@ -2658,7 +2642,6 @@ value_namespace_elt (const struct type *curtype,
 
 static struct value *
 value_maybe_namespace_elt (const struct type *curtype,
-                          const struct block *block,
                           const char *name,
                           enum noside noside)
 {
@@ -2666,7 +2649,8 @@ value_maybe_namespace_elt (const struct type *curtype,
   const struct symbol *sym;
 
   sym = cp_lookup_symbol_namespace (namespace_name, name, NULL,
-                                   block, VAR_DOMAIN, NULL);
+                                   get_selected_block (0), VAR_DOMAIN,
+                                   NULL);
 
   if (sym == NULL)
     return NULL;
@@ -2674,7 +2658,7 @@ value_maybe_namespace_elt (const struct type *curtype,
           && (SYMBOL_CLASS (sym) == LOC_TYPEDEF))
     return allocate_value (SYMBOL_TYPE (sym));
   else
-    return value_of_variable (sym, block);
+    return value_of_variable (sym, get_selected_block (0));
 }
 
 /* Given a pointer value V, find the real (RTTI) type
index 99b84163827b06d2f750bcb68f9ac3c9b91d4614..92b44a509734cb77a8a016e294ceacff3a058bbc 100644 (file)
@@ -381,7 +381,6 @@ extern struct value *value_struct_elt (struct value **argp,
                                       char *err);
 
 extern struct value *value_aggregate_elt (struct type *curtype,
-                                         const struct block *block,
                                          const char *name,
                                          enum noside noside);
 
@@ -394,7 +393,6 @@ extern struct fn_field *value_find_oload_method_list (struct value **, char *,
 extern int find_overload_match (struct type **arg_types, int nargs,
                                char *name, int method, int lax,
                                struct value **objp, struct symbol *fsym,
-                               const struct block *current_block,
                                struct value **valp, struct symbol **symp,
                                int *staticp);