21#ifndef GCC_ANALYZER_INTEGER_WITH_UNIT_H
22#define GCC_ANALYZER_INTEGER_WITH_UNIT_H
31template<
typename Unit>
51 std::unique_ptr<json::object>
54 std::unique_ptr<diagnostics::markup::node>
157operator ""_bit (
unsigned long long v)
163inline integer_with_unit<units::bit>
164operator ""_bits (
unsigned long long v)
170inline integer_with_unit<units::byte>
171operator ""_byte (
unsigned long long v)
177inline integer_with_unit<units::byte>
178operator ""_bytes (
unsigned long long v)
186inline integer_with_unit<units::bit>
200template<
typename Unit>
205 return lhs.get_integer () == rhs.get_integer ();
208template<
typename Unit>
213 return lhs.get_integer () != rhs.get_integer ();
248template<
typename Unit>
249inline integer_with_unit<Unit>
258inline integer_with_unit<units::bit>
265inline integer_with_unit<units::bit>
274template<
typename Unit>
275inline integer_with_unit<Unit>
283template<
typename Unit>
284inline integer_with_unit<Unit>
294integer_with_unit<units::bit>
301inline integer_with_unit<units::bit>
310template<
typename Unit>
311inline integer_with_unit<Unit>
320template<
typename Unit>
321inline integer_with_unit<Unit>
382template <
typename ConcreteValueType>
392 case EQ_EXPR:
return a ==
b;
393 case NE_EXPR:
return a !=
b;
394 case GE_EXPR:
return a >=
b;
395 case LE_EXPR:
return a <=
b;
396 case GT_EXPR:
return a >
b;
397 case LT_EXPR:
return a <
b;
Definition integer-with-unit.h:33
bool operator<=(const integer_with_unit< Unit > &rhs) const
Definition integer-with-unit.h:98
static int cmp(const integer_with_unit< Unit > &lhs, const integer_with_unit< Unit > &rhs)
Definition integer-with-unit.h:64
static constexpr const char * dump_type_name
Definition integer-with-unit.h:35
integer_with_unit< Unit > & operator-=(const integer_with_unit< Unit > &rhs)
Definition integer-with-unit.h:78
void dump_to_pp(pretty_printer *pp, units::role role=units::role::generic) const
integer_with_unit< Unit > & operator++()
Definition integer-with-unit.h:85
integer_with_unit< Unit > operator-() const
Definition integer-with-unit.h:116
integer m_integer
Definition integer-with-unit.h:151
std::unique_ptr< json::object > to_json() const
integer_with_unit< Unit > & operator+=(const integer_with_unit< Unit > &rhs)
Definition integer-with-unit.h:71
integer_with_unit(int i)
Definition integer-with-unit.h:39
const integer & get_integer() const
Definition integer-with-unit.h:43
bool operator>(const integer_with_unit< Unit > &rhs) const
Definition integer-with-unit.h:104
unsigned long as_unsigned_long() const
Definition integer-with-unit.h:145
bool is_zero_p() const
Definition integer-with-unit.h:58
integer_with_unit()
Definition integer-with-unit.h:37
integer floor_div(const integer_with_unit< Unit > &other) const
Definition integer-with-unit.h:124
integer_with_unit< Unit > floor_mod(const integer_with_unit< Unit > &other) const
Definition integer-with-unit.h:132
bool operator>=(const integer_with_unit< Unit > &rhs) const
Definition integer-with-unit.h:110
bool operator<(const integer_with_unit< Unit > &rhs) const
Definition integer-with-unit.h:92
integer_with_unit(integer i)
Definition integer-with-unit.h:41
long as_long() const
Definition integer-with-unit.h:139
std::unique_ptr< diagnostics::markup::node > make_markup_node() const
bool is_one_p() const
Definition integer-with-unit.h:61
long as_long() const
Definition integer.h:252
bool is_zero_p() const
Definition integer.h:72
integer floor_mod(const integer &other) const
Definition integer.h:242
static int cmp(const integer &lhs, const integer &rhs)
Definition integer.h:98
integer floor_div(const integer &other) const
Definition integer.h:230
bool is_one_p() const
Definition integer.h:78
unsigned long as_unsigned_long() const
Definition integer.h:258
Definition pretty-print.h:241
const union tree_node * const_tree
Definition coretypes.h:98
tree_code
Definition genmatch.cc:1011
role
Definition units.h:60
@ generic
Definition units.h:61
Definition access-diagram.h:30
concrete_byte_offset round_bit_to_lowest_byte(concrete_bit_offset bit_offset)
Definition integer-with-unit.h:334
integer_with_unit< Unit > operator-(const integer_with_unit< Unit > &i)
Definition integer-with-unit.h:276
byte_size_t convert_to_byte_size_t(concrete_byte_size)
byte_offset_t convert_to_byte_offset_t(concrete_byte_offset)
offset_int byte_size_t
Definition common.h:275
integer_with_unit< units::bit > concrete_bit_offset
Definition integer-with-unit.h:329
bool operator!=(const integer_with_unit< Unit > &lhs, const integer_with_unit< Unit > &rhs)
Definition integer-with-unit.h:210
offset_int bit_offset_t
Definition common.h:272
concrete_bit_size convert_from_bit_size_t(bit_size_t)
integer_with_unit< Unit > operator+(const integer_with_unit< Unit > &lhs, const integer_with_unit< Unit > &rhs)
Definition integer-with-unit.h:250
bool operator==(const integer_with_unit< Unit > &lhs, const integer_with_unit< Unit > &rhs)
Definition integer-with-unit.h:202
bool maybe_bytes_from_bits(concrete_bit_range bits, concrete_byte_range *out)
bool eval_comparison_p(ConcreteValueType a, enum tree_code op, ConcreteValueType b)
Definition integer-with-unit.h:384
integer_with_unit< units::bit > concrete_bit_size
Definition integer-with-unit.h:328
integer_with_unit< Unit > operator*(const integer_with_unit< Unit > &lhs, const integer &rhs)
Definition integer-with-unit.h:312
integer_with_unit< units::byte > convert_from_byte_offset_t(byte_offset_t)
@ other
Definition common.h:535
concrete_bit_offset bit_within_byte(concrete_bit_offset bit_offset)
Definition integer-with-unit.h:341
offset_int byte_offset_t
Definition common.h:274
concrete_bit_range bits_from_bytes(concrete_byte_range bytes)
Definition concrete-ranges.h:121
integer_with_unit< units::byte > concrete_byte_offset
Definition integer-with-unit.h:331
bit_size_t convert_to_bit_size_t(concrete_bit_size)
bit_offset_t convert_to_bit_offset_t(concrete_bit_offset)
offset_int bit_size_t
Definition common.h:273
integer_with_unit< units::byte > convert_from_byte_size_t(byte_size_t)
integer_with_unit< units::byte > concrete_byte_size
Definition integer-with-unit.h:330
concrete_bit_offset convert_from_bit_offset_t(bit_offset_t)
bool get_type_size(const_tree type, concrete_bit_size *out)
i
Definition poly-int.h:776
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
Ca & a
Definition poly-int.h:770
Definition ira-emit.cc:158
#define gcc_unreachable()
Definition system.h:799
#define gcc_checking_assert(EXPR)
Definition system.h:779