GCC Middle and Back End API Reference
ana::region Class Referenceabstract

#include <region.h>

Inheritance diagram for ana::region:
Collaboration diagram for ana::region:

Public Types

typedef unsigned id_t
 

Public Member Functions

virtual ~region ()
 
virtual enum region_kind get_kind () const =0
 
virtual const frame_regiondyn_cast_frame_region () const
 
virtual const function_regiondyn_cast_function_region () const
 
virtual const symbolic_regiondyn_cast_symbolic_region () const
 
virtual const decl_regiondyn_cast_decl_region () const
 
virtual const field_regiondyn_cast_field_region () const
 
virtual const element_regiondyn_cast_element_region () const
 
virtual const offset_regiondyn_cast_offset_region () const
 
virtual const sized_regiondyn_cast_sized_region () const
 
virtual const cast_regiondyn_cast_cast_region () const
 
virtual const string_regiondyn_cast_string_region () const
 
virtual const bit_range_regiondyn_cast_bit_range_region () const
 
virtual const var_arg_regiondyn_cast_var_arg_region () const
 
virtual void accept (visitor *v) const
 
const regionget_parent_region () const
 
const regionget_base_region () const
 
bool base_region_p () const
 
bool descendent_of_p (const region *elder) const
 
const frame_regionmaybe_get_frame_region () const
 
enum memory_space get_memory_space () const
 
bool can_have_initial_svalue_p () const
 
const svalueget_initial_value_at_main (region_model_manager *mgr) const
 
tree maybe_get_decl () const
 
tree get_type () const
 
void print (const region_model &model, pretty_printer *pp) const
 
label_text get_desc (bool simple=true) const
 
virtual void dump_to_pp (pretty_printer *pp, bool simple) const =0
 
void dump (bool simple) const
 
void dump () const
 
json::valueto_json () const
 
bool maybe_print_for_user (pretty_printer *pp, const region_model &model) const
 
std::unique_ptr< text_art::tree_widget > make_dump_widget (const text_art::dump_widget_info &dwi, const char *prefix=nullptr) const
 
bool non_null_p () const
 
bool involves_p (const svalue *sval) const
 
region_offset get_offset (region_model_manager *mgr) const
 
region_offset get_next_offset (region_model_manager *mgr) const
 
virtual bool get_byte_size (byte_size_t *out) const
 
virtual bool get_bit_size (bit_size_t *out) const
 
virtual const svalueget_byte_size_sval (region_model_manager *mgr) const
 
virtual const svalueget_bit_size_sval (region_model_manager *mgr) const
 
virtual bool get_relative_concrete_offset (bit_offset_t *out) const
 
virtual const svalueget_relative_symbolic_offset (region_model_manager *mgr) const
 
bool get_relative_concrete_byte_range (byte_range *out) const
 
void get_subregions_for_binding (region_model_manager *mgr, bit_offset_t start_bit_offset, bit_size_t size_in_bits, tree type, auto_vec< const region * > *out) const
 
bool symbolic_for_unknown_ptr_p () const
 
bool symbolic_p () const
 
virtual bool tracked_p () const
 
bool is_named_decl_p (const char *decl_name) const
 
bool empty_p () const
 
const complexityget_complexity () const
 
id_t get_id () const
 

Static Public Member Functions

static int cmp_ptr_ptr (const void *, const void *)
 
static int cmp_ids (const symbol *s1, const symbol *s2)
 

Protected Member Functions

 region (complexity c, symbol::id_t id, const region *parent, tree type)
 

Private Member Functions

region_offset calc_offset (region_model_manager *mgr) const
 
const svaluecalc_initial_value_at_main (region_model_manager *mgr) const
 
virtual void print_dump_widget_label (pretty_printer *pp) const =0
 
virtual void add_dump_widget_children (text_art::tree_widget &, const text_art::dump_widget_info &dwi) const
 

Private Attributes

const regionm_parent
 
tree m_type
 
region_offsetm_cached_offset
 
const svaluem_cached_init_sval_at_main
 
complexity m_complexity
 
id_t m_id
 

Detailed Description

Region and its subclasses.

The class hierarchy looks like this (using indentation to show
inheritance, and with region_kinds shown for the concrete subclasses):

