comparison gcc/attribs.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Declarations and definitions dealing with attribute handling. 1 /* Declarations and definitions dealing with attribute handling.
2 Copyright (C) 2013-2018 Free Software Foundation, Inc. 2 Copyright (C) 2013-2020 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
33 a decl attribute to the declaration rather than to its type). */ 33 a decl attribute to the declaration rather than to its type). */
34 extern tree decl_attributes (tree *, tree, int, tree = NULL_TREE); 34 extern tree decl_attributes (tree *, tree, int, tree = NULL_TREE);
35 35
36 extern bool cxx11_attribute_p (const_tree); 36 extern bool cxx11_attribute_p (const_tree);
37 extern tree get_attribute_name (const_tree); 37 extern tree get_attribute_name (const_tree);
38 extern tree get_attribute_namespace (const_tree);
38 extern void apply_tm_attr (tree, tree); 39 extern void apply_tm_attr (tree, tree);
39 extern tree make_attribute (const char *, const char *, tree); 40 extern tree make_attribute (const char *, const char *, tree);
40 41
41 extern struct scoped_attributes* register_scoped_attributes (const struct attribute_spec *, 42 extern struct scoped_attributes* register_scoped_attributes (const struct attribute_spec *,
42 const char *); 43 const char *);
102 103
103 The function is called from lookup_attribute in order to optimize 104 The function is called from lookup_attribute in order to optimize
104 for size. */ 105 for size. */
105 extern tree private_lookup_attribute (const char *attr_name, size_t attr_len, 106 extern tree private_lookup_attribute (const char *attr_name, size_t attr_len,
106 tree list); 107 tree list);
108
109 extern unsigned decls_mismatched_attributes (tree, tree, tree,
110 const char* const[],
111 pretty_printer*);
112
113 extern void maybe_diag_alias_attributes (tree, tree);
107 114
108 /* For a given IDENTIFIER_NODE, strip leading and trailing '_' characters 115 /* For a given IDENTIFIER_NODE, strip leading and trailing '_' characters
109 so that we have a canonical form of attribute names. */ 116 so that we have a canonical form of attribute names. */
110 117
111 static inline tree 118 static inline tree
209 216
210 return list; 217 return list;
211 } 218 }
212 } 219 }
213 220
221 /* Description of a function argument declared with attribute access.
222 Used as an "iterator" over all such arguments in a function declaration
223 or call. */
224
225 struct attr_access
226 {
227 /* The attribute pointer argument. */
228 tree ptr;
229 /* The size of the pointed-to object or NULL when not specified. */
230 tree size;
231
232 /* The zero-based number of each of the formal function arguments. */
233 unsigned ptrarg;
234 unsigned sizarg;
235
236 /* The access mode. */
237 enum access_mode { read_only, write_only, read_write };
238 access_mode mode;
239 };
240
214 #endif // GCC_ATTRIBS_H 241 #endif // GCC_ATTRIBS_H