GCC Middle and Back End API Reference
ana::constraint_manager Class Reference

#include <constraint-manager.h>

Collaboration diagram for ana::constraint_manager:

Public Member Functions

 constraint_manager (region_model_manager *mgr)
 
 constraint_manager (const constraint_manager &other)
 
virtual ~constraint_manager ()
 
constraint_manageroperator= (const constraint_manager &other)
 
hashval_t hash () const
 
bool operator== (const constraint_manager &other) const
 
bool operator!= (const constraint_manager &other) const
 
void print (pretty_printer *pp) const
 
void dump_to_pp (pretty_printer *pp, bool multiline) const
 
void dump (FILE *fp) const
 
void dump () const
 
json::objectto_json () const
 
const equiv_classget_equiv_class_by_index (unsigned idx) const
 
equiv_classget_equiv_class_by_index (unsigned idx)
 
equiv_classget_equiv_class (const svalue *sval)
 
bool add_constraint (const svalue *lhs, enum tree_code op, const svalue *rhs)
 
bool add_constraint (equiv_class_id lhs_ec_id, enum tree_code op, equiv_class_id rhs_ec_id)
 
void add_unknown_constraint (equiv_class_id lhs_ec_id, enum tree_code op, equiv_class_id rhs_ec_id)
 
bool add_bounded_ranges (const svalue *sval, const bounded_ranges *ranges)
 
bool get_equiv_class_by_svalue (const svalue *sval, equiv_class_id *out) const
 
bool sval_constrained_p (const svalue *sval) const
 
equiv_class_id get_or_add_equiv_class (const svalue *sval)
 
tristate eval_condition (equiv_class_id lhs, enum tree_code op, equiv_class_id rhs) const
 
tristate eval_condition (equiv_class_id lhs_ec, enum tree_code op, tree rhs_const) const
 
tristate eval_condition (const svalue *lhs, enum tree_code op, const svalue *rhs) const
 
range get_ec_bounds (equiv_class_id ec_id) const
 
template<typename PurgeCriteria >
void purge (const PurgeCriteria &p, purge_stats *stats)
 
void on_liveness_change (const svalue_set &live_svalues, const region_model *model)
 
void purge_state_involving (const svalue *sval)
 
void canonicalize ()
 
void for_each_fact (fact_visitor *) const
 
void validate () const
 
bounded_ranges_managerget_range_manager () const
 
bool replay_call_summary (call_summary_replay &r, const constraint_manager &summary)
 

Static Public Member Functions

static void merge (const constraint_manager &cm_a, const constraint_manager &cm_b, constraint_manager *out)
 

Data Fields

auto_delete_vec< equiv_classm_equiv_classes
 
auto_vec< constraintm_constraints
 
auto_vec< bounded_ranges_constraintm_bounded_ranges_constraints
 

Private Member Functions

void add_constraint_internal (equiv_class_id lhs_id, enum constraint_op c_op, equiv_class_id rhs_id)
 
bool impossible_derived_conditions_p (const svalue *lhs, const svalue *rhs) const
 

Private Attributes

region_model_managerm_mgr
 

Detailed Description

A collection of equivalence classes and constraints on them.

Given N svalues, this can be thought of as representing a subset of
N-dimensional space.  When we call add_constraint,
we are effectively taking an intersection with that constraint.   

Constructor & Destructor Documentation

◆ constraint_manager() [1/2]

ana::constraint_manager::constraint_manager ( region_model_manager * mgr)
inline

◆ constraint_manager() [2/2]

ana::constraint_manager::constraint_manager ( const constraint_manager & other)

◆ ~constraint_manager()

virtual ana::constraint_manager::~constraint_manager ( )
inlinevirtual

Member Function Documentation

◆ add_bounded_ranges()

bool ana::constraint_manager::add_bounded_ranges ( const svalue * sval,
const bounded_ranges * ranges )

◆ add_constraint() [1/2]

bool ana::constraint_manager::add_constraint ( const svalue * lhs,
enum tree_code op,
const svalue * rhs )

◆ add_constraint() [2/2]

bool ana::constraint_manager::add_constraint ( equiv_class_id lhs_ec_id,
enum tree_code op,
equiv_class_id rhs_ec_id )

◆ add_constraint_internal()

void ana::constraint_manager::add_constraint_internal ( equiv_class_id lhs_id,
enum constraint_op c_op,
equiv_class_id rhs_id )
private

