diff options
Diffstat (limited to 'gdb/expop.h')
-rw-r--r-- | gdb/expop.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/expop.h b/gdb/expop.h index 4b1d65a..8b7bfbe 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -186,6 +186,9 @@ extern struct value *eval_op_ind (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1); +extern struct value *eval_op_type (struct type *expect_type, + struct expression *exp, + enum noside noside, struct type *type); namespace expr { @@ -1420,6 +1423,28 @@ protected: } }; +/* Implement OP_TYPE. */ +class type_operation + : public tuple_holding_operation<struct type *> +{ +public: + + using tuple_holding_operation::tuple_holding_operation; + + value *evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) override + { + return eval_op_type (expect_type, exp, noside, std::get<0> (m_storage)); + } + + enum exp_opcode opcode () const override + { return OP_TYPE; } + + bool constant_p () const override + { return true; } +}; + } /* namespace expr */ #endif /* EXPOP_H */ |