aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2018-11-29 15:07:59 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2018-11-30 18:13:42 +0000
commit65a4b373267813ae5e47ac519da2e70d9c7e09d3 (patch)
treef7ef8cba13b81bdc1608001572fd1c7eb6024c05 /gdb/arch
parent0ff80bf7b9901b5e3c6805b99d30fd555f512d69 (diff)
downloadgdb-65a4b373267813ae5e47ac519da2e70d9c7e09d3.zip
gdb-65a4b373267813ae5e47ac519da2e70d9c7e09d3.tar.gz
gdb-65a4b373267813ae5e47ac519da2e70d9c7e09d3.tar.bz2
gdb/riscv: Add equality operators to riscv_gdb_features
Add '==' and '!=' operators for the struct riscv_gdb_features, allowing a small simplification. gdb/ChangeLog: * arch/riscv.h (riscv_gdb_features::operator==): New. (riscv_gdb_features::operator!=): New. * riscv-tdep.c (riscv_gdbarch_init): Make use of the inequality operator.
Diffstat (limited to 'gdb/arch')
-rw-r--r--gdb/arch/riscv.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/arch/riscv.h b/gdb/arch/riscv.h
index ec4d5f3..be41828e 100644
--- a/gdb/arch/riscv.h
+++ b/gdb/arch/riscv.h
@@ -53,6 +53,19 @@ struct riscv_gdbarch_features
this field is true then the hardware floating point abi is in use, and
values are passed in f-registers matching the size of FLEN. */
bool hw_float_abi = false;
+
+ /* Equality operator. */
+ bool operator== (const struct riscv_gdbarch_features &rhs) const
+ {
+ return (xlen == rhs.xlen && flen == rhs.flen
+ && hw_float_abi == rhs.hw_float_abi);
+ }
+
+ /* Inequality operator. */
+ bool operator!= (const struct riscv_gdbarch_features &rhs) const
+ {
+ return !((*this) == rhs);
+ }
};
/* Create and return a target description that is compatible with