return val;
}
-/* Helper function that implements the body of OP_STRING. */
+namespace expr
+{
-struct value *
-eval_op_string (struct type *expect_type, struct expression *exp,
- enum noside noside, int len, const char *string)
+value *
+string_operation::evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside)
{
+ const std::string &str = std::get<0> (m_storage);
struct type *type = language_string_char_type (exp->language_defn,
exp->gdbarch);
- return value_string (string, len, type);
+ return value_string (str.c_str (), str.size (), type);
}
+} /* namespace expr */
+
/* Helper function that implements the body of OP_OBJC_SELECTOR. */
struct value *
extern struct value *eval_op_register (struct type *expect_type,
struct expression *exp,
enum noside noside, const char *name);
-extern struct value *eval_op_string (struct type *expect_type,
- struct expression *exp,
- enum noside noside, int len,
- const char *string);
extern struct value *eval_op_ternop (struct type *expect_type,
struct expression *exp,
enum noside noside,
value *evaluate (struct type *expect_type,
struct expression *exp,
- enum noside noside) override
- {
- const std::string &str = std::get<0> (m_storage);
- return eval_op_string (expect_type, exp, noside,
- str.size (), str.c_str ());
- }
+ enum noside noside) override;
enum exp_opcode opcode () const override
{ return OP_STRING; }