Introduce bool_operation
This adds class bool_operation, which implements OP_BOOL. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * expop.h (class bool_operation): New.
This commit is contained in:
parent
55bdbff857
commit
e6985c5e45
@ -1,3 +1,7 @@
|
||||
2021-03-08 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* expop.h (class bool_operation): New.
|
||||
|
||||
2021-03-08 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* expop.h (class register_operation): New.
|
||||
|
22
gdb/expop.h
22
gdb/expop.h
@ -627,6 +627,28 @@ protected:
|
||||
override;
|
||||
};
|
||||
|
||||
class bool_operation
|
||||
: public tuple_holding_operation<bool>
|
||||
{
|
||||
public:
|
||||
|
||||
using tuple_holding_operation::tuple_holding_operation;
|
||||
|
||||
value *evaluate (struct type *expect_type,
|
||||
struct expression *exp,
|
||||
enum noside noside) override
|
||||
{
|
||||
struct type *type = language_bool_type (exp->language_defn, exp->gdbarch);
|
||||
return value_from_longest (type, std::get<0> (m_storage));
|
||||
}
|
||||
|
||||
enum exp_opcode opcode () const override
|
||||
{ return OP_BOOL; }
|
||||
|
||||
bool constant_p () const override
|
||||
{ return true; }
|
||||
};
|
||||
|
||||
} /* namespace expr */
|
||||
|
||||
#endif /* EXPOP_H */
|
||||
|
Loading…
Reference in New Issue
Block a user