◆ add_unknown_constraint()

void ana::constraint_manager::add_unknown_constraint ( equiv_class_id lhs_ec_id,
enum tree_code op,
equiv_class_id rhs_ec_id )

◆ canonicalize()

void ana::constraint_manager::canonicalize ( )

◆ dump() [1/2]

void ana::constraint_manager::dump ( ) const

◆ dump() [2/2]

void ana::constraint_manager::dump ( FILE * fp) const

◆ dump_to_pp()

void ana::constraint_manager::dump_to_pp ( pretty_printer * pp,
bool multiline ) const

◆ eval_condition() [1/3]

tristate ana::constraint_manager::eval_condition ( const svalue * lhs,
enum tree_code op,
const svalue * rhs ) const

◆ eval_condition() [2/3]

tristate ana::constraint_manager::eval_condition ( equiv_class_id lhs,
enum tree_code op,
equiv_class_id rhs ) const

◆ eval_condition() [3/3]

tristate ana::constraint_manager::eval_condition ( equiv_class_id lhs_ec,
enum tree_code op,
tree rhs_const ) const

◆ for_each_fact()

void ana::constraint_manager::for_each_fact ( fact_visitor * ) const

◆ get_ec_bounds()

range ana::constraint_manager::get_ec_bounds ( equiv_class_id ec_id) const

◆ get_equiv_class()

equiv_class & ana::constraint_manager::get_equiv_class ( const svalue * sval)
inline

◆ get_equiv_class_by_index() [1/2]

equiv_class & ana::constraint_manager::get_equiv_class_by_index ( unsigned idx)
inline

References m_equiv_classes.

◆ get_equiv_class_by_index() [2/2]

const equiv_class & ana::constraint_manager::get_equiv_class_by_index ( unsigned idx) const
inline

References m_equiv_classes.

◆ get_equiv_class_by_svalue()

bool ana::constraint_manager::get_equiv_class_by_svalue ( const svalue * sval,
equiv_class_id * out ) const

◆ get_or_add_equiv_class()

equiv_class_id ana::constraint_manager::get_or_add_equiv_class ( const svalue * sval)

Referenced by get_equiv_class().

◆ get_range_manager()

bounded_ranges_manager * ana::constraint_manager::get_range_manager ( ) const

◆ hash()

hashval_t ana::constraint_manager::hash ( ) const

◆ impossible_derived_conditions_p()

bool ana::constraint_manager::impossible_derived_conditions_p ( const svalue * lhs,
const svalue * rhs ) const
private

◆ merge()

static void ana::constraint_manager::merge ( const constraint_manager & cm_a,
const constraint_manager & cm_b,
constraint_manager * out )
static

◆ on_liveness_change()

void ana::constraint_manager::on_liveness_change ( const svalue_set & live_svalues,
const region_model * model )

◆ operator!=()

bool ana::constraint_manager::operator!= ( const constraint_manager & other) const
inline

◆ operator=()

constraint_manager & ana::constraint_manager::operator= ( const constraint_manager & other)

◆ operator==()

bool ana::constraint_manager::operator== ( const constraint_manager & other) const

◆ print()

void ana::constraint_manager::print ( pretty_printer * pp) const

◆ purge()

template<typename PurgeCriteria >
void ana::constraint_manager::purge ( const PurgeCriteria & p,
purge_stats * stats )

◆ purge_state_involving()

void ana::constraint_manager::purge_state_involving ( const svalue * sval)

◆ replay_call_summary()

bool ana::constraint_manager::replay_call_summary ( call_summary_replay & r,
const constraint_manager & summary )

◆ sval_constrained_p()

bool ana::constraint_manager::sval_constrained_p ( const svalue * sval) const

◆ to_json()

json::object * ana::constraint_manager::to_json ( ) const

◆ validate()

void ana::constraint_manager::validate ( ) const

Field Documentation

◆ m_bounded_ranges_constraints

auto_vec<bounded_ranges_constraint> ana::constraint_manager::m_bounded_ranges_constraints

◆ m_constraints

auto_vec<constraint> ana::constraint_manager::m_constraints

◆ m_equiv_classes

auto_delete_vec<equiv_class> ana::constraint_manager::m_equiv_classes

◆ m_mgr

region_model_manager* ana::constraint_manager::m_mgr
private

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