GCC Middle and Back End API Reference
attr_access Struct Reference

#include <attribs.h>

Public Member Functions

unsigned vla_bounds (unsigned *) const
 
tree to_internal_string () const
 
tree to_external_string () const
 
std::string array_as_string (tree) const
 

Static Public Member Functions

static access_mode from_mode_char (char)
 
static void free_lang_data (tree)
 

Data Fields

const char * str
 
const char * end
 
tree ptr
 
tree size
 
unsigned ptrarg
 
unsigned sizarg
 
unsigned HOST_WIDE_INT minsize
 
access_mode mode
 
bool internal_p
 
bool static_p
 

Static Public Attributes

static constexpr char mode_chars [5] = { '-', 'r', 'w', 'x', '^' }
 
static constexpr char mode_names [4][11]
 

Detailed Description

Description of a function argument declared with attribute access.
Used as an "iterator" over all such arguments in a function declaration
or call.   

Member Function Documentation

◆ array_as_string()

std::string attr_access::array_as_string ( tree type) const
Format an array, including a VLA, pointed to by TYPE and used as
a function parameter as a human-readable string.  ACC describes
an access to the parameter and is used to determine the outermost
form of the array including its bound which is otherwise obviated
by its decay to pointer.  Return the formatted string.   

References build_array_type(), build_index_type(), build_tree_list(), build_type_attribute_qual_variant(), diagnostic_context::clone_printer(), end, error_mark_node, get_identifier(), global_dc, HOST_WIDE_INT_M1U, integer_one_node, minsize, NULL_TREE, pp_formatted_text(), pp_printf(), size, size_int, static_p, str, TREE_TYPE, TREE_VALUE, and TYPE_QUALS.

◆ free_lang_data()

void attr_access::free_lang_data ( tree attrs)
static
Reset front end-specific attribute access data from ATTRS.
Called from the free_lang_data pass.   
static  

References DECL_P, lookup_attribute(), NULL_TREE, TREE_CHAIN, and TREE_VALUE.

◆ from_mode_char()

access_mode attr_access::from_mode_char ( char c)
inlinestatic

◆ to_external_string()

tree attr_access::to_external_string ( ) const
Return the human-readable representation of the external attribute
specification (as it might appear in the source code) as STRING_CST.
External positional arguments are one-based.   

References access_deferred, build_string(), gcc_assert, mode, mode_names, ptrarg, sizarg, and UINT_MAX.

◆ to_internal_string()

tree attr_access::to_internal_string ( ) const
Return the internal representation as STRING_CST.  Internal positional
arguments are zero-based.   

References build_string(), end, and str.

◆ vla_bounds()

unsigned attr_access::vla_bounds ( unsigned * nunspec) const
Return the number of specified VLA bounds and set *nunspec to
the number of unspecified ones (those designated by [*]).   

References str.

Field Documentation

◆ end

const char * attr_access::end

◆ internal_p

bool attr_access::internal_p

Referenced by init_attr_rdwr_indices().

◆ minsize

unsigned HOST_WIDE_INT attr_access::minsize

◆ mode

access_mode attr_access::mode

◆ mode_chars

char attr_access::mode_chars = { '-', 'r', 'w', 'x', '^' }
staticconstexpr
Defined in attr_access.   

Referenced by from_mode_char().

◆ mode_names

char attr_access::mode_names
staticconstexpr
Initial value:
=
{
"none", "read_only", "write_only", "read_write"
}

Referenced by to_external_string().

◆ ptr

tree attr_access::ptr

◆ ptrarg

unsigned attr_access::ptrarg

◆ sizarg

unsigned attr_access::sizarg

◆ size

tree attr_access::size

◆ static_p

bool attr_access::static_p

◆ str

const char* attr_access::str

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