|
GCC Middle and Back End API Reference
|
#include <symbolic-bit-vectors.h>


Public Types | |
| enum class | kind { concat , conjured , cropped , empty , named_test , poisoned , repeated , svalue , from_ubc , tristate } |
| using | id_t = unsigned |
Static Public Member Functions | |
| static const bit_vector * | can_merge_p (const bit_vector &bv_a, const bit_vector &bv_b, tree type, model_merger *merger) |
| static int | cmp_ids (const symbolic::node *s1, const symbolic::node *s2) |
| static int | cmp (const symbolic::node &s1, const symbolic::node &s2) |
| static int | cmp_ptr_ptr (const void *, const void *) |
Protected Member Functions | |
| bit_vector (bit_vector_manager &mgr, complexity c, const symbolic_bit_size &size_in_bits) | |
| std::unique_ptr< json::object > | make_json_obj (const char *type_name) const |
Protected Attributes | |
| bit_vector_manager & | m_bv_mgr |
| const symbolic_bit_size & | m_size_in_bits |
Private Member Functions | |
| virtual void | add_dump_widget_children (text_art::tree_widget &, node_dump_state &nds) const =0 |
Private Attributes | |
| complexity | m_complexity |
| id_t | m_id |
An abstract base class representing the contents of a buffer of memory,
where the size is a symbolic_bit_size.
Consider:
| size_t len_a = strlen (a));
| size_t len_b = strlen (b));
|
| memcpy (buf, a, len_a);
| memcpy (buf + len_a, b, len_b);
| buf[len_a + len_b] = '\0';
and then trying to analyze the contents of "buf". If len_a is known
concretely as 10 bytes, but len_b is only known symbolically, the contents
of buf might be represented as a symbolic::bit_vector as the
concatenation of:
- [buffer_a's bytes [0-10)],
- [buffer_b's [bytes 0-'len_b')],
- [8 zero bits])
with size (11 + 'len_b') bytes (see selftest::test_example_strcat for
a worked example similar to the above).
bit_vectors can be concatenated, cropped, and repeated (with folding of
various identities during these operations).
The class hierarchy looks like this (using indentation to show
inheritance, and with kinds shown for the concrete subclasses):
symbolic::bit_vector
concat_bit_vector (kind::concat): the concatenation of a vector of child bit_vectors
conjured_bit_vector (kind::conjured): a bit vector arising from a stmt
cropped_bit_vector (kind::cropped): another bit_vector, cropped and offset
named_test_bit_vector (kind::named_test): an unfoldable bit_vector for use in selftests
repeated_bit_vector (kind::repeated): repeating a bit_vector some number of times
bit_vector_from_svalue (kind::svalue): the bit representation of an svalue on the target
bit_vector_from_ubc (kind::from_ubc): a range of bits within an unfoldable_bit_contents
uniform_bit_vector (abstract): a bit vector that is "the same bit" everywhere
empty_bit_vector (kind::empty): the empty bit vector
poisoned_bit_vector (kind::poisoned): unusable data
tristate_bit_vector (kind::tristate): a range of bits that are all true/false/unknown.
|
inherited |
|
strong |
|
inlinevirtual |
|
protected |
Referenced by ana::symbolic::bit_vector_from_svalue::accept_node_visitor(), can_merge_p(), ana::symbolic::cropped_bit_vector::cropped_bit_vector(), get_byte_at_offset(), get_byte_at_offset(), get_cropped_bits(), get_cropped_bits(), get_cropped_bytes(), get_cropped_bytes(), get_prefix(), get_prefix(), get_suffix(), get_suffix(), get_tristate_at_offset(), ana::symbolic::concat_bit_vector::implicitly_live_p(), ana::symbolic::cropped_bit_vector::implicitly_live_p(), ana::symbolic::cropped_bit_vector::key::key(), ana::symbolic::repeated_bit_vector::key::key(), maybe_as_uint8(), ana::symbolic::bit_vector_from_svalue::maybe_fold_crop_from_bitmask(), ana::symbolic::bit_vector_from_svalue::maybe_fold_crop_from_cst(), operator==(), ana::symbolic::repeated_bit_vector::repeated_bit_vector(), and ana::symbolic::uniform_bit_vector::uniform_bit_vector().
|
pure virtualinherited |
Implemented in ana::alloca_region, ana::asm_output_svalue, ana::binop_svalue, ana::bit_range_region, ana::cast_region, ana::code_region, ana::const_fn_result_svalue, ana::constant_svalue, ana::decl_region, ana::element_region, ana::errno_region, ana::field_region, ana::frame_region, ana::function_region, ana::globals_region, ana::heap_allocated_region, ana::heap_region, ana::initial_svalue, ana::label_region, ana::offset_region, ana::placeholder_svalue, ana::pointer_svalue, ana::poisoned_svalue, ana::private_region, ana::root_region, ana::setjmp_svalue, ana::sized_region, ana::stack_region, ana::string_region, ana::svalue_from_bit_vector, ana::symbolic::baseline_bit_contents, ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::bits_from_bytes_scalar, ana::symbolic::concat_bit_vector, ana::symbolic::concrete_bit_overlay, ana::symbolic::concrete_scalar< ConcreteValueType >, ana::symbolic::conjured_bit_contents, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::offset_bit_contents, ana::symbolic::poisoned_bit_vector, ana::symbolic::product< ConcreteValueType >, ana::symbolic::repeated_bit_vector, ana::symbolic::scalar_from_svalue< ConcreteValueType >, ana::symbolic::sum< ConcreteValueType >, ana::symbolic::symbolic_bit_overlay, ana::symbolic::tristate_bit_vector, ana::symbolic::uninit_contents, ana::symbolic::untracked_bit_contents, ana::symbolic::zero_contents, ana::symbolic_region, ana::thread_local_region, ana::unaryop_svalue, ana::unknown_region, ana::unknown_svalue, ana::unmergeable_svalue, ana::var_arg_region, and ana::widening_svalue.
Referenced by infinite_recursion_diagnostic::expr_uses_conjured_value_p().
|
privatepure virtualinherited |
Implemented in ana::asm_output_svalue, ana::binop_svalue, ana::const_fn_result_svalue, ana::initial_svalue, ana::pointer_svalue, ana::region, ana::setjmp_svalue, ana::svalue, ana::svalue_from_bit_vector, ana::symbolic::baseline_bit_contents, ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::bits_from_bytes_scalar, ana::symbolic::concat_bit_vector, ana::symbolic::concrete_bit_overlay, ana::symbolic::concrete_scalar< ConcreteValueType >, ana::symbolic::conjured_bit_contents, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::offset_bit_contents, ana::symbolic::poisoned_bit_vector, ana::symbolic::product< ConcreteValueType >, ana::symbolic::repeated_bit_vector, ana::symbolic::scalar_from_svalue< ConcreteValueType >, ana::symbolic::sum< ConcreteValueType >, ana::symbolic::symbolic_bit_overlay, ana::symbolic::tristate_bit_vector, ana::symbolic::uninit_contents, ana::symbolic::untracked_bit_contents, ana::symbolic::zero_contents, ana::unaryop_svalue, ana::unmergeable_svalue, and ana::widening_svalue.
|
static |
References bit_vector().
|
inlinestaticinherited |
References get_id().
|
staticinherited |
|
staticinherited |
|
virtual |
Reimplemented in ana::symbolic::bit_vector_from_ubc, and ana::symbolic::conjured_bit_vector.
| bool ana::symbolic::bit_vector::derived_from_initial_value_p | ( | ) | const |
|
inherited |
|
inherited |
|
inherited |
|
inlinefinaloverridevirtual |
Reimplemented from ana::symbolic::value_node.
References final().
|
inlinevirtual |
Reimplemented in ana::symbolic::bit_vector_from_svalue.
|
inlinevirtual |
Reimplemented in ana::symbolic::bit_vector_from_ubc.
|
inlinevirtual |
Reimplemented in ana::symbolic::concat_bit_vector.
|
inlinevirtual |
Reimplemented in ana::symbolic::conjured_bit_vector.
Referenced by infinite_recursion_diagnostic::expr_uses_conjured_value_p().
|
inlinevirtual |
Reimplemented in ana::symbolic::cropped_bit_vector.
|
inlinevirtual |
Reimplemented in ana::symbolic::empty_bit_vector.
|
inlinevirtual |
Reimplemented in ana::symbolic::poisoned_bit_vector.
|
inlinevirtual |
Reimplemented in ana::symbolic::repeated_bit_vector.
|
inlinevirtualinherited |
Reimplemented in ana::svalue.
|
inlinevirtual |
Reimplemented in ana::symbolic::tristate_bit_vector.
Referenced by contains_unknown_p().
|
inlinevirtual |
|
inherited |
|
pure virtualinherited |
Implemented in ana::svalue, ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::concat_bit_vector, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::poisoned_bit_vector, ana::symbolic::repeated_bit_vector, ana::symbolic::scalar< ConcreteValueType >, ana::symbolic::scalar< ana::integer >, ana::symbolic::scalar< integer >, ana::symbolic::scalar< integer_with_unit< units::bit > >, ana::symbolic::scalar< integer_with_unit< units::byte > >, and ana::symbolic::tristate_bit_vector.
|
inlineoverridevirtual |
Reimplemented from ana::symbolic::node.
|
inline |
References m_bv_mgr.
| const bit_vector & ana::symbolic::bit_vector::get_byte_at_offset | ( | const concrete_byte_offset & | byte_offset | ) | const |
References bit_vector().
| const bit_vector & ana::symbolic::bit_vector::get_byte_at_offset | ( | const symbolic_byte_offset & | byte_offset | ) | const |
References bit_vector().
|
inlineinherited |
References m_complexity.
Referenced by ana::binop_svalue::binop_svalue(), ana::pointer_svalue::pointer_svalue(), and ana::widening_svalue::widening_svalue().
| const bit_vector & ana::symbolic::bit_vector::get_cropped_bits | ( | const concrete_bit_range & | bits_to_use | ) | const |
References bit_vector().
| const bit_vector & ana::symbolic::bit_vector::get_cropped_bits | ( | const symbolic_bit_range & | bits_to_use | ) | const |
References bit_vector().
| const bit_vector & ana::symbolic::bit_vector::get_cropped_bytes | ( | const concrete_byte_range & | bytes_to_use | ) | const |
References bit_vector().
| const bit_vector & ana::symbolic::bit_vector::get_cropped_bytes | ( | const symbolic_byte_range & | bytes_to_use | ) | const |
References bit_vector().
|
pure virtual |
Implemented in ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::concat_bit_vector, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::poisoned_bit_vector, ana::symbolic::repeated_bit_vector, and ana::symbolic::tristate_bit_vector.
| const bit_vector & ana::symbolic::bit_vector::get_prefix | ( | const concrete_bit_size & | size | ) | const |
References bit_vector().
|
inline |
References ana::bits_from_bytes(), and get_prefix().
| const bit_vector & ana::symbolic::bit_vector::get_prefix | ( | const symbolic_bit_size & | size | ) | const |
References bit_vector().
Referenced by get_prefix(), and get_prefix().
|
inline |
References ana::bits_from_bytes(), and get_prefix().
|
inline |
References m_size_in_bits.
Referenced by ana::symbolic::cropped_bit_vector::get_uncropped_bits_to_use().
| const bit_vector & ana::symbolic::bit_vector::get_suffix | ( | const concrete_bit_size & | size | ) | const |
References bit_vector().
|
inline |
References ana::bits_from_bytes(), and get_suffix().
| const bit_vector & ana::symbolic::bit_vector::get_suffix | ( | const symbolic_bit_size & | size | ) | const |
References bit_vector().
Referenced by get_suffix(), and get_suffix().
|
inline |
References ana::bits_from_bytes(), and get_suffix().
|
inherited |
| tristate ana::symbolic::bit_vector::get_tristate_at_offset | ( | const concrete_bit_offset & | bit | ) | const |
References bit_vector().
|
virtual |
Reimplemented in ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::concat_bit_vector, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::poisoned_bit_vector, and ana::symbolic::tristate_bit_vector.
| void ana::symbolic::bit_vector::hexdump | ( | ) | const |
| void ana::symbolic::bit_vector::hexdump | ( | const hexdump_options & | hexdump_opts | ) | const |
| void ana::symbolic::bit_vector::hexdump_to_pp | ( | pretty_printer * | , |
| const hexdump_options & | hexdump_opts ) const |
|
virtualinherited |
Reimplemented in ana::binop_svalue, ana::constant_svalue, ana::initial_svalue, ana::pointer_svalue, ana::svalue_from_bit_vector, ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::concat_bit_vector, ana::symbolic::cropped_bit_vector, ana::unaryop_svalue, and ana::unmergeable_svalue.
|
inherited |
|
inherited |
|
protected |
|
pure virtualinherited |
Implemented in ana::alloca_region, ana::asm_output_svalue, ana::binop_svalue, ana::bit_range_region, ana::cast_region, ana::code_region, ana::const_fn_result_svalue, ana::constant_svalue, ana::decl_region, ana::element_region, ana::errno_region, ana::field_region, ana::frame_region, ana::function_region, ana::globals_region, ana::heap_allocated_region, ana::heap_region, ana::initial_svalue, ana::label_region, ana::offset_region, ana::placeholder_svalue, ana::pointer_svalue, ana::poisoned_svalue, ana::private_region, ana::root_region, ana::setjmp_svalue, ana::sized_region, ana::stack_region, ana::string_region, ana::svalue_from_bit_vector, ana::symbolic::baseline_bit_contents, ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::bits_from_bytes_scalar, ana::symbolic::concat_bit_vector, ana::symbolic::concrete_bit_overlay, ana::symbolic::concrete_scalar< ConcreteValueType >, ana::symbolic::conjured_bit_contents, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::offset_bit_contents, ana::symbolic::poisoned_bit_vector, ana::symbolic::product< ConcreteValueType >, ana::symbolic::repeated_bit_vector, ana::symbolic::scalar_from_svalue< ConcreteValueType >, ana::symbolic::sum< ConcreteValueType >, ana::symbolic::symbolic_bit_overlay, ana::symbolic::tristate_bit_vector, ana::symbolic::uninit_contents, ana::symbolic::untracked_bit_contents, ana::symbolic::zero_contents, ana::symbolic_region, ana::thread_local_region, ana::unaryop_svalue, ana::unknown_region, ana::unknown_svalue, ana::unmergeable_svalue, ana::var_arg_region, and ana::widening_svalue.
| bool ana::symbolic::bit_vector::maybe_as_uint8 | ( | uint8_t * | out | ) | const |
References bit_vector().
|
virtual |
| bool ana::symbolic::bit_vector::maybe_get_concrete_size_in_bits | ( | concrete_bit_size * | out | ) | const |
| bool ana::symbolic::bit_vector::maybe_get_concrete_size_in_bytes | ( | concrete_byte_size * | out | ) | const |
| bool ana::symbolic::bit_vector::maybe_get_irange_bitmask | ( | irange_bitmask * | out | ) | const |
| const symbolic_byte_size * ana::symbolic::bit_vector::maybe_get_size_in_bytes | ( | ) | const |
|
virtual |
Reimplemented in ana::symbolic::bit_vector_from_svalue.
|
inline |
References bit_vector(), and ana::other.
|
inlinevirtual |
Reimplemented in ana::symbolic::cropped_bit_vector, ana::symbolic::poisoned_bit_vector, and ana::symbolic::tristate_bit_vector.
|
finaloverridevirtual |
Implements ana::symbolic::node.
|
pure virtual |
Implemented in ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::concat_bit_vector, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::poisoned_bit_vector, ana::symbolic::repeated_bit_vector, and ana::symbolic::tristate_bit_vector.
|
pure virtual |
Implemented in ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::concat_bit_vector, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::poisoned_bit_vector, ana::symbolic::repeated_bit_vector, and ana::symbolic::tristate_bit_vector.
|
inherited |
|
pure virtualinherited |
Implemented in ana::alloca_region, ana::asm_output_svalue, ana::binop_svalue, ana::bit_range_region, ana::cast_region, ana::code_region, ana::const_fn_result_svalue, ana::constant_svalue, ana::decl_region, ana::element_region, ana::errno_region, ana::field_region, ana::frame_region, ana::function_region, ana::globals_region, ana::heap_allocated_region, ana::heap_region, ana::initial_svalue, ana::label_region, ana::offset_region, ana::placeholder_svalue, ana::pointer_svalue, ana::poisoned_svalue, ana::private_region, ana::root_region, ana::setjmp_svalue, ana::sized_region, ana::stack_region, ana::string_region, ana::svalue_from_bit_vector, ana::symbolic::baseline_bit_contents, ana::symbolic::bit_vector_from_svalue, ana::symbolic::bit_vector_from_ubc, ana::symbolic::bits_from_bytes_scalar, ana::symbolic::concat_bit_vector, ana::symbolic::concrete_bit_overlay, ana::symbolic::concrete_scalar< ConcreteValueType >, ana::symbolic::conjured_bit_contents, ana::symbolic::conjured_bit_vector, ana::symbolic::cropped_bit_vector, ana::symbolic::empty_bit_vector, ana::symbolic::offset_bit_contents, ana::symbolic::poisoned_bit_vector, ana::symbolic::product< ConcreteValueType >, ana::symbolic::repeated_bit_vector, ana::symbolic::scalar_from_svalue< ConcreteValueType >, ana::symbolic::sum< ConcreteValueType >, ana::symbolic::symbolic_bit_overlay, ana::symbolic::tristate_bit_vector, ana::symbolic::uninit_contents, ana::symbolic::untracked_bit_contents, ana::symbolic::zero_contents, ana::symbolic_region, ana::thread_local_region, ana::unaryop_svalue, ana::unknown_region, ana::unknown_svalue, ana::unmergeable_svalue, ana::var_arg_region, and ana::widening_svalue.
|
protected |
Referenced by get_bit_vector_manager().
|
privateinherited |
Referenced by get_complexity(), and node().
|
protected |
Referenced by get_size().