mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 10:03:47 +08:00
Introduce ada_string_operation
This adds class ada_string_operation, which implements string constants for Ada. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * ada-lang.c (ada_string_operation::evaluate): New method. * ada-exp.h (class ada_string_operation): New.
This commit is contained in:
parent
03070ee9c7
commit
42fecb6183
@ -1,3 +1,8 @@
|
||||
2021-03-08 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* ada-lang.c (ada_string_operation::evaluate): New method.
|
||||
* ada-exp.h (class ada_string_operation): New.
|
||||
|
||||
2021-03-08 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* ada-lang.c (ada_wrapped_operation::evaluate): New method.
|
||||
|
@ -42,6 +42,19 @@ public:
|
||||
{ return std::get<0> (m_storage)->opcode (); }
|
||||
};
|
||||
|
||||
/* An Ada string constant. */
|
||||
class ada_string_operation
|
||||
: public string_operation
|
||||
{
|
||||
public:
|
||||
|
||||
using string_operation::string_operation;
|
||||
|
||||
value *evaluate (struct type *expect_type,
|
||||
struct expression *exp,
|
||||
enum noside noside) override;
|
||||
};
|
||||
|
||||
} /* namespace expr */
|
||||
|
||||
#endif /* ADA_EXP_H */
|
||||
|
@ -10414,6 +10414,19 @@ ada_wrapped_operation::evaluate (struct type *expect_type,
|
||||
return result;
|
||||
}
|
||||
|
||||
value *
|
||||
ada_string_operation::evaluate (struct type *expect_type,
|
||||
struct expression *exp,
|
||||
enum noside noside)
|
||||
{
|
||||
value *result = string_operation::evaluate (expect_type, exp, noside);
|
||||
/* The result type will have code OP_STRING, bashed there from
|
||||
OP_ARRAY. Bash it back. */
|
||||
if (value_type (result)->code () == TYPE_CODE_STRING)
|
||||
value_type (result)->set_code (TYPE_CODE_ARRAY);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Implement the evaluate_exp routine in the exp_descriptor structure
|
||||
|
Loading…
Reference in New Issue
Block a user