|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Small reusable bit-set for slot-domain dataflow analyses. More...
#include <Compiler_Dataflow.H>
Public Member Functions | |
| void | resize (const size_t count, const bool value=false) |
Clears all existing bits and resizes the set to count elements. | |
| size_t | size () const noexcept |
| Returns the number of tracked bits. | |
| bool | test (const size_t index) const noexcept |
Returns whether bit index is set. | |
| bool | set (const size_t index, const bool value=true) |
Sets or clears bit index. | |
Public Attributes | |
| DynArray< unsigned char > | bits |
| One byte per tracked element. | |
Small reusable bit-set for slot-domain dataflow analyses.
Each element is stored as one byte so per-element access is O(1) without bit-shifting. Not thread-safe.
Definition at line 73 of file Compiler_Dataflow.H.
|
inline |
Clears all existing bits and resizes the set to count elements.
| count | Number of bits to track after the call. |
| value | Initial value for every bit (default: false / 0). |
Definition at line 84 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::append(), bits, Aleph::DynArray< T >::clear(), Aleph::count(), and value.
Referenced by Aleph::Compiler_SSA_Detail::compute_dominance_info(), and Aleph::Compiler_Dataflow_Detail::make_bit_set().
Sets or clears bit index.
| index | Zero-based bit index; must be less than size(). |
| value | New value for the bit (default: true / set). |
Definition at line 121 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::access(), ah_runtime_error_unless, bits, Aleph::blossom_maximum_cardinality_matching(), Aleph::DynArray< T >::size(), and value.
|
inlinenoexcept |
Returns the number of tracked bits.
Definition at line 96 of file Compiler_Dataflow.H.
References bits, and Aleph::DynArray< T >::size().
Referenced by Aleph::Compiler_Dataflow_Detail::bit_set_intersection(), Aleph::Compiler_Dataflow_Detail::bit_set_subtract(), Aleph::Compiler_Dataflow_Detail::bit_set_union(), and Aleph::Compiler_Dataflow_Detail::format_slot_set().
Returns whether bit index is set.
| index | Zero-based bit index. |
index is out of range. Definition at line 108 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::access(), Aleph::and, bits, and Aleph::DynArray< T >::size().
Referenced by Aleph::Compiler_Dataflow_Detail::bit_set_intersection(), Aleph::Compiler_Dataflow_Detail::bit_set_subtract(), Aleph::Compiler_Dataflow_Detail::bit_set_union(), and Aleph::Compiler_Dataflow_Detail::format_slot_set().