GCC Middle and Back End API Reference
ana::symbolic::scalar< ConcreteValueType > Class Template Referenceabstract

#include <symbolic-scalars.h>

Inheritance diagram for ana::symbolic::scalar< ConcreteValueType >:
Collaboration diagram for ana::symbolic::scalar< ConcreteValueType >:

Public Types

enum class  kind {
  concrete , sum , product , from_svalue ,
  named_test , bits_from_bytes
}
using id_t = unsigned

Public Member Functions

virtual ~scalar ()=default
scalar_manager< ConcreteValueType > & get_mgr () const
enum kind get_kind () const
virtual const concrete_scalar< ConcreteValueType > * dyn_cast_concrete_scalar () const
virtual const sum< ConcreteValueType > * dyn_cast_sum () const
virtual const product< ConcreteValueType > * dyn_cast_product () const
virtual const scalar_from_svalue< ConcreteValueType > * dyn_cast_scalar_from_svalue () const
virtual const bits_from_bytes_scalar * dyn_cast_bits_from_bytes_scalar () const
virtual void dump_inline_to_pp (pretty_printer *pp, enum units::role) const =0
iter_result for_each_svalue (iter_result(*)(const svalue &sval, void *user_data), void *) const final override
const char * get_any_dump_color () const override
bool is_zero_p () const
bool is_one_p () const
bool is_unknown_p () const
bool operator== (const scalar< ConcreteValueType > &other) const
bool operator!= (const scalar< ConcreteValueType > &other) const
bool operator< (const scalar< ConcreteValueType > &other) const
bool operator<= (const scalar< ConcreteValueType > &other) const
bool operator> (const scalar< ConcreteValueType > &other) const
bool operator>= (const scalar< ConcreteValueType > &other) const
virtual bool implicitly_live_p (liveness_context &liveness_ctxt) const
virtual const svalue * dyn_cast_svalue () const
virtual const bit_vector * dyn_cast_bit_vector () const
const complexity & get_complexity () const
id_t get_id () const
void dump_to_pp (pretty_printer *pp, bool show_ids=true, bool elide_repeated_nodes=true) const
void dump_to_logger (logger &) const
void dump () const
std::unique_ptr< text_art::tree_widget > make_dump_widget (node_dump_state &nds, const char *prefix=nullptr) const
virtual void accept_node_visitor (node_visitor &v) const =0
virtual std::unique_ptr< json::object > to_json () const =0
virtual std::unique_ptr< diagnostics::markup::node > make_markup_node (markup_context &markup_ctxt) const =0
bool involves_p (const symbolic::node &other) const
void start_any_dump_color (pretty_printer *pp) const
void end_any_dump_color (pretty_printer *pp) const
text_art::style get_text_art_tree_style () const

Static Public Member Functions

static bool get_total_ordering (const scalar< ConcreteValueType > &a, enum tree_code op, const scalar< ConcreteValueType > &b, const region_model *model)
static tristate get_partial_ordering (const scalar< ConcreteValueType > &a, enum tree_code op, const scalar< ConcreteValueType > &b, const region_model *model)
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

 scalar (complexity c, unsigned id, scalar_manager< ConcreteValueType > &mgr, enum kindkind kindkind)
std::unique_ptr< json::object > make_json_obj (const char *type_name) const

Private Member Functions

void print_dump_widget_label (pretty_printer *pp) const final override
virtual void print_dump_widget_label_for_scalar (pretty_printer *pp) const =0
virtual void add_dump_widget_children (text_art::tree_widget &, node_dump_state &nds) const =0

Private Attributes

scalar_manager< ConcreteValueType > & m_mgr
enum kind m_kind
complexity m_complexity
id_t m_id

Detailed Description

template<typename ConcreteValueType>
class ana::symbolic::scalar< ConcreteValueType >
symbolic::scalar

The class hierarchy looks like this (using indentation to show
inheritance):

scalar: abstract base class
  concrete: a value of ConcreteValueType
  sum: the sum of two of more scalars
  product: the product of a scalar and a dimensionless scalar
  scalar_from_svalue: a scalar derived from an svalue
  named_test: a placeholder for use in selftests
  bits_from_bytes_scalar: converting a scalar measured in bits
    into one measured in bytes.   

