Use block_symbol in var_value_operation
authorTom Tromey <tromey@adacore.com>
Thu, 15 Apr 2021 16:05:00 +0000 (10:05 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 15 Apr 2021 16:05:00 +0000 (10:05 -0600)
I noticed that var_value_operation takes a block and a symbol, and
most callers destructure a block_symbol to pass in.  It seems better
for this class to simply hold a block_symbol instead.

Tested on x86-64 Fedora 32.

gdb/ChangeLog
2021-04-15  Tom Tromey  <tromey@adacore.com>

* rust-exp.y (rust_parser::convert_ast_to_expression): Update.
* parse.c (parser_state::push_symbol, parser_state::push_dollar):
Update.
* p-exp.y (variable): Update.
* m2-exp.y (variable): Update.
* go-exp.y (variable): Update.
* expprint.c (dump_for_expression): New overload.
* expop.h (check_objfile): New overload.
(check_constant): New overload.
(class var_value_operation): Use block_symbol.
<get_symbol>: Rewrite.
* eval.c (var_value_operation::evaluate)
(var_value_operation::evaluate_funcall)
(var_value_operation::evaluate_for_address)
(var_value_operation::evaluate_for_address)
(var_value_operation::evaluate_with_coercion)
(var_value_operation::evaluate_for_sizeof)
(var_value_operation::evaluate_for_cast): Update.
* d-exp.y (PrimaryExpression): Update.
* c-exp.y (variable): Update.
* ax-gdb.c (var_value_operation::do_generate_ax): Update.
* ada-lang.c (ada_var_value_operation::evaluate_for_cast)
(ada_var_value_operation::evaluate)
(ada_var_value_operation::resolve)
(ada_funcall_operation::resolve): Update.
* ada-exp.y (write_var_from_sym, write_object_renaming)
(write_ambiguous_var, write_var_or_type, write_name_assoc)
(maybe_overload): Update.
* ada-exp.h (class ada_var_value_operation) <get_block>: Rewrite.

15 files changed:
gdb/ChangeLog
gdb/ada-exp.h
gdb/ada-exp.y
gdb/ada-lang.c
gdb/ax-gdb.c
gdb/c-exp.y
gdb/d-exp.y
gdb/eval.c
gdb/expop.h
gdb/expprint.c
gdb/go-exp.y
gdb/m2-exp.y
gdb/p-exp.y
gdb/parse.c
gdb/rust-exp.y

index 53850586bd77129015d74b3aa51c92570129e2a9..22a79c2f88c98a6cc3fe374b244ba37fe0acd6c1 100644 (file)
@@ -1,3 +1,35 @@
+2021-04-15  Tom Tromey  <tromey@adacore.com>
+
+       * rust-exp.y (rust_parser::convert_ast_to_expression): Update.
+       * parse.c (parser_state::push_symbol, parser_state::push_dollar):
+       Update.
+       * p-exp.y (variable): Update.
+       * m2-exp.y (variable): Update.
+       * go-exp.y (variable): Update.
+       * expprint.c (dump_for_expression): New overload.
+       * expop.h (check_objfile): New overload.
+       (check_constant): New overload.
+       (class var_value_operation): Use block_symbol.
+       <get_symbol>: Rewrite.
+       * eval.c (var_value_operation::evaluate)
+       (var_value_operation::evaluate_funcall)
+       (var_value_operation::evaluate_for_address)
+       (var_value_operation::evaluate_for_address)
+       (var_value_operation::evaluate_with_coercion)
+       (var_value_operation::evaluate_for_sizeof)
+       (var_value_operation::evaluate_for_cast): Update.
+       * d-exp.y (PrimaryExpression): Update.
+       * c-exp.y (variable): Update.
+       * ax-gdb.c (var_value_operation::do_generate_ax): Update.
+       * ada-lang.c (ada_var_value_operation::evaluate_for_cast)
+       (ada_var_value_operation::evaluate)
+       (ada_var_value_operation::resolve)
+       (ada_funcall_operation::resolve): Update.
+       * ada-exp.y (write_var_from_sym, write_object_renaming)
+       (write_ambiguous_var, write_var_or_type, write_name_assoc)
+       (maybe_overload): Update.
+       * ada-exp.h (class ada_var_value_operation) <get_block>: Rewrite.
+
 2021-04-15  Tom Tromey  <tom@tromey.com>
            Andrew Burgess  <andrew.burgess@embecosm.com>
 
 
        * top.c (print_gdb_version): Update copyright year.
 
-2021-01-01  Joel Brobecker  <brobecker@adacore.com>
+2021-01-01, 21  Joel Brobecker  <brobecker@adacore.com>
 
        * config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2020.
 
index 82941dd063421d7cc6f38951cb6fcd1862ea78df..598dc7072ad788915439af914dcee09e09f47569 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for Ada expressions
 
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020, 2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -352,7 +352,7 @@ public:
                            enum noside noside) override;
 
   const block *get_block () const
