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

#include <rtl-iter.h>

Collaboration diagram for generic_subrtx_iterator< T >:

Data Structures

class  array_type
 

Public Member Functions

 generic_subrtx_iterator (array_type &, value_type, const rtx_subrtx_bound_info *)
 
value_type operator* () const
 
bool at_end () const
 
void next ()
 
void skip_subrtxes ()
 
void substitute (value_type)
 

Private Types

typedef T::value_type value_type
 
typedef T::rtx_type rtx_type
 
typedef T::rtunion_type rtunion_type
 

Static Private Member Functions

static void free_array (array_type &)
 
static size_t add_subrtxes_to_queue (array_type &, value_type *, size_t, rtx_type)
 
static value_typeadd_single_to_queue (array_type &, value_type *, size_t, value_type)
 

Private Attributes

const rtx_subrtx_bound_infom_bounds
 
array_typem_array
 
value_type m_current
 
value_typem_base
 
size_t m_end
 
bool m_done
 
bool m_skip
 
bool m_substitute
 

Static Private Attributes

static const size_t LOCAL_ELEMS = 16
 

Detailed Description

template<typename T>
class generic_subrtx_iterator< T >
Used to iterate over subrtxes of an rtx.  T abstracts the type of
access.   

Member Typedef Documentation

◆ rtunion_type

template<typename T >
T::rtunion_type generic_subrtx_iterator< T >::rtunion_type
private

◆ rtx_type

template<typename T >
T::rtx_type generic_subrtx_iterator< T >::rtx_type
private

◆ value_type

template<typename T >
T::value_type generic_subrtx_iterator< T >::value_type
private

Constructor & Destructor Documentation

◆ generic_subrtx_iterator()

template<typename T >
generic_subrtx_iterator< T >::generic_subrtx_iterator ( array_type & array,
value_type x,
const rtx_subrtx_bound_info * bounds )
inline
Iterate over X and its subrtxes, in arbitrary order.  Use ARRAY to
store the worklist.  We use an external array in order to avoid
capturing the fields of this structure when taking the address of
the array.  Use BOUNDS to find the bounds of simple "e"-string codes.   

Member Function Documentation

◆ add_single_to_queue()

template<typename T >
T::value_type * generic_subrtx_iterator< T >::add_single_to_queue ( array_type & array,
value_type * base,
size_t i,
value_type x )
staticprivate
Store X into index I of ARRAY.  ARRAY is known to have at least I
elements.  Return the new base of ARRAY.   

References gcc_checking_assert, i, vec_safe_grow(), vec_safe_length(), and vec_safe_push().

◆ add_subrtxes_to_queue()

template<typename T >
size_t generic_subrtx_iterator< T >::add_subrtxes_to_queue ( array_type & array,
value_type * base,
size_t end,
rtx_type x )
staticprivate
Add the subrtxes of X to worklist ARRAY, starting at END.  Return the
number of elements added to the worklist.   

References end(), GET_CODE, GET_NUM_ELEM, GET_RTX_FORMAT, GET_RTX_LENGTH, i, INSN_P, LIKELY, PATTERN(), and UNLIKELY.

◆ at_end()

template<typename T >
bool generic_subrtx_iterator< T >::at_end ( ) const
inline
Return true if the iteration has finished.   

◆ free_array()

template<typename T >
void generic_subrtx_iterator< T >::free_array ( array_type & array)
staticprivate

◆ next()

template<typename T >
void generic_subrtx_iterator< T >::next ( )
inline
Move on to the next subrtx.   

References count, GET_CODE, LIKELY, and UNLIKELY.

◆ operator*()

template<typename T >
T::value_type generic_subrtx_iterator< T >::operator* ( ) const
inline
Return the current subrtx.   

◆ skip_subrtxes()

template<typename T >
void generic_subrtx_iterator< T >::skip_subrtxes ( )
inline
Skip the subrtxes of the current rtx.   

◆ substitute()

template<typename T >
void generic_subrtx_iterator< T >::substitute ( value_type x)
inline
Ignore the subrtxes of the current rtx and look at X instead.   

Field Documentation

◆ LOCAL_ELEMS

template<typename T >
const size_t generic_subrtx_iterator< T >::LOCAL_ELEMS = 16
staticprivate

◆ m_array

template<typename T >
array_type& generic_subrtx_iterator< T >::m_array
private

◆ m_base

template<typename T >
value_type* generic_subrtx_iterator< T >::m_base
private

◆ m_bounds

template<typename T >
const rtx_subrtx_bound_info* generic_subrtx_iterator< T >::m_bounds
private

◆ m_current

template<typename T >
value_type generic_subrtx_iterator< T >::m_current
private

◆ m_done

template<typename T >
bool generic_subrtx_iterator< T >::m_done
private

◆ m_end

template<typename T >
size_t generic_subrtx_iterator< T >::m_end
private

◆ m_skip

template<typename T >
bool generic_subrtx_iterator< T >::m_skip
private

◆ m_substitute

template<typename T >
bool generic_subrtx_iterator< T >::m_substitute
private

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