Member Typedef Documentation

◆ id_t

using ana::symbolic::node::id_t = unsigned
inherited

Member Enumeration Documentation

◆ kind

template<typename ConcreteValueType>
enum class ana::symbolic::scalar::kind
strong
Enumerator
concrete 
sum 
product 
from_svalue 
named_test 
bits_from_bytes 

Constructor & Destructor Documentation

◆ ~scalar()

template<typename ConcreteValueType>
virtual ana::symbolic::scalar< ConcreteValueType >::~scalar ( )
virtualdefault

◆ scalar()

Member Function Documentation

◆ accept_node_visitor()

virtual void ana::symbolic::node::accept_node_visitor ( node_visitor & v) const
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().

◆ add_dump_widget_children()

◆ cmp()

int ana::symbolic::node::cmp ( const symbolic::node & s1,
const symbolic::node & s2 )
inlinestaticinherited

References get_id().

◆ cmp_ids()

int ana::symbolic::node::cmp_ids ( const symbolic::node * s1,
const symbolic::node * s2 )
staticinherited

◆ cmp_ptr_ptr()

int ana::symbolic::node::cmp_ptr_ptr ( const void * ,
const void *  )
staticinherited

◆ dump()

void ana::symbolic::node::dump ( ) const
inherited

◆ dump_inline_to_pp()

◆ dump_to_logger()

void ana::symbolic::node::dump_to_logger ( logger & ) const
inherited

◆ dump_to_pp()

void ana::symbolic::node::dump_to_pp ( pretty_printer * pp,
bool show_ids = true,
bool elide_repeated_nodes = true ) const
inherited

◆ dyn_cast_bit_vector()

virtual const bit_vector * ana::symbolic::value_node::dyn_cast_bit_vector ( ) const
inlinevirtualinherited

Reimplemented in ana::symbolic::bit_vector.

◆ dyn_cast_bits_from_bytes_scalar()

template<typename ConcreteValueType>
virtual const bits_from_bytes_scalar * ana::symbolic::scalar< ConcreteValueType >::dyn_cast_bits_from_bytes_scalar ( ) const
inlinevirtual

◆ dyn_cast_concrete_scalar()

template<typename ConcreteValueType>
virtual const concrete_scalar< ConcreteValueType > * ana::symbolic::scalar< ConcreteValueType >::dyn_cast_concrete_scalar ( ) const
inlinevirtual

◆ dyn_cast_product()

template<typename ConcreteValueType>
virtual const product< ConcreteValueType > * ana::symbolic::scalar< ConcreteValueType >::dyn_cast_product ( ) const
inlinevirtual

◆ dyn_cast_scalar_from_svalue()

template<typename ConcreteValueType>
virtual const scalar_from_svalue< ConcreteValueType > * ana::symbolic::scalar< ConcreteValueType >::dyn_cast_scalar_from_svalue ( ) const
inlinevirtual

◆ dyn_cast_sum()

template<typename ConcreteValueType>
virtual const sum< ConcreteValueType > * ana::symbolic::scalar< ConcreteValueType >::dyn_cast_sum ( ) const
inlinevirtual

◆ dyn_cast_svalue()

virtual const svalue * ana::symbolic::value_node::dyn_cast_svalue ( ) const
inlinevirtualinherited

Reimplemented in ana::svalue.

◆ end_any_dump_color()

void ana::symbolic::node::end_any_dump_color ( pretty_printer * pp) const
inherited

◆ for_each_svalue()

template<typename ConcreteValueType>
iter_result ana::symbolic::scalar< ConcreteValueType >::for_each_svalue ( iter_result(*  )(const svalue &sval, void *user_data),
void *  ) const
inlinefinaloverridevirtual

◆ get_any_dump_color()

template<typename ConcreteValueType>
const char * ana::symbolic::scalar< ConcreteValueType >::get_any_dump_color ( ) const
inlineoverridevirtual

Reimplemented from ana::symbolic::node.

◆ get_complexity()