-  { return std::get<1> (m_storage); }
+  { return std::get<0> (m_storage).block; }
 
   bool resolve (struct expression *exp,
                bool deprocedure_p,
index 146b1acbe14174783f8dc599195616f1924ddfea..7b1b60fd46b3f03febc61bf50729a61e03dd9510 100644 (file)
@@ -194,8 +194,7 @@ maybe_overload (enum exp_opcode op, operation_up &lhs, operation_up &rhs)
 
   if (symbol_read_needs_frame (fn.symbol))
     pstate->block_tracker->update (fn.block, INNERMOST_BLOCK_FOR_SYMBOLS);
-  operation_up callee
-    = make_operation<ada_var_value_operation> (fn.symbol, fn.block);
+  operation_up callee = make_operation<ada_var_value_operation> (fn);
 
   std::vector<operation_up> argvec;
   argvec.push_back (std::move (lhs));
@@ -1124,14 +1123,12 @@ yyerror (const char *msg)
    non-NULL).  */
 
 static void
-write_var_from_sym (struct parser_state *par_state,
-                   const struct block *block,
-                   struct symbol *sym)
+write_var_from_sym (struct parser_state *par_state, block_symbol sym)
 {
-  if (symbol_read_needs_frame (sym))
-    par_state->block_tracker->update (block, INNERMOST_BLOCK_FOR_SYMBOLS);
+  if (symbol_read_needs_frame (sym.symbol))
+    par_state->block_tracker->update (sym.block, INNERMOST_BLOCK_FOR_SYMBOLS);
 
-  par_state->push_new<ada_var_value_operation> (sym, block);
+  par_state->push_new<ada_var_value_operation> (sym);
 }
 
 /* Write integer or boolean constant ARG of type TYPE.  */