region
  space_region
    frame_region (RK_FRAME): a function frame on the stack
    globals_region (RK_GLOBALS): holds globals variables (data and bss)
    code_region (RK_CODE): represents the code segment, containing functions
    stack_region (RK_STACK): a stack, containing all stack frames
    heap_region (RK_HEAP): the heap, containing heap_allocated_regions
    thread_local_region (RK_THREAD_LOCAL): thread-local data for the thread
                                           being analyzed
  root_region (RK_ROOT): the top-level region
  function_region (RK_FUNCTION): the code for a particular function
  label_region (RK_LABEL): a particular label within a function
  symbolic_region (RK_SYMBOLIC): dereferencing a symbolic pointer
  decl_region (RK_DECL): the memory occupied by a particular global, local,
                    or SSA name
  field_region (RK_FIELD): the memory occupied by a field within a struct
                      or union
  element_region (RK_ELEMENT): an element within an array
  offset_region (RK_OFFSET): a byte-offset within another region, for
                        handling pointer arithmetic as a region
  sized_region (RK_SIZED): a subregion of symbolic size (in bytes)
                      within its parent
  cast_region (RK_CAST): a region that views another region using a
                    different type
  heap_allocated_region (RK_HEAP_ALLOCATED): an untyped region dynamically
                                        allocated on the heap via
                                        "malloc" or similar
  alloca_region (RK_ALLOCA): an untyped region dynamically allocated on the
                        stack via "alloca"
  string_region (RK_STRING): a region for a STRING_CST
  bit_range_region (RK_BIT_RANGE): a region for a specific range of bits
                              within another region
  var_arg_region (RK_VAR_ARG): a region for the N-th vararg within a
                          frame_region for a variadic call
  errno_region (RK_ERRNO): a region for holding "errno"
  private_region (RK_PRIVATE): a region for internal state of an API
  unknown_region (RK_UNKNOWN): for handling unimplemented tree codes.   
Abstract base class for representing ways of accessing chunks of memory.

Regions form a tree-like hierarchy, with a root region at the base,
with memory space regions within it, representing the stack and
globals, with frames within the stack, and regions for variables
within the frames and the "globals" region.  Regions for structs
can have subregions for fields.   

Member Typedef Documentation

◆ id_t

typedef unsigned ana::symbol::id_t
inherited

Constructor & Destructor Documentation

◆ ~region()

virtual ana::region::~region ( )
virtual

◆ region()

ana::region::region ( complexity c,
symbol::id_t id,
const region * parent,
tree type )
protected

Member Function Documentation

◆ accept()

virtual void ana::region::accept ( visitor * v) const
virtual

◆ add_dump_widget_children()

virtual void ana::region::add_dump_widget_children ( text_art::tree_widget & ,
const text_art::dump_widget_info & dwi ) const
privatevirtual

◆ base_region_p()

bool ana::region::base_region_p ( ) const

◆ calc_initial_value_at_main()

const svalue * ana::region::calc_initial_value_at_main ( region_model_manager * mgr) const
private

◆ calc_offset()

region_offset ana::region::calc_offset ( region_model_manager * mgr) const
private

◆ can_have_initial_svalue_p()

bool ana::region::can_have_initial_svalue_p ( ) const

◆ cmp_ids()

static int ana::symbol::cmp_ids ( const symbol * s1,
const symbol * s2 )
staticinherited

◆ cmp_ptr_ptr()

static int ana::region::cmp_ptr_ptr ( const void * ,
const void *  )
static

◆ descendent_of_p()

bool ana::region::descendent_of_p ( const region * elder) const

◆ dump() [1/2]

void ana::region::dump ( ) const

◆ dump() [2/2]

void ana::region::dump ( bool simple) const

◆ dump_to_pp()

◆ dyn_cast_bit_range_region()

virtual const bit_range_region * ana::region::dyn_cast_bit_range_region ( ) const
inlinevirtual

Reimplemented in ana::bit_range_region.

References NULL.

◆ dyn_cast_cast_region()

virtual const cast_region * ana::region::dyn_cast_cast_region ( ) const
inlinevirtual

Reimplemented in ana::cast_region.

References NULL.

◆ dyn_cast_decl_region()

virtual const decl_region * ana::region::dyn_cast_decl_region ( ) const
inlinevirtual

Reimplemented in ana::decl_region.

References NULL.

◆ dyn_cast_element_region()

virtual const element_region * ana::region::dyn_cast_element_region ( ) const
inlinevirtual

Reimplemented in ana::element_region.

References NULL.

◆ dyn_cast_field_region()

virtual const field_region * ana::region::dyn_cast_field_region ( ) const
inlinevirtual

Reimplemented in ana::field_region.

References NULL.

◆ dyn_cast_frame_region()

virtual const frame_region * ana::region::dyn_cast_frame_region ( ) const
inlinevirtual

Reimplemented in ana::frame_region.

References NULL.

◆ dyn_cast_function_region()

virtual const function_region * ana::region::dyn_cast_function_region ( ) const
inlinevirtual

Reimplemented in ana::function_region.

References NULL.

◆ dyn_cast_offset_region()

virtual const offset_region * ana::region::dyn_cast_offset_region ( ) const
inlinevirtual

Reimplemented in ana::offset_region.

References NULL.

◆ dyn_cast_sized_region()

virtual const sized_region * ana::region::dyn_cast_sized_region ( ) const
inlinevirtual

Reimplemented in ana::sized_region.

References NULL.

◆ dyn_cast_string_region()

virtual const string_region * ana::region::dyn_cast_string_region ( ) const
inlinevirtual

