GCC Middle and Back End API Reference
|
#include <attr-fnspec.h>
Public Member Functions | |
attr_fnspec (const char *str, unsigned len) | |
attr_fnspec (const char *str) | |
attr_fnspec (const_tree identifier) | |
attr_fnspec () | |
bool | known_p () |
bool | arg_specified_p (unsigned int i) |
bool | arg_direct_p (unsigned int i) |
bool | arg_used_p (unsigned int i) |
bool | arg_readonly_p (unsigned int i) |
bool | arg_maybe_read_p (unsigned int i) |
bool | arg_maybe_written_p (unsigned int i) |
bool | arg_max_access_size_given_by_arg_p (unsigned int i, unsigned int *arg) |
bool | arg_access_size_given_by_type_p (unsigned int i) |
bool | arg_copied_to_arg_p (unsigned int i, unsigned int *arg) |
bool | arg_noescape_p (unsigned int i) |
bool | returns_arg (unsigned int *arg_no) |
bool | returns_noalias_p () |
bool | global_memory_read_p () |
bool | global_memory_written_p () |
bool | errno_maybe_written_p () |
int | arg_eaf_flags (unsigned int i) |
void | verify () |
const char * | get_str () |
Private Member Functions | |
unsigned int | arg_idx (int i) |
Private Attributes | |
const char * | str |
const unsigned | len |
const unsigned int | return_desc_size = 2 |
const unsigned int | arg_desc_size = 2 |
Handling of fnspec attribute specifiers Copyright (C) 2008-2025 Free Software Foundation, Inc. Contributed by Richard Guenther <rguenther@suse.de> This file is part of GCC. GCC is free software; you can redistribute it and/or modify under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Parse string of attribute "fn spec". This is an internal attribute describing side effects of a function as follows: character 0 specifies properties of return values as follows: '1'...'4' specifies number of argument function returns (as in memset) 'm' specifies that returned value is noalias (as in malloc) '.' specifies that nothing is known. character 1 specifies additional function properties ' ' specifies that nothing is known 'p' or 'P' specifies that function is pure except for described side effects. 'c' or 'C' specifies that function is const except for described side effects. The uppercase letter in addition specifies that function clobbers errno. character 2+2i specifies properties of argument number i as follows: 'x' or 'X' specifies that parameter is unused. 'r' or 'R' specifies that the memory pointed to by the parameter is only read and does not escape 'o' or 'O' specifies that the memory pointed to by the parameter is only written and does not escape 'w' or 'W' specifies that the memory pointed to by the parameter does not escape '1'....'9' specifies that the memory pointed to by the parameter is copied to memory pointed to by different parameter (as in memcpy). '.' specifies that nothing is known. The uppercase letter in addition specifies that the memory pointed to by the parameter is not dereferenced. For 'r' only read applies transitively to pointers read from the pointed-to memory. character 3+2i specifies additional properties of argument number i as follows: ' ' nothing is known 't' the size of value written/read corresponds to the size of of the pointed-to type of the argument type '1'...'9' specifies the size of value written/read is bound by the specified argument
|
inline |
References verify().
|
inline |
References verify().
|
inline |
References verify().
|
inline |
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by check_fnspec().
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by arg_eaf_flags().
|
inline |
|
inlineprivate |
References arg_desc_size, i, and return_desc_size.
Referenced by arg_access_size_given_by_type_p(), arg_copied_to_arg_p(), arg_direct_p(), arg_max_access_size_given_by_arg_p(), arg_maybe_read_p(), arg_maybe_written_p(), arg_noescape_p(), arg_readonly_p(), arg_specified_p(), arg_used_p(), and verify().
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by check_fnspec().
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by check_fnspec(), and ipa_modref_callee_reads_no_memory_p().
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by check_fnspec().
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by arg_eaf_flags().
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by arg_eaf_flags().
|
inline |
References arg_idx(), i, and len.
Referenced by arg_access_size_given_by_type_p(), arg_copied_to_arg_p(), arg_direct_p(), arg_eaf_flags(), arg_max_access_size_given_by_arg_p(), arg_maybe_read_p(), arg_maybe_written_p(), arg_noescape_p(), arg_readonly_p(), arg_used_p(), check_fnspec(), ipa_modref_callee_reads_no_memory_p(), and verify().
|
inline |
References arg_idx(), arg_specified_p(), gcc_checking_assert, i, and str.
Referenced by arg_eaf_flags().
|
inline |
References str.
Referenced by check_fnspec().
|
inline |
References str.
|
inline |
References str.
Referenced by check_fnspec(), determine_global_memory_access(), and ipa_modref_callee_reads_no_memory_p().
|
inline |
References str.
Referenced by check_fnspec(), and determine_global_memory_access().
|
inline |
References len.
Referenced by check_fnspec(), determine_global_memory_access(), gimple_call_arg_flags(), ipa_compute_jump_functions_for_bb(), and ipa_modref_callee_reads_no_memory_p().
|
inline |
References str.
Referenced by decl_return_flags(), gimple_call_return_array(), and gimple_call_return_flags().
|
inline |
References str.
Referenced by decl_return_flags(), and gimple_call_return_flags().
void attr_fnspec::verify | ( | ) |
Verify validity of the fnspec string. See attr-fnspec.h for details.
References arg_desc_size, arg_idx(), arg_specified_p(), i, internal_error(), len, return_desc_size, and str.
Referenced by attr_fnspec(), attr_fnspec(), and attr_fnspec().
|
private |
Referenced by arg_specified_p(), known_p(), and verify().
|
private |
Referenced by arg_access_size_given_by_type_p(), arg_copied_to_arg_p(), arg_direct_p(), arg_max_access_size_given_by_arg_p(), arg_maybe_read_p(), arg_maybe_written_p(), arg_noescape_p(), arg_readonly_p(), arg_used_p(), errno_maybe_written_p(), get_str(), global_memory_read_p(), global_memory_written_p(), returns_arg(), returns_noalias_p(), and verify().