GCC Middle and Back End API Reference
ana::symbolic::node Class Referenceabstract

#include <symbolic-nodes.h>

Inheritance diagram for ana::symbolic::node:
Collaboration diagram for ana::symbolic::node:

Public Types

using id_t = unsigned

Public Member Functions

virtual ~node ()=default
 node (const node &)=delete
 node (node &&)=delete
node & operator= (const node &)=delete
node & operator= (node &&)=delete
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 const char * get_any_dump_color () 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 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

 node (complexity c, unsigned id)
std::unique_ptr< json::object > make_json_obj (const char *type_name) const

Private Member Functions

virtual void print_dump_widget_label (pretty_printer *pp) const =0
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

Detailed Description

Abstract base class for the various tree-like purely-functional
data structures we use during symbolic execution.

Instances are owned by a manager and reused, with memoization/caching
(compare to "hash consing" and value numbering).

Instances have a complexity and a numeric ID.

Has hierarchical dumping for debugging how nodes are built from other
nodes.

Has a node_visitor class for walking the object hierarchy.

Can convert itself to json for debugging/SARIF.   

Member Typedef Documentation

◆ id_t

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

Constructor & Destructor Documentation

◆ ~node()

virtual ana::symbolic::node::~node ( )
virtualdefault

◆ node() [1/3]

ana::symbolic::node::node ( const node & )
delete

◆ node() [2/3]

ana::symbolic::node::node ( node && )
delete

◆ node() [3/3]

ana::symbolic::node::node ( complexity c,
unsigned id )
inlineprotected

References m_complexity, and m_id.

Member Function Documentation

◆ accept_node_visitor()

virtual void ana::symbolic::node::accept_node_visitor ( node_visitor & v) const
pure virtual

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 )
inlinestatic

References get_id().

◆ cmp_ids()

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

◆ cmp_ptr_ptr()

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

◆ dump()

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

◆ dump_to_logger()

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

◆ dump_to_pp()

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

◆ end_any_dump_color()

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

◆ get_any_dump_color()

◆ get_complexity()

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

◆ get_id()

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

References m_id.

Referenced by cmp().

◆ get_text_art_tree_style()

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

◆ involves_p()

bool ana::symbolic::node::involves_p ( const symbolic::node & other) 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

◆ make_json_obj()

std::unique_ptr< json::object > ana::symbolic::node::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 virtual

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=() [1/2]

node & ana::symbolic::node::operator= ( const node & )
delete

◆ operator=() [2/2]

node & ana::symbolic::node::operator= ( node && )
delete

◆ print_dump_widget_label()

◆ start_any_dump_color()

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

◆ to_json()

virtual std::unique_ptr< json::object > ana::symbolic::node::to_json ( ) const
pure virtual

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
private

Referenced by get_complexity(), and node().

◆ m_id

id_t ana::symbolic::node::m_id
private

Referenced by get_id(), and node().


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