GCC Middle and Back End API Reference
function_summary< T * > Class Template Reference

#include <symbol-summary.h>

Inheritance diagram for function_summary< T * >:
Collaboration diagram for function_summary< T * >:

Public Member Functions

 function_summary (symbol_table *symtab, bool ggc=false CXX_MEM_STAT_INFO)
 
virtual ~function_summary ()
 
template<typename Arg, bool(*)(const T &, Arg) f>
void traverse (Arg a) const
 
Tget_create (cgraph_node *node)
 
Tget (cgraph_node *node) ATTRIBUTE_PURE
 
void remove (cgraph_node *node)
 
bool exists (cgraph_node *node)
 
virtual void insert (cgraph_node *, T *)
 
virtual void remove (cgraph_node *, T *)
 
virtual void duplicate (cgraph_node *, cgraph_node *, T *, T *)
 
void enable_insertion_hook ()
 
void disable_insertion_hook ()
 
void enable_duplication_hook ()
 
void disable_duplication_hook ()
 

Static Public Member Functions

static void symtab_insertion (cgraph_node *node, void *data)
 
static void symtab_removal (cgraph_node *node, void *data)
 
static void symtab_duplication (cgraph_node *node, cgraph_node *node2, void *data)
 

Protected Member Functions

Tallocate_new ()
 
void release (T *item)
 
void unregister_hooks ()
 

Protected Attributes

bool m_ggc
 
symbol_tablem_symtab
 
cgraph_node_hook m_symtab_insertion
 
cgraph_node_hook m_symtab_removal
 
cgraph_2node_hook m_symtab_duplication
 
cgraph_node_hook_listm_symtab_insertion_hook
 
cgraph_node_hook_listm_symtab_removal_hook
 
cgraph_2node_hook_listm_symtab_duplication_hook
 

Private Types

typedef int_hash< int, 0, -1 > map_hash
 

Private Member Functions

bool is_ggc () final override
 
 function_summary ()
 

Private Attributes

hash_map< map_hash, T * > m_map
 
object_allocator< Tm_allocator
 

Friends

template<typename U>
void gt_ggc_mx (function_summary< U * > *const &)
 
template<typename U>
void gt_pch_nx (function_summary< U * > *const &)
 
template<typename U>
void gt_pch_nx (function_summary< U * > *const &, gt_pointer_operator, void *)
 

Detailed Description

template<class T>
class function_summary< T * >
Function summary is a helper class that is used to associate a data structure
related to a callgraph node.  Typical usage can be seen in IPA passes which
create a temporary pass-related structures.  The summary class registers
hooks that are triggered when a new node is inserted, duplicated and deleted.
A user of a summary class can ovewrite virtual methods than are triggered by
the summary if such hook is triggered.  Apart from a callgraph node, the user
is given a data structure tied to the node.

The function summary class can work both with a heap-allocated memory and
a memory gained by garbage collected memory.   

Member Typedef Documentation

◆ map_hash

template<class T>
typedef int_hash<int, 0, -1> function_summary< T * >::map_hash
private

Constructor & Destructor Documentation

◆ function_summary() [1/2]

◆ ~function_summary()

◆ function_summary() [2/2]

Member Function Documentation

◆ allocate_new()

template<class T>
T * function_summary_base< T >::allocate_new ( )
inlineprotectedinherited

◆ disable_duplication_hook()

template<class T>
void function_summary_base< T >::disable_duplication_hook ( )
inlineinherited

References m_symtab, m_symtab_duplication_hook, and NULL.

Referenced by unregister_hooks().

◆ disable_insertion_hook()

template<class T>
void function_summary_base< T >::disable_insertion_hook ( )
inlineinherited

References m_symtab, m_symtab_insertion_hook, and NULL.

Referenced by unregister_hooks().

◆ duplicate()

template<class T>
virtual void function_summary_base< T >::duplicate ( cgraph_node * ,
cgraph_node * ,
T * ,
T *  )
inlinevirtualinherited

◆ enable_duplication_hook()

template<class T>
void function_summary_base< T >::enable_duplication_hook ( )
inlineinherited

◆ enable_insertion_hook()

template<class T>
void function_summary_base< T >::enable_insertion_hook ( )
inlineinherited

◆ exists()

template<class T>
bool function_summary< T * >::exists ( cgraph_node * node)
inline

References symtab_node::get_uid(), m_map, and NULL.

◆ get()

template<class T>
T * function_summary< T * >::get ( cgraph_node * node)
inline

References m_map, NULL, and T.

◆ get_create()

template<class T>
T * function_summary< T * >::get_create ( cgraph_node * node)
inline

◆ insert()

template<class T>
virtual void function_summary_base< T >::insert ( cgraph_node * ,
T *  )
inlinevirtualinherited

References gcc_unreachable, and T.

◆ is_ggc()

template<class T>
bool function_summary< T * >::is_ggc ( )
inlinefinaloverrideprivatevirtual

Implements function_summary_base< T >.

References final(), and m_ggc.

◆ release()

◆ remove() [1/2]

template<class T>
void function_summary< T * >::remove ( cgraph_node * node)
inline

◆ remove() [2/2]

template<class T>
virtual void function_summary_base< T >::remove ( cgraph_node * ,
T *  )
inlinevirtualinherited

References T.

◆ symtab_duplication()

template<typename T>
void function_summary< T * >::symtab_duplication ( cgraph_node * node,
cgraph_node * node2,
void * data )
static

References function_summary(), and T.

Referenced by function_summary().

◆ symtab_insertion()

template<typename T>
void function_summary< T * >::symtab_insertion ( cgraph_node * node,
void * data )
static

◆ symtab_removal()

template<typename T>
void function_summary< T * >::symtab_removal ( cgraph_node * node,
void * data )
static

◆ traverse()

template<class T>
template<typename Arg, bool(*)(const T &, Arg) f>
void function_summary< T * >::traverse ( Arg a) const
inline

References a, and m_map.

◆ unregister_hooks()

Friends And Related Symbol Documentation

◆ gt_ggc_mx

template<class T>
template<typename U>
void gt_ggc_mx ( function_summary< U * > *const & )
friend

◆ gt_pch_nx [1/2]

template<class T>
template<typename U>
void gt_pch_nx ( function_summary< U * > *const & )
friend

◆ gt_pch_nx [2/2]

template<class T>
template<typename U>
void gt_pch_nx ( function_summary< U * > *const & ,
gt_pointer_operator ,
void *  )
friend

Field Documentation

◆ m_allocator

template<class T>
object_allocator<T> function_summary_base< T >::m_allocator
privateinherited

◆ m_ggc

template<class T>
bool function_summary< T * >::m_ggc
protected

Referenced by function_summary(), and is_ggc().

◆ m_map

template<class T>
hash_map<map_hash, T *> function_summary< T * >::m_map
private

◆ m_symtab

◆ m_symtab_duplication

template<class T>
cgraph_2node_hook function_summary_base< T >::m_symtab_duplication
protectedinherited

◆ m_symtab_duplication_hook

template<class T>
cgraph_2node_hook_list* function_summary_base< T >::m_symtab_duplication_hook
protectedinherited

◆ m_symtab_insertion

template<class T>
cgraph_node_hook function_summary_base< T >::m_symtab_insertion
protectedinherited

◆ m_symtab_insertion_hook

template<class T>
cgraph_node_hook_list* function_summary_base< T >::m_symtab_insertion_hook
protectedinherited

◆ m_symtab_removal

template<class T>
cgraph_node_hook function_summary_base< T >::m_symtab_removal
protectedinherited

Referenced by function_summary_base().

◆ m_symtab_removal_hook

template<class T>
cgraph_node_hook_list* function_summary_base< T >::m_symtab_removal_hook
protectedinherited

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