diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-17 00:15:01 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-17 00:15:01 +0000 |
commit | ac62dce5e5ff8e02682e2129e8fecc211c707551 (patch) | |
tree | 3f623df1dae7e03110c1be32b07cccc3ce074ec5 /gcc/rtl-ssa/changes.cc | |
parent | 0dd48296433763ba6f3a1c9068ce3991fb71e9b9 (diff) | |
download | gcc-ac62dce5e5ff8e02682e2129e8fecc211c707551.zip gcc-ac62dce5e5ff8e02682e2129e8fecc211c707551.tar.gz gcc-ac62dce5e5ff8e02682e2129e8fecc211c707551.tar.bz2 |
Add a class that multiplexes two pointer types
This patch adds a pointer_mux<T1, T2> class that provides similar
functionality to:
union { T1 *a; T2 *b; };
...
bool is_b_rather_than_a;
except that the is_b_rather_than_a tag is stored in the low bit
of the pointer. See the comments in the patch for a comparison
between the two approaches and why this one can be more efficient.
I've tried to microoptimise the class a fair bit, since a later
patch uses it extensively in order to keep the sizes of data
structures down.
gcc/
* mux-utils.h: New file.
Diffstat (limited to 'gcc/rtl-ssa/changes.cc')
0 files changed, 0 insertions, 0 deletions