(value_of_local): Remove.
* valops.c (value_of_this): Rename from value_of_local. Change
parameters.
* p-exp.y (exp): Update.
(variable): Likewise.
* eval.c (evaluate_subexp_standard) <OP_THIS>: Use value_of_this.
+2011-06-17 Tom Tromey <tromey@redhat.com>
+
+ * value.h (value_of_this): Update.
+ (value_of_local): Remove.
+ * valops.c (value_of_this): Rename from value_of_local. Change
+ parameters.
+ * p-exp.y (exp): Update.
+ (variable): Likewise.
+ * eval.c (evaluate_subexp_standard) <OP_THIS>: Use value_of_this.
+
2011-06-17 Tom Tromey <tromey@redhat.com>
* valops.c (value_of_local): Complain if NAME is NULL.
case OP_THIS:
(*pos) += 1;
- return value_of_local (exp->language_defn->la_name_of_this, 1);
+ return value_of_this (exp->language_defn, 1);
case OP_TYPE:
/* The value is not supposed to be used. This is here to make it
write_exp_elt_opcode (OP_THIS);
write_exp_elt_opcode (OP_THIS);
/* We need type of this. */
- this_val = value_of_this (0);
+ this_val = value_of_this (parse_language, 0);
if (this_val)
this_type = value_type (this_val);
else
write_exp_string ($1.stoken);
write_exp_elt_opcode (STRUCTOP_PTR);
/* We need type of this. */
- this_val = value_of_this (0);
+ this_val = value_of_this (parse_language, 0);
if (this_val)
this_type = value_type (this_val);
else
inappropriate context. */
struct value *
-value_of_local (const char *name, int complain)
+value_of_this (const struct language_defn *lang, int complain)
{
struct symbol *func, *sym;
struct block *b;
struct value * ret;
struct frame_info *frame;
+ const char *name = lang->la_name_of_this;
if (!name)
{
return ret;
}
-/* C++/Objective-C: return the value of the class instance variable,
- if one exists. Flag COMPLAIN signals an error if the request is
- made in an inappropriate context. */
-
-struct value *
-value_of_this (int complain)
-{
- if (!current_language->la_name_of_this)
- return 0;
- return value_of_local (current_language->la_name_of_this, complain);
-}
-
/* Create a slice (sub-string, sub-array) of ARRAY, that is LENGTH
elements long, starting at LOWBOUND. The result has the same lower
bound as the original ARRAY. */
/* C++ */
-extern struct value *value_of_this (int complain);
+extern struct value *value_of_this (const struct language_defn *lang,
+ int complain);
extern struct value *value_x_binop (struct value *arg1, struct value *arg2,
enum exp_opcode op,
extern struct value *value_allocate_space_in_inferior (int);
-extern struct value *value_of_local (const char *name, int complain);
-
extern struct value *value_subscripted_rvalue (struct value *array,
LONGEST index, int lowerbound);