GCC Middle and Back End API Reference
trailing_wide_ints< N > Struct Template Reference

#include <wide-int.h>

Inheritance diagram for trailing_wide_ints< N >:

Public Member Functions

typedef WIDE_INT_REF_FOR (trailing_wide_int_storage) const _reference
 
void set_precision (unsigned int precision, unsigned int num_elements=N)
 
unsigned int get_precision () const
 
unsigned int num_elements () const
 
trailing_wide_int operator[] (unsigned int)
 
const_reference operator[] (unsigned int) const
 
size_t extra_size () const
 

Static Public Member Functions

static size_t extra_size (unsigned int precision, unsigned int num_elements=N)
 

Private Attributes

unsigned short m_precision
 
unsigned short m_max_len
 
unsigned char m_num_elements
 
unsigned short m_len [N]
 
HOST_WIDE_INT m_val [1]
 

Detailed Description

template<int N>
struct trailing_wide_ints< N >
A variable-length array of wide_int-like objects that can be put
at the end of a variable-sized structure.  The number of objects is
at most N and can be set at runtime by using set_precision().

Use extra_size to calculate how many bytes beyond the
sizeof need to be allocated.  Use set_precision to initialize the
structure.   

Member Function Documentation

◆ extra_size() [1/2]

◆ extra_size() [2/2]

template<int N>
size_t trailing_wide_ints< N >::extra_size ( unsigned int precision,
unsigned int num_elements = N )
inlinestatic
Return how many extra bytes need to be added to the end of the
structure in order to handle NUM_ELEMENTS wide_ints of precision
PRECISION.  NUM_ELEMENTS is the number of elements, and defaults
to N.   

References gcc_checking_assert, ggc_alloc(), N, and WIDE_INT_MAX_HWIS.

◆ get_precision()

template<int N>
unsigned int trailing_wide_ints< N >::get_precision ( ) const
inline

◆ num_elements()

template<int N>
unsigned int trailing_wide_ints< N >::num_elements ( ) const
inline

◆ operator[]() [1/2]

template<int N>
trailing_wide_int trailing_wide_ints< N >::operator[] ( unsigned int index)
inline
Return a reference to element INDEX.   

◆ operator[]() [2/2]

template<int N>
trailing_wide_ints< N >::const_reference trailing_wide_ints< N >::operator[] ( unsigned int index) const
inline

◆ set_precision()

template<int N>
void trailing_wide_ints< N >::set_precision ( unsigned int precision,
unsigned int num_elements = N )
inline
Initialize the structure and record that all elements have precision
PRECISION.  NUM_ELEMENTS can be no more than N.   

References gcc_checking_assert, N, and WIDE_INT_MAX_HWIS.

Referenced by prange_storage::prange_storage().

◆ WIDE_INT_REF_FOR()

template<int N>
typedef trailing_wide_ints< N >::WIDE_INT_REF_FOR ( trailing_wide_int_storage ) const

Field Documentation

◆ m_len

template<int N>
unsigned short trailing_wide_ints< N >::m_len[N]
private

◆ m_max_len

template<int N>
unsigned short trailing_wide_ints< N >::m_max_len
private

◆ m_num_elements

◆ m_precision

◆ m_val

template<int N>
HOST_WIDE_INT trailing_wide_ints< N >::m_val[1]
private

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