const complexity & ana::symbolic::node::get_complexity ( ) const
inlineinherited

◆ get_id()

id_t ana::symbolic::node::get_id ( ) const
inlineinherited

References m_id.

Referenced by cmp().

◆ get_kind()

template<typename ConcreteValueType>
enum kind ana::symbolic::scalar< ConcreteValueType >::get_kind ( ) const
inline

◆ get_mgr()

template<typename ConcreteValueType>
scalar_manager< ConcreteValueType > & ana::symbolic::scalar< ConcreteValueType >::get_mgr ( ) const
inline

Referenced by ana::bits_from_bytes().

◆ get_partial_ordering()

template<typename ConcreteValueType>
tristate ana::symbolic::scalar< ConcreteValueType >::get_partial_ordering ( const scalar< ConcreteValueType > & a,
enum tree_code op,
const scalar< ConcreteValueType > & b,
const region_model * model )
static

◆ get_text_art_tree_style()

text_art::style ana::symbolic::node::get_text_art_tree_style ( ) const
inherited

◆ get_total_ordering()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::get_total_ordering ( const scalar< ConcreteValueType > & a,
enum tree_code op,
const scalar< ConcreteValueType > & b,
const region_model * model )
static

◆ implicitly_live_p()

◆ involves_p()

bool ana::symbolic::node::involves_p ( const symbolic::node & other) const
inherited

◆ is_one_p()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::is_one_p ( ) const

◆ is_unknown_p()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::is_unknown_p ( ) const

◆ is_zero_p()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::is_zero_p ( ) const

◆ make_dump_widget()

std::unique_ptr< text_art::tree_widget > ana::symbolic::node::make_dump_widget ( node_dump_state & nds,
const char * prefix = nullptr ) const
inherited

◆ make_json_obj()

template<typename ConcreteValueType>
std::unique_ptr< json::object > ana::symbolic::scalar< ConcreteValueType >::make_json_obj ( const char * type_name) const
protected

◆ make_markup_node()

virtual std::unique_ptr< diagnostics::markup::node > ana::symbolic::node::make_markup_node ( markup_context & markup_ctxt) const
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.

◆ operator!=()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::operator!= ( const scalar< ConcreteValueType > & other) const
inline

◆ operator<()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::operator< ( const scalar< ConcreteValueType > & other) const
inline

◆ operator<=()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::operator<= ( const scalar< ConcreteValueType > & other) const
inline

◆ operator==()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::operator== ( const scalar< ConcreteValueType > & other) const
inline

◆ operator>()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::operator> ( const scalar< ConcreteValueType > & other) const
inline

◆ operator>=()

template<typename ConcreteValueType>
bool ana::symbolic::scalar< ConcreteValueType >::operator>= ( const scalar< ConcreteValueType > & other) const
inline

◆ print_dump_widget_label()

template<typename ConcreteValueType>
void ana::symbolic::scalar< ConcreteValueType >::print_dump_widget_label ( pretty_printer * pp) const
finaloverrideprivatevirtual

Implements ana::symbolic::node.

◆ print_dump_widget_label_for_scalar()

template<typename ConcreteValueType>
virtual void ana::symbolic::scalar< ConcreteValueType >::print_dump_widget_label_for_scalar ( pretty_printer * pp) const
privatepure virtual

◆ start_any_dump_color()

void ana::symbolic::node::start_any_dump_color ( pretty_printer * pp) const
inherited

◆ to_json()

virtual std::unique_ptr< json::object > ana::symbolic::node::to_json ( ) const
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.

Field Documentation

◆ m_complexity

complexity ana::symbolic::node::m_complexity
privateinherited

Referenced by get_complexity(), and node().

◆ m_id

id_t ana::symbolic::node::m_id
privateinherited

Referenced by get_id(), and node().

◆ m_kind

template<typename ConcreteValueType>
enum kind ana::symbolic::scalar< ConcreteValueType >::m_kind
private

◆ m_mgr

template<typename ConcreteValueType>
scalar_manager<ConcreteValueType>& ana::symbolic::scalar< ConcreteValueType >::m_mgr
private

The documentation for this class was generated from the following files: