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

#include <call-string.h>

Collaboration diagram for ana::call_string:

Data Structures

struct  element_t
struct  hashmap_traits_t

Public Member Functions

void print (pretty_printer *pp) const
std::unique_ptr< json::valueto_json () const
bool empty_p () const
const call_stringpush_call (const supergraph &sg, const call_superedge *sedge) const
const call_stringpush_call (const supernode *src, const supernode *dest) const
const call_stringget_parent () const
int calc_recursion_depth () const
const supernodeget_callee_node () const
const supernodeget_caller_node () const
unsigned length () const
element_t operator[] (unsigned idx) const
const element_tget_top_of_stack () const
int count_occurrences_of_function (function *) const
void validate () const

Static Public Member Functions

static int cmp (const call_string &a, const call_string &b)
static int cmp_ptr_ptr (const void *, const void *)

Private Member Functions

 DISABLE_COPY_AND_ASSIGN (call_string)
 call_string ()
 call_string (const call_string &parent, const element_t &to_push)
 ~call_string ()
void recursive_log (logger *logger) const

Private Attributes

const call_stringm_parent
auto_vec< element_tm_elements
hash_map< element_t, const call_string *, hashmap_traits_tm_children

Friends

class region_model_manager

Detailed Description

A string of return_superedge pointers, representing a call stack at a program point. This is used to ensure that we generate interprocedurally valid paths i.e. that we return to the same callsite that called us. The class stores returning calls ( which may be represented by a returning superedge ). We do so because this is what we need to compare against. Instances of call_string are consolidated by the region_model_manager, which effectively owns them: it owns the root/empty call_string, and each call_string instance tracks its children, lazily creating them on demand, so that the call_string instances form a tree-like hierarchy in memory.

Constructor & Destructor Documentation

◆ call_string() [1/2]

ana::call_string::call_string ( )
private

◆ call_string() [2/2]

ana::call_string::call_string ( const call_string & parent,
const element_t & to_push )
private

References call_string().

◆ ~call_string()

ana::call_string::~call_string ( )
private

Member Function Documentation

◆ calc_recursion_depth()

int ana::call_string::calc_recursion_depth ( ) const

◆ cmp()

int ana::call_string::cmp ( const call_string & a,
const call_string & b )
static

References a, b, and call_string().

◆ cmp_ptr_ptr()

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

◆ count_occurrences_of_function()

int ana::call_string::count_occurrences_of_function ( function * ) const

◆ DISABLE_COPY_AND_ASSIGN()

ana::call_string::DISABLE_COPY_AND_ASSIGN ( call_string )
private

References call_string().

◆ empty_p()

bool ana::call_string::empty_p ( ) const
inline

References m_elements.

◆ get_callee_node()

const supernode * ana::call_string::get_callee_node ( ) const

◆ get_caller_node()

const supernode * ana::call_string::get_caller_node ( ) const

◆ get_parent()

const call_string * ana::call_string::get_parent ( ) const
inline

References call_string(), and m_parent.

◆ get_top_of_stack()

const element_t & ana::call_string::get_top_of_stack ( ) const
inline

◆ length()

unsigned ana::call_string::length ( ) const
inline

◆ operator[]()

element_t ana::call_string::operator[] ( unsigned idx) const
inline

References m_elements.

◆ print()

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

◆ push_call() [1/2]

const call_string * ana::call_string::push_call ( const supergraph & sg,
const call_superedge * sedge ) const

References call_string().

◆ push_call() [2/2]

const call_string * ana::call_string::push_call ( const supernode * src,
const supernode * dest ) const

References call_string().

◆ recursive_log()

void ana::call_string::recursive_log ( logger * logger) const
private

◆ to_json()

std::unique_ptr< json::value > ana::call_string::to_json ( ) const

◆ validate()

void ana::call_string::validate ( ) const

◆ region_model_manager

friend class region_model_manager
friend

References region_model_manager.

Referenced by region_model_manager.

Field Documentation

◆ m_children

hash_map<element_t, const call_string *, hashmap_traits_t> ana::call_string::m_children
mutableprivate

◆ m_elements

auto_vec<element_t> ana::call_string::m_elements
private

◆ m_parent

const call_string* ana::call_string::m_parent
private

Referenced by get_parent().


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