@@ -1190,7 +1187,7 @@ write_object_renaming (struct parser_state *par_state,
                                &inner_renaming_expr))
       {
       case ADA_NOT_RENAMING:
-       write_var_from_sym (par_state, sym_info.block, sym_info.symbol);
+       write_var_from_sym (par_state, sym_info);
        break;
       case ADA_OBJECT_RENAMING:
        write_object_renaming (par_state, sym_info.block,
@@ -1247,8 +1244,7 @@ write_object_renaming (struct parser_state *par_state,
            else if (SYMBOL_CLASS (index_sym_info.symbol) == LOC_TYPEDEF)
              /* Index is an old-style renaming symbol.  */
              index_sym_info.block = orig_left_context;
-           write_var_from_sym (par_state, index_sym_info.block,
-                               index_sym_info.symbol);
+           write_var_from_sym (par_state, index_sym_info);
          }
        if (slice_state == SIMPLE_INDEX)
          ada_funcall (1);
@@ -1458,7 +1454,8 @@ write_ambiguous_var (struct parser_state *par_state,
   sym->set_linkage_name (obstack_strndup (&temp_parse_space, name, len));
   sym->set_language (language_ada, nullptr);
 
-  par_state->push_new<ada_var_value_operation> (sym, block);
+  block_symbol bsym { sym, block };
+  par_state->push_new<ada_var_value_operation> (bsym);
 }
 
 /* A convenient wrapper around ada_get_field_index that takes
@@ -1637,7 +1634,7 @@ write_var_or_type (struct parser_state *par_state,
 
          if (syms.size () == 1)
            {
-             write_var_from_sym (par_state, syms[0].block, syms[0].symbol);
+             write_var_from_sym (par_state, syms[0]);
              write_selectors (par_state, encoded_name + tail_index);
              return NULL;
            }
@@ -1711,7 +1708,7 @@ write_name_assoc (struct parser_state *par_state, struct stoken name)
       if (syms.size () != 1 || SYMBOL_CLASS (syms[0].symbol) == LOC_TYPEDEF)
        pstate->push_new<ada_string_operation> (copy_name (name));
       else
-       write_var_from_sym (par_state, syms[0].block, syms[0].symbol);
+       write_var_from_sym (par_state, syms[0]);
     }
   else
     if (write_var_or_type (par_state, NULL, name) != NULL)
index e5fbf74ef2721d43e5fc53b130eaef27af0009c9..f7860f27bfc019b5eb384088669a0f8943b2b743 100644 (file)
@@ -10248,8 +10248,8 @@ ada_var_value_operation::evaluate_for_cast (struct type *expect_type,
                                            enum noside noside)
 {
   value *val = evaluate_var_value (noside,
-                                  std::get<1> (m_storage),
-                                  std::get<0> (m_storage));
+                                  std::get<0> (m_storage).block,
+                                  std::get<0> (m_storage).symbol);
 
   val = ada_value_cast (expect_type, val);
 
@@ -10269,7 +10269,7 @@ ada_var_value_operation::evaluate (struct type *expect_type,
                                   struct expression *exp,
                                   enum noside noside)
 {
-  symbol *sym = std::get<0> (m_storage);
+  symbol *sym = std::get<0> (m_storage).symbol;
 
   if (SYMBOL_DOMAIN (sym) == UNDEF_DOMAIN)
     /* Only encountered when an unresolved symbol occurs in a
@@ -10360,19 +10360,19 @@ ada_var_value_operation::resolve (struct expression *exp,
                                  innermost_block_tracker *tracker,
                                  struct type *context_type)
 {
-  symbol *sym = std::get<0> (m_storage);
+  symbol *sym = std::get<0> (m_storage).symbol;
   if (SYMBOL_DOMAIN (sym) == UNDEF_DOMAIN)
     {
       block_symbol resolved
-       = ada_resolve_variable (sym, std::get<1> (m_storage),
+       = ada_resolve_variable (sym, std::get<0> (m_storage).block,
                                context_type, parse_completion,
                                deprocedure_p, tracker);
-      std::get<0> (m_storage) = resolved.symbol;
-      std::get<1> (m_storage) = resolved.block;
+      std::get<0> (m_storage) = resolved;
     }
 
   if (deprocedure_p
-      && SYMBOL_TYPE (std::get<0> (m_storage))->code () == TYPE_CODE_FUNC)
+      && (SYMBOL_TYPE (std::get<0> (m_storage).symbol)->code ()
+         == TYPE_CODE_FUNC))
     return true;
 
   return false;
@@ -10694,8 +10694,7 @@ ada_funcall_operation::resolve (struct expression *exp,
                           tracker);
 
   std::get<0> (m_storage)
-    = make_operation<ada_var_value_operation> (resolved.symbol,
-                                              resolved.block);
+    = make_operation<ada_var_value_operation> (resolved);
   return false;
 }
 
index 33fc53837645f1c5eb2e0e0476c4d079639b2d03..009c128c83c11e83405eb3c7137e58d8f2b46efe 100644 (file)
@@ -1980,16 +1980,16 @@ var_value_operation::do_generate_ax (struct expression *exp,
                                     struct axs_value *value,
                                     struct type *cast_type)
 {
-  gen_var_ref (ax, value, std::get<0> (m_storage));
+  gen_var_ref (ax, value, std::get<0> (m_storage).symbol);
 
   if (value->optimized_out)
     error (_("`%s' has been optimized out, cannot use"),
-          std::get<0> (m_storage)->print_name ());
+          std::get<0> (m_storage).symbol->print_name ());
 
   if (value->type->code () == TYPE_CODE_ERROR)
     {
       if (cast_type == nullptr)
-       error_unknown_type (std::get<0> (m_storage)->print_name ());
+       error_unknown_type (std::get<0> (m_storage).symbol->print_name ());
       value->type = cast_type;
     }
 }
index d6a2322dbf6e4810f1ccda88f912d6e20434e6ae..865b1554de1856b9948c22ab2349feb8200f8c6c 100644 (file)
@@ -1125,8 +1125,7 @@ variable: block COLONCOLON name
                          if (symbol_read_needs_frame (sym.symbol))
                            pstate->block_tracker->update (sym);
 
-                         pstate->push_new<var_value_operation> (sym.symbol,
-                                                                sym.block);
+                         pstate->push_new<var_value_operation> (sym);
                        }
        ;
 
@@ -1197,8 +1196,7 @@ variable: name_not_typename
                                pstate->push_new<var_msym_value_operation>
                                  (resolver);
                              else
-                               pstate->push_new<var_value_operation>
-                                 (sym.symbol, sym.block);
+                               pstate->push_new<var_value_operation> (sym);
                            }
                          else if ($1.is_a_field_of_this)
                            {
@@ -1239,8 +1237,11 @@ variable:        name_not_typename
                                   ? find_function_alias_target (msymbol)
                                   : NULL);
                              if (alias_target != NULL)
-                               pstate->push_new<var_value_operation>
-                                 (alias_target, SYMBOL_BLOCK_VALUE (alias_target));
+                               {
+                                 block_symbol bsym { alias_target,
+                                   SYMBOL_BLOCK_VALUE (alias_target) };
+                                 pstate->push_new<var_value_operation> (bsym);
+                               }
                              else
                                pstate->push_new<var_msym_value_operation>
                                  (msymbol);
index 20884baebbadfdf11e27c0ea7f5ac633b686e120..1d11d9f3569085d924597c7259e278bf05b233a4 100644 (file)
@@ -452,8 +452,7 @@ PrimaryExpression:
                    {
                      if (symbol_read_needs_frame (sym.symbol))
                        pstate->block_tracker->update (sym);
-                     pstate->push_new<var_value_operation> (sym.symbol,
-                                                            sym.block);
+                     pstate->push_new<var_value_operation> (sym);
                    }
                  else if (is_a_field_of_this.type != NULL)
                     {
index 363ab4fa4af962cc409b474602785fa52a171209..1b3c974009acdcbd671420af995365e6c7817126 100644 (file)
@@ -579,10 +579,10 @@ var_value_operation::evaluate (struct type *expect_type,
                               struct expression *exp,
                               enum noside noside)
 {
-  symbol *var = std::get<0> (m_storage);
+  symbol *var = std::get<0> (m_storage).symbol;
   if (SYMBOL_TYPE (var)->code () == TYPE_CODE_ERROR)
     error_unknown_type (var->print_name ());
-  return evaluate_var_value (noside, std::get<1> (m_storage), var);
+  return evaluate_var_value (noside, std::get<0> (m_storage).block, var);
 }
 
 } /* namespace expr */
@@ -719,12 +719,13 @@ var_value_operation::evaluate_funcall (struct type *expect_type,
 
   struct symbol *symp;
   find_overload_match (argvec, NULL, NON_METHOD,
-                      NULL, std::get<0> (m_storage),
+                      NULL, std::get<0> (m_storage).symbol,
                       NULL, &symp, NULL, 0, noside);
 
   if (SYMBOL_TYPE (symp)->code () == TYPE_CODE_ERROR)
     error_unknown_type (symp->print_name ());
-  value *callee = evaluate_var_value (noside, std::get<1> (m_storage), symp);
+  value *callee = evaluate_var_value (noside, std::get<0> (m_storage).block,
+                                     symp);
 
   return evaluate_subexp_do_call (exp, noside, callee, argvec,
                                  nullptr, expect_type);
@@ -2573,7 +2574,7 @@ value *
 var_value_operation::evaluate_for_address (struct expression *exp,
                                           enum noside noside)
 {
-  symbol *var = std::get<0> (m_storage);
+  symbol *var = std::get<0> (m_storage).symbol;
 
   /* C++: The "address" of a reference should yield the address
    * of the object pointed to.  Let value_addr() deal with it.  */
@@ -2593,20 +2594,21 @@ var_value_operation::evaluate_for_address (struct expression *exp,
       return value_zero (type, not_lval);
     }
   else
-    return address_of_variable (var, std::get<1> (m_storage));
+    return address_of_variable (var, std::get<0> (m_storage).block);
 }
 
 value *
 var_value_operation::evaluate_with_coercion (struct expression *exp,
                                             enum noside noside)
 {
-  struct symbol *var = std::get<0> (m_storage);
+  struct symbol *var = std::get<0> (m_storage).symbol;
   struct type *type = check_typedef (SYMBOL_TYPE (var));
   if (type->code () == TYPE_CODE_ARRAY
       && !type->is_vector ()
       && CAST_IS_CONVERSION (exp->language_defn))
     {
-      struct value *val = address_of_variable (var, std::get<1> (m_storage));
+      struct value *val = address_of_variable (var,
+                                              std::get<0> (m_storage).block);
       return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val);
     }
   return evaluate (nullptr, exp, noside);
@@ -2730,7 +2732,7 @@ value *
 var_value_operation::evaluate_for_sizeof (struct expression *exp,
                                          enum noside noside)
 {
-  struct type *type = SYMBOL_TYPE (std::get<0> (m_storage));
+  struct type *type = SYMBOL_TYPE (std::get<0> (m_storage).symbol);
   if (is_dynamic_type (type))
     {
       value *val = evaluate (nullptr, exp, EVAL_NORMAL);
@@ -2778,8 +2780,8 @@ var_value_operation::evaluate_for_cast (struct type *to_type,
                                        enum noside noside)
 {
   value *val = evaluate_var_value (noside,
-                                  std::get<1> (m_storage),
-                                  std::get<0> (m_storage));
+                                  std::get<0> (m_storage).block,
+                                  std::get<0> (m_storage).symbol);
 
   val = value_cast (to_type, val);
 
index cc8d9ca6741d33025a1af5f6e5c980e41e15608e..b8e28b5a59025cf3c87d6bbf6c8da587230a8ca7 100644 (file)
@@ -221,7 +221,7 @@ check_objfile (struct objfile *exp_objfile, struct objfile *objfile)
   return exp_objfile == objfile;
 }
 
-static inline bool 
+static inline bool
 check_objfile (struct type *type, struct objfile *objfile)
 {
   struct objfile *ty_objfile = type->objfile_owner ();
@@ -230,18 +230,25 @@ check_objfile (struct type *type, struct objfile *objfile)
   return false;
 }
 
-static inline bool 
+static inline bool
 check_objfile (struct symbol *sym, struct objfile *objfile)
 {
   return check_objfile (symbol_objfile (sym), objfile);
 }
 
-static inline bool 
+static inline bool
 check_objfile (const struct block *block, struct objfile *objfile)
 {
   return check_objfile (block_objfile (block), objfile);
 }
 
+static inline bool
+check_objfile (const block_symbol &sym, struct objfile *objfile)
+{
+  return (check_objfile (sym.symbol, objfile)
+         || check_objfile (sym.block, objfile));
+}
+
 static inline bool
 check_objfile (bound_minimal_symbol minsym, struct objfile *objfile)
 {
@@ -260,7 +267,7 @@ check_objfile (const std::string &str, struct objfile *objfile)
   return false;
 }
 
-static inline bool 
+static inline bool
 check_objfile (const operation_up &op, struct objfile *objfile)
 {
   return op->uses_objfile (objfile);
@@ -286,7 +293,7 @@ check_objfile (enum_flags<T> val, struct objfile *objfile)
 }
 
 template<typename T>
-static inline bool 
+static inline bool
 check_objfile (const std::vector<T> &collection, struct objfile *objfile)
 {
   for (const auto &item : collection)
@@ -298,7 +305,7 @@ check_objfile (const std::vector<T> &collection, struct objfile *objfile)
 }
 
 template<typename S, typename T>
-static inline bool 
+static inline bool
 check_objfile (const std::pair<S, T> &item, struct objfile *objfile)
 {
   return (check_objfile (item.first, objfile)
@@ -327,6 +334,8 @@ extern void dump_for_expression (struct ui_file *stream, int depth,
                                 internalvar *ivar);
 extern void dump_for_expression (struct ui_file *stream, int depth,
                                 symbol *sym);
+extern void dump_for_expression (struct ui_file *stream, int depth,
+                                const block_symbol &sym);
 extern void dump_for_expression (struct ui_file *stream, int depth,
                                 bound_minimal_symbol msym);
 extern void dump_for_expression (struct ui_file *stream, int depth,
@@ -480,6 +489,14 @@ check_constant (struct symbol *sym)
          || sc == LOC_LABEL);
 }
 
+static inline bool
+check_constant (const block_symbol &sym)
+{
+  /* We know the block is constant, so we only need to check the
+     symbol.  */
+  return check_constant (sym.symbol);
+}
+
 template<typename T>
 static inline bool
 check_constant (const std::vector<T> &collection)
@@ -612,7 +629,7 @@ protected:
 
 /* Compute the value of a variable.  */
 class var_value_operation
-  : public maybe_constant_operation<symbol *, const block *>
+  : public maybe_constant_operation<block_symbol>
 {
 public:
 
@@ -646,7 +663,7 @@ public:
   /* Return the symbol referenced by this object.  */
   symbol *get_symbol () const
   {
-    return std::get<0> (m_storage);
+    return std::get<0> (m_storage).symbol;
   }
 
 protected:
index e228beb83a59bb9f52bb6f8f4fd1d94602f4f920..0c21ce9eaae53a65eca756998dad14aabce55e8c 100644 (file)
@@ -123,6 +123,15 @@ dump_for_expression (struct ui_file *stream, int depth, const block *bl)
   fprintf_filtered (stream, _("%*sBlock: %p\n"), depth, "", bl);
 }
 
+void
+dump_for_expression (struct ui_file *stream, int depth,
+                    const block_symbol &sym)
+{
+  fprintf_filtered (stream, _("%*sBlock symbol:\n"), depth, "");
+  dump_for_expression (stream, depth + 1, sym.symbol);
+  dump_for_expression (stream, depth + 1, sym.block);
+}
+
 void
 dump_for_expression (struct ui_file *stream, int depth,
                     type_instance_flags flags)
index 05822d142db8bf186cbb6870a9f0e309fea69855..aaa65170a0347e279288f8dfd6f0f0116f92c117 100644 (file)
@@ -563,8 +563,7 @@ variable:   name_not_typename
                              if (symbol_read_needs_frame (sym.symbol))
                                pstate->block_tracker->update (sym);
 
-                             pstate->push_new<var_value_operation>
-                               (sym.symbol, sym.block);
+                             pstate->push_new<var_value_operation> (sym);
                            }
                          else if ($1.is_a_field_of_this)
                            {
index b19bbeb3fb258e46d6b70bb0812ba9dc18bd9e2e..f4d4eecda104cdd85cfcbd5ebf930834fc5862df 100644 (file)
@@ -517,8 +517,8 @@ fblock      :       block COLONCOLON BLOCKNAME
 /* Useful for assigning to PROCEDURE variables */
 variable:      fblock
                        {
-                         pstate->push_new<var_value_operation>
-                           ($1, nullptr);
+                         block_symbol sym { $1, nullptr };
+                         pstate->push_new<var_value_operation> (sym);
                        }
        ;
 
@@ -539,8 +539,7 @@ variable:   block COLONCOLON NAME
                          if (symbol_read_needs_frame (sym.symbol))
                            pstate->block_tracker->update (sym);
 
-                         pstate->push_new<var_value_operation>
-                           (sym.symbol, sym.block);
+                         pstate->push_new<var_value_operation> (sym);
                        }
        ;
 
index 02ad6bddc4fed4a2269da438c7cbef00b9139edf..f496ce2016e5ac78b5264c2d603dc2e707ca760a 100644 (file)
@@ -651,8 +651,7 @@ variable:   block COLONCOLON name
                            error (_("No symbol \"%s\" in specified context."),
                                   copy.c_str ());
 
-                         pstate->push_new<var_value_operation>
-                           (sym.symbol, sym.block);
+                         pstate->push_new<var_value_operation> (sym);
                        }
        ;
 
@@ -690,8 +689,7 @@ variable:   name_not_typename
                              if (symbol_read_needs_frame (sym.symbol))
                                pstate->block_tracker->update (sym);
 
-                             pstate->push_new<var_value_operation>
-                               (sym.symbol, sym.block);
+                             pstate->push_new<var_value_operation> (sym);
                              current_type = sym.symbol->type; }
                          else if ($1.is_a_field_of_this)
                            {
index 692d38d363ded37deda522687a00c7896a0b2990..b2f23eb67bb18fb3ca52765cb6462407b707ecf3 100644 (file)
@@ -224,7 +224,7 @@ parser_state::push_symbol (const char *name, block_symbol sym)
     {
       if (symbol_read_needs_frame (sym.symbol))
        block_tracker->update (sym);
-      push_new<expr::var_value_operation> (sym.symbol, sym.block);
+      push_new<expr::var_value_operation> (sym);
     }
   else
     {
@@ -301,7 +301,7 @@ parser_state::push_dollar (struct stoken str)
   sym = lookup_symbol (copy.c_str (), NULL, VAR_DOMAIN, NULL);
   if (sym.symbol)
     {
-      push_new<expr::var_value_operation> (sym.symbol, sym.block);
+      push_new<expr::var_value_operation> (sym);
       return;
     }
   msym = lookup_bound_minimal_symbol (copy.c_str ());
index 3750af0dc348ec9b3db8d13195cc9634d6cfedd9..a0ceb6a42c7ead543c18964a7e85262415246d91 100644 (file)
@@ -2429,7 +2429,7 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation,
                             VAR_DOMAIN);
        operation_up result;
        if (sym.symbol != NULL && SYMBOL_CLASS (sym.symbol) != LOC_TYPEDEF)
-         result.reset (new var_value_operation (sym.symbol, sym.block));
+         result.reset (new var_value_operation (sym));
        else
          {
            struct type *type = NULL;