Reimplemented in ana::string_region.

References NULL.

◆ dyn_cast_symbolic_region()

virtual const symbolic_region * ana::region::dyn_cast_symbolic_region ( ) const
inlinevirtual

Reimplemented in ana::symbolic_region.

References NULL.

◆ dyn_cast_var_arg_region()

virtual const var_arg_region * ana::region::dyn_cast_var_arg_region ( ) const
inlinevirtual

Reimplemented in ana::var_arg_region.

References NULL.

◆ empty_p()

bool ana::region::empty_p ( ) const

◆ get_base_region()

const region * ana::region::get_base_region ( ) const

◆ get_bit_size()

virtual bool ana::region::get_bit_size ( bit_size_t * out) const
virtual

Reimplemented in ana::bit_range_region, and ana::sized_region.

◆ get_bit_size_sval()

virtual const svalue * ana::region::get_bit_size_sval ( region_model_manager * mgr) const
virtual

Reimplemented in ana::bit_range_region, and ana::sized_region.

◆ get_byte_size()

virtual bool ana::region::get_byte_size ( byte_size_t * out) const
virtual

Reimplemented in ana::bit_range_region, and ana::sized_region.

◆ get_byte_size_sval()

virtual const svalue * ana::region::get_byte_size_sval ( region_model_manager * mgr) const
virtual

Reimplemented in ana::bit_range_region, and ana::sized_region.

◆ get_complexity()

const complexity & ana::symbol::get_complexity ( ) const
inlineinherited

◆ get_desc()

label_text ana::region::get_desc ( bool simple = true) const

◆ get_id()

id_t ana::symbol::get_id ( ) const
inlineinherited

References ana::symbol::m_id.

◆ get_initial_value_at_main()

const svalue * ana::region::get_initial_value_at_main ( region_model_manager * mgr) const

◆ get_kind()

◆ get_memory_space()

enum memory_space ana::region::get_memory_space ( ) const

◆ get_next_offset()

region_offset ana::region::get_next_offset ( region_model_manager * mgr) const

◆ get_offset()

region_offset ana::region::get_offset ( region_model_manager * mgr) const

◆ get_parent_region()

const region * ana::region::get_parent_region ( ) const
inline

References m_parent.

Referenced by remap_enclosing_frame().

◆ get_relative_concrete_byte_range()

bool ana::region::get_relative_concrete_byte_range ( byte_range * out) const

◆ get_relative_concrete_offset()

virtual bool ana::region::get_relative_concrete_offset ( bit_offset_t * out) const
virtual

◆ get_relative_symbolic_offset()

virtual const svalue * ana::region::get_relative_symbolic_offset ( region_model_manager * mgr) const
virtual

◆ get_subregions_for_binding()

void ana::region::get_subregions_for_binding ( region_model_manager * mgr,
bit_offset_t start_bit_offset,
bit_size_t size_in_bits,
tree type,
auto_vec< const region * > * out ) const

◆ get_type()

tree ana::region::get_type ( ) const
inline

References m_type.

◆ involves_p()

bool ana::region::involves_p ( const svalue * sval) const

◆ is_named_decl_p()

bool ana::region::is_named_decl_p ( const char * decl_name) const

◆ make_dump_widget()

std::unique_ptr< text_art::tree_widget > ana::region::make_dump_widget ( const text_art::dump_widget_info & dwi,
const char * prefix = nullptr ) const

◆ maybe_get_decl()

tree ana::region::maybe_get_decl ( ) const

◆ maybe_get_frame_region()

const frame_region * ana::region::maybe_get_frame_region ( ) const

◆ maybe_print_for_user()

bool ana::region::maybe_print_for_user ( pretty_printer * pp,
const region_model & model ) const

◆ non_null_p()

bool ana::region::non_null_p ( ) const

◆ print()

void ana::region::print ( const region_model & model,
pretty_printer * pp ) const

◆ print_dump_widget_label()

◆ symbolic_for_unknown_ptr_p()

bool ana::region::symbolic_for_unknown_ptr_p ( ) const

◆ symbolic_p()

bool ana::region::symbolic_p ( ) const

◆ to_json()

json::value * ana::region::to_json ( ) const

◆ tracked_p()

virtual bool ana::region::tracked_p ( ) const
inlinevirtual

Reimplemented in ana::decl_region, and ana::string_region.

Field Documentation

◆ m_cached_init_sval_at_main

const svalue* ana::region::m_cached_init_sval_at_main
mutableprivate

◆ m_cached_offset

region_offset* ana::region::m_cached_offset
mutableprivate

◆ m_complexity

complexity ana::symbol::m_complexity
privateinherited

◆ m_id

id_t ana::symbol::m_id
privateinherited

Referenced by ana::symbol::get_id().

◆ m_parent

const region* ana::region::m_parent
private

Referenced by get_parent_region().

◆ m_type

tree ana::region::m_type
private

Referenced by get_type().


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