From: Tom Tromey Date: Mon, 8 Mar 2021 14:27:57 +0000 (-0700) Subject: Introduce ada_qual_operation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc6bd32eeac6b31b036a172b6841d699e05b285f;p=binutils-gdb.git Introduce ada_qual_operation This adds class ada_qual_operation, which implements UNOP_QUAL. gdb/ChangeLog 2021-03-08 Tom Tromey * ada-lang.c (ada_qual_operation::evaluate): New method. * ada-exp.h (class ada_qual_operation): New. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 816f5a87950..337813d31db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2021-03-08 Tom Tromey + + * ada-lang.c (ada_qual_operation::evaluate): New method. + * ada-exp.h (class ada_qual_operation): New. + 2021-03-08 Tom Tromey * ada-lang.c (ada_string_operation::evaluate): New method. diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 88ed0c53b46..9a8c8dffd5c 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -55,6 +55,22 @@ public: enum noside noside) override; }; +/* The Ada TYPE'(EXP) construct. */ +class ada_qual_operation + : public tuple_holding_operation +{ +public: + + using tuple_holding_operation::tuple_holding_operation; + + value *evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) override; + + enum exp_opcode opcode () const override + { return UNOP_QUAL; } +}; + } /* namespace expr */ #endif /* ADA_EXP_H */ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 0666302747f..409ffb98dcd 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10427,6 +10427,15 @@ ada_string_operation::evaluate (struct type *expect_type, return result; } +value * +ada_qual_operation::evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) +{ + struct type *type = std::get<1> (m_storage); + return std::get<0> (m_storage)->evaluate (type, exp, noside); +} + } /* Implement the evaluate_exp routine in the exp_descriptor structure