value-relation: Small tweaks to tables
authorJakub Jelinek <jakub@redhat.com>
Thu, 26 Jan 2023 16:20:23 +0000 (17:20 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 26 Jan 2023 16:20:23 +0000 (17:20 +0100)
commit0cdb609f43eb6131053fb88e32fdc5490f4ef293
treea41cbcd66ac11c3fec6ed161a4f31935a0f4c491
parenta2dddefeed258119fc24d288b697d58da9e8b7e3
value-relation: Small tweaks to tables

As I said earlier, all these tables are used solely in value-relation.cc
and never modified, plus because VREL_LAST is small especially the
two-dimensional arrays are vast a lot of .data (or .rodata) space
- 576 bytes each.  The following patch makes those arrays static const
and uses unsigned char instead of relation_kind so that the
two-dimensional arrays shrink to 144 bytes.

2023-01-26  Jakub Jelinek  <jakub@redhat.com>

* value-relation.cc (kind_string): Add const.
(rr_negate_table, rr_swap_table, rr_intersect_table,
rr_union_table, rr_transitive_table): Add static const, change
element type from relation_kind to unsigned char.
(relation_negate, relation_swap, relation_intersect, relation_union,
relation_transitive): Cast rr_*_table element to relation_kind.
(relation_to_code): Add static const.
(relation_tests): Assert VREL_LAST is smaller than UCHAR_MAX.
gcc/value-relation.cc