File: | build/gcc/vec.h |
Warning: | line 827, column 3 Called C++ object pointer is null |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Process declarations and variables for C++ compiler. |
2 | Copyright (C) 1988-2021 Free Software Foundation, Inc. |
3 | Hacked by Michael Tiemann (tiemann@cygnus.com) |
4 | |
5 | This file is part of GCC. |
6 | |
7 | GCC is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 3, or (at your option) |
10 | any later version. |
11 | |
12 | GCC is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU General Public License |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ |
20 | |
21 | |
22 | /* Process declarations and symbol lookup for C++ front end. |
23 | Also constructs types; the standard scalar types at initialization, |
24 | and structure, union, array and enum types when they are declared. */ |
25 | |
26 | /* ??? not all decl nodes are given the most useful possible |
27 | line numbers. For example, the CONST_DECLs for enum values. */ |
28 | |
29 | #include "config.h" |
30 | #include "system.h" |
31 | #include "coretypes.h" |
32 | #include "memmodel.h" |
33 | #include "target.h" |
34 | #include "cp-tree.h" |
35 | #include "c-family/c-common.h" |
36 | #include "timevar.h" |
37 | #include "stringpool.h" |
38 | #include "cgraph.h" |
39 | #include "varasm.h" |
40 | #include "attribs.h" |
41 | #include "stor-layout.h" |
42 | #include "calls.h" |
43 | #include "decl.h" |
44 | #include "toplev.h" |
45 | #include "c-family/c-objc.h" |
46 | #include "c-family/c-pragma.h" |
47 | #include "dumpfile.h" |
48 | #include "intl.h" |
49 | #include "c-family/c-ada-spec.h" |
50 | #include "asan.h" |
51 | #include "optabs-query.h" |
52 | |
53 | /* Id for dumping the raw trees. */ |
54 | int raw_dump_id; |
55 | |
56 | extern cpp_reader *parse_in; |
57 | |
58 | /* This structure contains information about the initializations |
59 | and/or destructions required for a particular priority level. */ |
60 | typedef struct priority_info_s { |
61 | /* Nonzero if there have been any initializations at this priority |
62 | throughout the translation unit. */ |
63 | int initializations_p; |
64 | /* Nonzero if there have been any destructions at this priority |
65 | throughout the translation unit. */ |
66 | int destructions_p; |
67 | } *priority_info; |
68 | |
69 | static tree start_objects (int, int); |
70 | static void finish_objects (int, int, tree); |
71 | static tree start_static_storage_duration_function (unsigned); |
72 | static void finish_static_storage_duration_function (tree); |
73 | static priority_info get_priority_info (int); |
74 | static void do_static_initialization_or_destruction (tree, bool); |
75 | static void one_static_initialization_or_destruction (tree, tree, bool); |
76 | static void generate_ctor_or_dtor_function (bool, int, location_t *); |
77 | static int generate_ctor_and_dtor_functions_for_priority (splay_tree_node, |
78 | void *); |
79 | static tree prune_vars_needing_no_initialization (tree *); |
80 | static void write_out_vars (tree); |
81 | static void import_export_class (tree); |
82 | static tree get_guard_bits (tree); |
83 | static void determine_visibility_from_class (tree, tree); |
84 | static bool determine_hidden_inline (tree); |
85 | |
86 | /* A list of static class variables. This is needed, because a |
87 | static class variable can be declared inside the class without |
88 | an initializer, and then initialized, statically, outside the class. */ |
89 | static GTY(()) vec<tree, va_gc> *pending_statics; |
90 | |
91 | /* A list of functions which were declared inline, but which we |
92 | may need to emit outline anyway. */ |
93 | static GTY(()) vec<tree, va_gc> *deferred_fns; |
94 | |
95 | /* A list of decls that use types with no linkage, which we need to make |
96 | sure are defined. */ |
97 | static GTY(()) vec<tree, va_gc> *no_linkage_decls; |
98 | |
99 | /* A vector of alternating decls and identifiers, where the latter |
100 | is to be an alias for the former if the former is defined. */ |
101 | static GTY(()) vec<tree, va_gc> *mangling_aliases; |
102 | |
103 | /* hash traits for declarations. Hashes single decls via |
104 | DECL_ASSEMBLER_NAME_RAW. */ |
105 | |
106 | struct mangled_decl_hash : ggc_remove <tree> |
107 | { |
108 | typedef tree value_type; /* A DECL. */ |
109 | typedef tree compare_type; /* An identifier. */ |
110 | |
111 | static hashval_t hash (const value_type decl) |
112 | { |
113 | return IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME_RAW (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 113, __FUNCTION__))->decl_with_vis.assembler_name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 113, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value ); |
114 | } |
115 | static bool equal (const value_type existing, compare_type candidate) |
116 | { |
117 | tree name = DECL_ASSEMBLER_NAME_RAW (existing)((contains_struct_check ((existing), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 117, __FUNCTION__))->decl_with_vis.assembler_name); |
118 | return candidate == name; |
119 | } |
120 | |
121 | static const bool empty_zero_p = true; |
122 | static inline void mark_empty (value_type &p) {p = NULL_TREE(tree) __null;} |
123 | static inline bool is_empty (value_type p) {return !p;} |
124 | |
125 | static bool is_deleted (value_type e) |
126 | { |
127 | return e == reinterpret_cast <value_type> (1); |
128 | } |
129 | static void mark_deleted (value_type &e) |
130 | { |
131 | e = reinterpret_cast <value_type> (1); |
132 | } |
133 | }; |
134 | |
135 | /* A hash table of decls keyed by mangled name. Used to figure out if |
136 | we need compatibility aliases. */ |
137 | static GTY(()) hash_table<mangled_decl_hash> *mangled_decls; |
138 | |
139 | /* Nonzero if we're done parsing and into end-of-file activities. */ |
140 | |
141 | int at_eof; |
142 | |
143 | /* True if note_mangling_alias should enqueue mangling aliases for |
144 | later generation, rather than emitting them right away. */ |
145 | |
146 | bool defer_mangling_aliases = true; |
147 | |
148 | |
149 | /* Return a member function type (a METHOD_TYPE), given FNTYPE (a |
150 | FUNCTION_TYPE), CTYPE (class type), and QUALS (the cv-qualifiers |
151 | that apply to the function). */ |
152 | |
153 | tree |
154 | build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals, |
155 | cp_ref_qualifier rqual) |
156 | { |
157 | if (fntype == error_mark_nodeglobal_trees[TI_ERROR_MARK] || ctype == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
158 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
159 | |
160 | gcc_assert (FUNC_OR_METHOD_TYPE_P (fntype))((void)(!((((enum tree_code) (fntype)->base.code) == FUNCTION_TYPE || ((enum tree_code) (fntype)->base.code) == METHOD_TYPE) ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 160, __FUNCTION__), 0 : 0)); |
161 | |
162 | cp_cv_quals type_quals = quals & ~TYPE_QUAL_RESTRICT; |
163 | ctype = cp_build_qualified_type (ctype, type_quals)cp_build_qualified_type_real ((ctype), (type_quals), tf_warning_or_error ); |
164 | |
165 | tree newtype |
166 | = build_method_type_directly (ctype, TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 166, __FUNCTION__))->typed.type), |
167 | (TREE_CODE (fntype)((enum tree_code) (fntype)->base.code) == METHOD_TYPE |
168 | ? TREE_CHAIN (TYPE_ARG_TYPES (fntype))((contains_struct_check ((((tree_check2 ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 168, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 168, __FUNCTION__))->common.chain) |
169 | : TYPE_ARG_TYPES (fntype)((tree_check2 ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 169, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values))); |
170 | if (tree attrs = TYPE_ATTRIBUTES (fntype)((tree_class_check ((fntype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 170, __FUNCTION__))->type_common.attributes)) |
171 | newtype = cp_build_type_attribute_variant (newtype, attrs); |
172 | newtype = build_cp_fntype_variant (newtype, rqual, |
173 | TYPE_RAISES_EXCEPTIONS (fntype)((tree_class_check (((tree_check2 ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 173, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 173, __FUNCTION__))->type_non_common.lang_1), |
174 | TYPE_HAS_LATE_RETURN_TYPE (fntype)(((tree_class_check (((tree_check2 ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 174, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 174, __FUNCTION__))->type_common.lang_flag_2))); |
175 | |
176 | return newtype; |
177 | } |
178 | |
179 | /* Return a variant of FNTYPE, a FUNCTION_TYPE or METHOD_TYPE, with its |
180 | return type changed to NEW_RET. */ |
181 | |
182 | tree |
183 | change_return_type (tree new_ret, tree fntype) |
184 | { |
185 | if (new_ret == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
186 | return fntype; |
187 | |
188 | if (same_type_p (new_ret, TREE_TYPE (fntype))comptypes ((new_ret), (((contains_struct_check ((fntype), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 188, __FUNCTION__))->typed.type)), 0)) |
189 | return fntype; |
190 | |
191 | tree newtype; |
192 | tree args = TYPE_ARG_TYPES (fntype)((tree_check2 ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 192, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
193 | |
194 | if (TREE_CODE (fntype)((enum tree_code) (fntype)->base.code) == FUNCTION_TYPE) |
195 | { |
196 | newtype = build_function_type (new_ret, args); |
197 | newtype = apply_memfn_quals (newtype, |
198 | type_memfn_quals (fntype)); |
199 | } |
200 | else |
201 | newtype = build_method_type_directly |
202 | (class_of_this_parm (fntype), new_ret, TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 202, __FUNCTION__))->common.chain)); |
203 | |
204 | if (tree attrs = TYPE_ATTRIBUTES (fntype)((tree_class_check ((fntype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 204, __FUNCTION__))->type_common.attributes)) |
205 | newtype = cp_build_type_attribute_variant (newtype, attrs); |
206 | newtype = cxx_copy_lang_qualifiers (newtype, fntype); |
207 | |
208 | return newtype; |
209 | } |
210 | |
211 | /* Build a PARM_DECL of FN with NAME and TYPE, and set DECL_ARG_TYPE |
212 | appropriately. */ |
213 | |
214 | tree |
215 | cp_build_parm_decl (tree fn, tree name, tree type) |
216 | { |
217 | tree parm = build_decl (input_location, |
218 | PARM_DECL, name, type); |
219 | DECL_CONTEXT (parm)((contains_struct_check ((parm), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 219, __FUNCTION__))->decl_minimal.context) = fn; |
220 | |
221 | /* DECL_ARG_TYPE is only used by the back end and the back end never |
222 | sees templates. */ |
223 | if (!processing_template_declscope_chain->x_processing_template_decl) |
224 | DECL_ARG_TYPE (parm)((tree_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 224, __FUNCTION__, (PARM_DECL)))->decl_common.initial) = type_passed_as (type); |
225 | |
226 | return parm; |
227 | } |
228 | |
229 | /* Returns a PARM_DECL of FN for a parameter of the indicated TYPE, with the |
230 | indicated NAME. */ |
231 | |
232 | tree |
233 | build_artificial_parm (tree fn, tree name, tree type) |
234 | { |
235 | tree parm = cp_build_parm_decl (fn, name, type); |
236 | DECL_ARTIFICIAL (parm)((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 236, __FUNCTION__))->decl_common.artificial_flag) = 1; |
237 | /* All our artificial parms are implicitly `const'; they cannot be |
238 | assigned to. */ |
239 | TREE_READONLY (parm)((non_type_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 239, __FUNCTION__))->base.readonly_flag) = 1; |
240 | return parm; |
241 | } |
242 | |
243 | /* Constructors for types with virtual baseclasses need an "in-charge" flag |
244 | saying whether this constructor is responsible for initialization of |
245 | virtual baseclasses or not. All destructors also need this "in-charge" |
246 | flag, which additionally determines whether or not the destructor should |
247 | free the memory for the object. |
248 | |
249 | This function adds the "in-charge" flag to member function FN if |
250 | appropriate. It is called from grokclassfn and tsubst. |
251 | FN must be either a constructor or destructor. |
252 | |
253 | The in-charge flag follows the 'this' parameter, and is followed by the |
254 | VTT parm (if any), then the user-written parms. */ |
255 | |
256 | void |
257 | maybe_retrofit_in_chrg (tree fn) |
258 | { |
259 | tree basetype, arg_types, parms, parm, fntype; |
260 | |
261 | /* If we've already add the in-charge parameter don't do it again. */ |
262 | if (DECL_HAS_IN_CHARGE_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 262, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 262, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 262, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 262, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 262, __FUNCTION__); <->u.fn; })->has_in_charge_parm_p )) |
263 | return; |
264 | |
265 | /* When processing templates we can't know, in general, whether or |
266 | not we're going to have virtual baseclasses. */ |
267 | if (processing_template_declscope_chain->x_processing_template_decl) |
268 | return; |
269 | |
270 | /* We don't need an in-charge parameter for constructors that don't |
271 | have virtual bases. */ |
272 | if (DECL_CONSTRUCTOR_P (fn)((tree_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 272, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 272, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) |
273 | && !CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn))((((tree_class_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 273, __FUNCTION__))->decl_minimal.context)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 273, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases)) |
274 | return; |
275 | |
276 | arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 276, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 276, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
277 | basetype = TREE_TYPE (TREE_VALUE (arg_types))((contains_struct_check ((((tree_check ((arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 277, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 277, __FUNCTION__))->typed.type); |
278 | arg_types = TREE_CHAIN (arg_types)((contains_struct_check ((arg_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 278, __FUNCTION__))->common.chain); |
279 | |
280 | parms = DECL_CHAIN (DECL_ARGUMENTS (fn))(((contains_struct_check (((contains_struct_check ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 280, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 280, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 280, __FUNCTION__))->common.chain)); |
281 | |
282 | /* If this is a subobject constructor or destructor, our caller will |
283 | pass us a pointer to our VTT. */ |
284 | if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn))((((tree_class_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 284, __FUNCTION__))->decl_minimal.context)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 284, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases)) |
285 | { |
286 | parm = build_artificial_parm (fn, vtt_parm_identifiercp_global_trees[CPTI_VTT_PARM_IDENTIFIER], vtt_parm_typecp_global_trees[CPTI_VTT_PARM_TYPE]); |
287 | |
288 | /* First add it to DECL_ARGUMENTS between 'this' and the real args... */ |
289 | DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 289, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 289, __FUNCTION__))->common.chain)) = parms; |
290 | parms = parm; |
291 | |
292 | /* ...and then to TYPE_ARG_TYPES. */ |
293 | arg_types = hash_tree_chain (vtt_parm_typecp_global_trees[CPTI_VTT_PARM_TYPE], arg_types); |
294 | |
295 | DECL_HAS_VTT_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 295, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 295, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 295, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 295, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 295, __FUNCTION__); <->u.fn; })->has_vtt_parm_p ) = 1; |
296 | } |
297 | |
298 | /* Then add the in-charge parm (before the VTT parm). */ |
299 | parm = build_artificial_parm (fn, in_charge_identifiercp_global_trees[CPTI_IN_CHARGE_IDENTIFIER], integer_type_nodeinteger_types[itk_int]); |
300 | DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 300, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 300, __FUNCTION__))->common.chain)) = parms; |
301 | parms = parm; |
302 | arg_types = hash_tree_chain (integer_type_nodeinteger_types[itk_int], arg_types); |
303 | |
304 | /* Insert our new parameter(s) into the list. */ |
305 | DECL_CHAIN (DECL_ARGUMENTS (fn))(((contains_struct_check (((contains_struct_check ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 305, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 305, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 305, __FUNCTION__))->common.chain)) = parms; |
306 | |
307 | /* And rebuild the function type. */ |
308 | fntype = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (fn))((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 308, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 308, __FUNCTION__))->typed.type), |
309 | arg_types); |
310 | if (TYPE_ATTRIBUTES (TREE_TYPE (fn))((tree_class_check ((((contains_struct_check ((fn), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 310, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 310, __FUNCTION__))->type_common.attributes)) |
311 | fntype = (cp_build_type_attribute_variant |
312 | (fntype, TYPE_ATTRIBUTES (TREE_TYPE (fn))((tree_class_check ((((contains_struct_check ((fn), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 312, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 312, __FUNCTION__))->type_common.attributes))); |
313 | fntype = cxx_copy_lang_qualifiers (fntype, TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 313, __FUNCTION__))->typed.type)); |
314 | TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 314, __FUNCTION__))->typed.type) = fntype; |
315 | |
316 | /* Now we've got the in-charge parameter. */ |
317 | DECL_HAS_IN_CHARGE_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 317, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 317, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 317, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 317, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 317, __FUNCTION__); <->u.fn; })->has_in_charge_parm_p ) = 1; |
318 | } |
319 | |
320 | /* Classes overload their constituent function names automatically. |
321 | When a function name is declared in a record structure, |
322 | its name is changed to it overloaded name. Since names for |
323 | constructors and destructors can conflict, we place a leading |
324 | '$' for destructors. |
325 | |
326 | CNAME is the name of the class we are grokking for. |
327 | |
328 | FUNCTION is a FUNCTION_DECL. It was created by `grokdeclarator'. |
329 | |
330 | FLAGS contains bits saying what's special about today's |
331 | arguments. DTOR_FLAG == DESTRUCTOR. |
332 | |
333 | If FUNCTION is a destructor, then we must add the `auto-delete' field |
334 | as a second parameter. There is some hair associated with the fact |
335 | that we must "declare" this variable in the manner consistent with the |
336 | way the rest of the arguments were declared. |
337 | |
338 | QUALS are the qualifiers for the this pointer. */ |
339 | |
340 | void |
341 | grokclassfn (tree ctype, tree function, enum overload_flags flags) |
342 | { |
343 | tree fn_name = DECL_NAME (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 343, __FUNCTION__))->decl_minimal.name); |
344 | |
345 | /* Even within an `extern "C"' block, members get C++ linkage. See |
346 | [dcl.link] for details. */ |
347 | SET_DECL_LANGUAGE (function, lang_cplusplus)(((contains_struct_check ((function), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 347, __FUNCTION__))->decl_common.lang_specific)->u.base .language = (lang_cplusplus)); |
348 | |
349 | if (fn_name == NULL_TREE(tree) __null) |
350 | { |
351 | error ("name missing for member function"); |
352 | fn_name = get_identifier ("<anonymous>")(__builtin_constant_p ("<anonymous>") ? get_identifier_with_length (("<anonymous>"), strlen ("<anonymous>")) : get_identifier ("<anonymous>")); |
353 | DECL_NAME (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 353, __FUNCTION__))->decl_minimal.name) = fn_name; |
354 | } |
355 | |
356 | DECL_CONTEXT (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 356, __FUNCTION__))->decl_minimal.context) = ctype; |
357 | |
358 | if (flags == DTOR_FLAG) |
359 | DECL_CXX_DESTRUCTOR_P (function)((tree_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 359, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) = 1; |
360 | |
361 | if (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function)((tree_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 361, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 361, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) |
362 | maybe_retrofit_in_chrg (function); |
363 | } |
364 | |
365 | /* Create an ARRAY_REF, checking for the user doing things backwards |
366 | along the way. DECLTYPE_P is for N3276, as in the parser. */ |
367 | |
368 | tree |
369 | grok_array_decl (location_t loc, tree array_expr, tree index_exp, |
370 | bool decltype_p) |
371 | { |
372 | tree type; |
373 | tree expr; |
374 | tree orig_array_expr = array_expr; |
375 | tree orig_index_exp = index_exp; |
376 | tree overload = NULL_TREE(tree) __null; |
377 | |
378 | if (error_operand_p (array_expr)((array_expr) == global_trees[TI_ERROR_MARK] || ((array_expr) && ((contains_struct_check (((array_expr)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 378, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ])) || error_operand_p (index_exp)((index_exp) == global_trees[TI_ERROR_MARK] || ((index_exp) && ((contains_struct_check (((index_exp)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 378, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ]))) |
379 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
380 | |
381 | if (processing_template_declscope_chain->x_processing_template_decl) |
382 | { |
383 | if (type_dependent_expression_p (array_expr) |
384 | || type_dependent_expression_p (index_exp)) |
385 | return build_min_nt_loc (loc, ARRAY_REF, array_expr, index_exp, |
386 | NULL_TREE(tree) __null, NULL_TREE(tree) __null); |
387 | array_expr = build_non_dependent_expr (array_expr); |
388 | index_exp = build_non_dependent_expr (index_exp); |
389 | } |
390 | |
391 | type = TREE_TYPE (array_expr)((contains_struct_check ((array_expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 391, __FUNCTION__))->typed.type); |
392 | gcc_assert (type)((void)(!(type) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 392, __FUNCTION__), 0 : 0)); |
393 | type = non_reference (type); |
394 | |
395 | /* If they have an `operator[]', use that. */ |
396 | if (MAYBE_CLASS_TYPE_P (type)((((enum tree_code) (type)->base.code) == TEMPLATE_TYPE_PARM || ((enum tree_code) (type)->base.code) == TYPENAME_TYPE || ((enum tree_code) (type)->base.code) == TYPEOF_TYPE || (( enum tree_code) (type)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (type)->base.code) == DECLTYPE_TYPE) || (((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->type_common.lang_flag_5))) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp))((((enum tree_code) (((contains_struct_check ((index_exp), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type))->base.code) == TEMPLATE_TYPE_PARM || ((enum tree_code) (((contains_struct_check ((index_exp), ( TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type))->base.code) == TYPENAME_TYPE || ((enum tree_code) (((contains_struct_check ((index_exp), ( TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type))->base.code) == TYPEOF_TYPE || ((enum tree_code) (((contains_struct_check ((index_exp), ( TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (((contains_struct_check ((index_exp), ( TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type))->base.code) == DECLTYPE_TYPE ) || (((((enum tree_code) (((contains_struct_check ((index_exp ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((index_exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((index_exp ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 396, __FUNCTION__))->type_common.lang_flag_5)))) |
397 | { |
398 | tsubst_flags_t complain = tf_warning_or_error; |
399 | if (decltype_p) |
400 | complain |= tf_decltype; |
401 | expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL((1 << 0)), array_expr, |
402 | index_exp, NULL_TREE(tree) __null, &overload, complain); |
403 | } |
404 | else |
405 | { |
406 | tree p1, p2, i1, i2; |
407 | bool swapped = false; |
408 | |
409 | /* Otherwise, create an ARRAY_REF for a pointer or array type. |
410 | It is a little-known fact that, if `a' is an array and `i' is |
411 | an int, you can write `i[a]', which means the same thing as |
412 | `a[i]'. */ |
413 | if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE || VECTOR_TYPE_P (type)(((enum tree_code) (type)->base.code) == VECTOR_TYPE)) |
414 | p1 = array_expr; |
415 | else |
416 | p1 = build_expr_type_conversion (WANT_POINTER8, array_expr, false); |
417 | |
418 | if (TREE_CODE (TREE_TYPE (index_exp))((enum tree_code) (((contains_struct_check ((index_exp), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 418, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) |
419 | p2 = index_exp; |
420 | else |
421 | p2 = build_expr_type_conversion (WANT_POINTER8, index_exp, false); |
422 | |
423 | i1 = build_expr_type_conversion (WANT_INT1 | WANT_ENUM4, array_expr, |
424 | false); |
425 | i2 = build_expr_type_conversion (WANT_INT1 | WANT_ENUM4, index_exp, |
426 | false); |
427 | |
428 | if ((p1 && i2) && (i1 && p2)) |
429 | error ("ambiguous conversion for array subscript"); |
430 | |
431 | if (p1 && i2) |
432 | array_expr = p1, index_exp = i2; |
433 | else if (i1 && p2) |
434 | swapped = true, array_expr = p2, index_exp = i1; |
435 | else |
436 | { |
437 | error_at (loc, "invalid types %<%T[%T]%> for array subscript", |
438 | type, TREE_TYPE (index_exp)((contains_struct_check ((index_exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 438, __FUNCTION__))->typed.type)); |
439 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
440 | } |
441 | |
442 | if (array_expr == error_mark_nodeglobal_trees[TI_ERROR_MARK] || index_exp == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
443 | error ("ambiguous conversion for array subscript"); |
444 | |
445 | if (TYPE_PTR_P (TREE_TYPE (array_expr))(((enum tree_code) (((contains_struct_check ((array_expr), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 445, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE )) |
446 | array_expr = mark_rvalue_use (array_expr); |
447 | else |
448 | array_expr = mark_lvalue_use_nonread (array_expr); |
449 | index_exp = mark_rvalue_use (index_exp); |
450 | if (swapped |
451 | && flag_strong_eval_orderglobal_options.x_flag_strong_eval_order == 2 |
452 | && (TREE_SIDE_EFFECTS (array_expr)((non_type_check ((array_expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 452, __FUNCTION__))->base.side_effects_flag) || TREE_SIDE_EFFECTS (index_exp)((non_type_check ((index_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 452, __FUNCTION__))->base.side_effects_flag))) |
453 | expr = build_array_ref (input_location, index_exp, array_expr); |
454 | else |
455 | expr = build_array_ref (input_location, array_expr, index_exp); |
456 | } |
457 | if (processing_template_declscope_chain->x_processing_template_decl && expr != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
458 | { |
459 | if (overload != NULL_TREE(tree) __null) |
460 | return (build_min_non_dep_op_overload |
461 | (ARRAY_REF, expr, overload, orig_array_expr, orig_index_exp)); |
462 | |
463 | return build_min_non_dep (ARRAY_REF, expr, orig_array_expr, orig_index_exp, |
464 | NULL_TREE(tree) __null, NULL_TREE(tree) __null); |
465 | } |
466 | return expr; |
467 | } |
468 | |
469 | /* Given the cast expression EXP, checking out its validity. Either return |
470 | an error_mark_node if there was an unavoidable error, return a cast to |
471 | void for trying to delete a pointer w/ the value 0, or return the |
472 | call to delete. If DOING_VEC is true, we handle things differently |
473 | for doing an array delete. |
474 | Implements ARM $5.3.4. This is called from the parser. */ |
475 | |
476 | tree |
477 | delete_sanity (location_t loc, tree exp, tree size, bool doing_vec, |
478 | int use_global_delete, tsubst_flags_t complain) |
479 | { |
480 | tree t, type; |
481 | |
482 | if (exp == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
483 | return exp; |
484 | |
485 | if (processing_template_declscope_chain->x_processing_template_decl) |
486 | { |
487 | t = build_min (DELETE_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], exp, size); |
488 | DELETE_EXPR_USE_GLOBAL (t)((tree_not_check2 (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 488, __FUNCTION__, (DELETE_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 488, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = use_global_delete; |
489 | DELETE_EXPR_USE_VEC (t)((tree_not_check2 (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 489, __FUNCTION__, (DELETE_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 489, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) = doing_vec; |
490 | TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 490, __FUNCTION__))->base.side_effects_flag) = 1; |
491 | SET_EXPR_LOCATION (t, loc)(expr_check (((t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 491, __FUNCTION__))->exp.locus = (loc); |
492 | return t; |
493 | } |
494 | |
495 | location_t exp_loc = cp_expr_loc_or_loc (exp, loc); |
496 | |
497 | /* An array can't have been allocated by new, so complain. */ |
498 | if (TREE_CODE (TREE_TYPE (exp))((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 498, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE |
499 | && (complain & tf_warning)) |
500 | warning_at (exp_loc, 0, "deleting array %q#E", exp); |
501 | |
502 | t = build_expr_type_conversion (WANT_POINTER8, exp, true); |
503 | |
504 | if (t == NULL_TREE(tree) __null || t == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
505 | { |
506 | if (complain & tf_error) |
507 | error_at (exp_loc, |
508 | "type %q#T argument given to %<delete%>, expected pointer", |
509 | TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 509, __FUNCTION__))->typed.type)); |
510 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
511 | } |
512 | |
513 | type = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 513, __FUNCTION__))->typed.type); |
514 | |
515 | /* As of Valley Forge, you can delete a pointer to const. */ |
516 | |
517 | /* You can't delete functions. */ |
518 | if (TREE_CODE (TREE_TYPE (type))((enum tree_code) (((contains_struct_check ((type), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 518, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE) |
519 | { |
520 | if (complain & tf_error) |
521 | error_at (exp_loc, |
522 | "cannot delete a function. Only pointer-to-objects are " |
523 | "valid arguments to %<delete%>"); |
524 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
525 | } |
526 | |
527 | /* Deleting ptr to void is undefined behavior [expr.delete/3]. */ |
528 | if (VOID_TYPE_P (TREE_TYPE (type))(((enum tree_code) (((contains_struct_check ((type), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 528, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE )) |
529 | { |
530 | if (complain & tf_warning) |
531 | warning_at (exp_loc, OPT_Wdelete_incomplete, |
532 | "deleting %qT is undefined", type); |
533 | doing_vec = 0; |
534 | } |
535 | |
536 | /* Deleting a pointer with the value zero is valid and has no effect. */ |
537 | if (integer_zerop (t)) |
538 | return build1_loc (loc, NOP_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], t); |
539 | |
540 | if (doing_vec) |
541 | return build_vec_delete (loc, t, /*maxindex=*/NULL_TREE(tree) __null, |
542 | sfk_deleting_destructor, |
543 | use_global_delete, complain); |
544 | else |
545 | return build_delete (loc, type, t, sfk_deleting_destructor, |
546 | LOOKUP_NORMAL((1 << 0)), use_global_delete, |
547 | complain); |
548 | } |
549 | |
550 | /* Report an error if the indicated template declaration is not the |
551 | sort of thing that should be a member template. */ |
552 | |
553 | void |
554 | check_member_template (tree tmpl) |
555 | { |
556 | tree decl; |
557 | |
558 | gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL)((void)(!(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 558, __FUNCTION__), 0 : 0)); |
559 | decl = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 559, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
560 | |
561 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
562 | || DECL_ALIAS_TEMPLATE_P (tmpl)((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 562, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 562, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == TYPE_DECL) && !((contains_struct_check (((( struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 562, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 562, __FUNCTION__))->decl_common.artificial_flag)) |
563 | || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL |
564 | && MAYBE_CLASS_TYPE_P (TREE_TYPE (decl))((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type))->base.code) == TEMPLATE_TYPE_PARM || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type))->base.code) == TYPENAME_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type))->base.code) == TYPEOF_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type))->base.code) == DECLTYPE_TYPE ) || (((((enum tree_code) (((contains_struct_check ((decl), ( TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((decl ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 564, __FUNCTION__))->type_common.lang_flag_5))))) |
565 | { |
566 | /* The parser rejects template declarations in local classes |
567 | (with the exception of generic lambdas). */ |
568 | gcc_assert (!current_function_decl || LAMBDA_FUNCTION_P (decl))((void)(!(!current_function_decl || ((((enum tree_code) (decl )->base.code) == FUNCTION_DECL || (((enum tree_code) (decl )->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && (((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) && ((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)-> base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)( const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (decl)->base.code) == FUNCTION_DECL || (( (enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__); <->u.fn; })->ovl_op_code) == OVL_OP_CALL_EXPR) && (((enum tree_code) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]))->base.code) == RECORD_TYPE && (((( tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name))->base.code))] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name))->base.code))] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag )))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 568, __FUNCTION__), 0 : 0)); |
569 | /* The parser rejects any use of virtual in a function template. */ |
570 | gcc_assert (!(TREE_CODE (decl) == FUNCTION_DECL((void)(!(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL && ((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 571, __FUNCTION__))->decl_common.virtual_flag))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 571, __FUNCTION__), 0 : 0)) |
571 | && DECL_VIRTUAL_P (decl)))((void)(!(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL && ((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 571, __FUNCTION__))->decl_common.virtual_flag))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 571, __FUNCTION__), 0 : 0)); |
572 | |
573 | /* The debug-information generating code doesn't know what to do |
574 | with member templates. */ |
575 | DECL_IGNORED_P (tmpl)((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 575, __FUNCTION__))->decl_common.ignored_flag) = 1; |
576 | } |
577 | else if (variable_template_p (tmpl)) |
578 | /* OK */; |
579 | else |
580 | error ("template declaration of %q#D", decl); |
581 | } |
582 | |
583 | /* Sanity check: report error if this function FUNCTION is not |
584 | really a member of the class (CTYPE) it is supposed to belong to. |
585 | TEMPLATE_PARMS is used to specify the template parameters of a member |
586 | template passed as FUNCTION_DECL. If the member template is passed as a |
587 | TEMPLATE_DECL, it can be NULL since the parameters can be extracted |
588 | from the declaration. If the function is not a function template, it |
589 | must be NULL. |
590 | It returns the original declaration for the function, NULL_TREE if |
591 | no declaration was found, error_mark_node if an error was emitted. */ |
592 | |
593 | tree |
594 | check_classfn (tree ctype, tree function, tree template_parms) |
595 | { |
596 | if (DECL_USE_TEMPLATE (function)(((contains_struct_check ((function), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 596, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) |
597 | && !(TREE_CODE (function)((enum tree_code) (function)->base.code) == TEMPLATE_DECL |
598 | && DECL_TEMPLATE_SPECIALIZATION (function)((((contains_struct_check ((function), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 598, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2)) |
599 | && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (function))(((contains_struct_check (((tree_check ((((struct tree_template_info *)(tree_check (((((contains_struct_check ((template_info_decl_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 599, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 599, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 599, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 599, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 599, __FUNCTION__))->decl_common.lang_flag_1))) |
600 | /* Since this is a specialization of a member template, |
601 | we're not going to find the declaration in the class. |
602 | For example, in: |
603 | |
604 | struct S { template <typename T> void f(T); }; |
605 | template <> void S::f(int); |
606 | |
607 | we're not going to find `S::f(int)', but there's no |
608 | reason we should, either. We let our callers know we didn't |
609 | find the method, but we don't complain. */ |
610 | return NULL_TREE(tree) __null; |
611 | |
612 | /* Basic sanity check: for a template function, the template parameters |
613 | either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */ |
614 | if (TREE_CODE (function)((enum tree_code) (function)->base.code) == TEMPLATE_DECL) |
615 | { |
616 | if (template_parms |
617 | && !comp_template_parms (template_parms, |
618 | DECL_TEMPLATE_PARMS (function)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 618, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments)) |
619 | { |
620 | error ("template parameter lists provided don%'t match the " |
621 | "template parameters of %qD", function); |
622 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
623 | } |
624 | template_parms = DECL_TEMPLATE_PARMS (function)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 624, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments; |
625 | } |
626 | |
627 | /* OK, is this a definition of a member template? */ |
628 | bool is_template = (template_parms != NULL_TREE(tree) __null); |
629 | |
630 | /* [temp.mem] |
631 | |
632 | A destructor shall not be a member template. */ |
633 | if (DECL_DESTRUCTOR_P (function)((tree_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 633, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 633, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) && is_template) |
634 | { |
635 | error ("destructor %qD declared as member template", function); |
636 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
637 | } |
638 | |
639 | /* We must enter the scope here, because conversion operators are |
640 | named by target type, and type equivalence relies on typenames |
641 | resolving within the scope of CTYPE. */ |
642 | tree pushed_scope = push_scope (ctype); |
643 | tree matched = NULL_TREE(tree) __null; |
644 | tree fns = get_class_binding (ctype, DECL_NAME (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 644, __FUNCTION__))->decl_minimal.name)); |
645 | |
646 | for (ovl_iterator iter (fns); !matched && iter; ++iter) |
647 | { |
648 | tree fndecl = *iter; |
649 | |
650 | /* A member template definition only matches a member template |
651 | declaration. */ |
652 | if (is_template != (TREE_CODE (fndecl)((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL)) |
653 | continue; |
654 | |
655 | if (!DECL_DECLARES_FUNCTION_P (fndecl)(((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 655, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 655, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL))) |
656 | continue; |
657 | |
658 | tree p1 = TYPE_ARG_TYPES (TREE_TYPE (function))((tree_check2 ((((contains_struct_check ((function), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 658, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 658, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
659 | tree p2 = TYPE_ARG_TYPES (TREE_TYPE (fndecl))((tree_check2 ((((contains_struct_check ((fndecl), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 659, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 659, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
660 | |
661 | /* We cannot simply call decls_match because this doesn't work |
662 | for static member functions that are pretending to be |
663 | methods, and because the name may have been changed by |
664 | asm("new_name"). */ |
665 | |
666 | /* Get rid of the this parameter on functions that become |
667 | static. */ |
668 | if (DECL_STATIC_FUNCTION_P (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 668, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 668, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 668, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 668, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 668, __FUNCTION__); <->u.fn; })->static_function ) |
669 | && TREE_CODE (TREE_TYPE (function))((enum tree_code) (((contains_struct_check ((function), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 669, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE) |
670 | p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 670, __FUNCTION__))->common.chain); |
671 | |
672 | /* ref-qualifier or absence of same must match. */ |
673 | if (type_memfn_rqual (TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 673, __FUNCTION__))->typed.type)) |
674 | != type_memfn_rqual (TREE_TYPE (fndecl)((contains_struct_check ((fndecl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 674, __FUNCTION__))->typed.type))) |
675 | continue; |
676 | |
677 | // Include constraints in the match. |
678 | tree c1 = get_constraints (function); |
679 | tree c2 = get_constraints (fndecl); |
680 | |
681 | /* While finding a match, same types and params are not enough |
682 | if the function is versioned. Also check version ("target") |
683 | attributes. */ |
684 | if (same_type_p (TREE_TYPE (TREE_TYPE (function)),comptypes ((((contains_struct_check ((((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 684, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 684, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((fndecl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 685, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 685, __FUNCTION__))->typed.type)), 0) |
685 | TREE_TYPE (TREE_TYPE (fndecl)))comptypes ((((contains_struct_check ((((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 684, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 684, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((fndecl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 685, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 685, __FUNCTION__))->typed.type)), 0) |
686 | && compparms (p1, p2) |
687 | && !targetm.target_option.function_versions (function, fndecl) |
688 | && (!is_template |
689 | || comp_template_parms (template_parms, |
690 | DECL_TEMPLATE_PARMS (fndecl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 690, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments)) |
691 | && equivalent_constraints (c1, c2) |
692 | && (DECL_TEMPLATE_SPECIALIZATION (function)((((contains_struct_check ((function), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 692, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2) |
693 | == DECL_TEMPLATE_SPECIALIZATION (fndecl)((((contains_struct_check ((fndecl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 693, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2)) |
694 | && (!DECL_TEMPLATE_SPECIALIZATION (function)((((contains_struct_check ((function), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 694, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2) |
695 | || (DECL_TI_TEMPLATE (function)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 695, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 695, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 695, __FUNCTION__, (TEMPLATE_INFO))))->tmpl == DECL_TI_TEMPLATE (fndecl)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 695, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 695, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 695, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))) |
696 | matched = fndecl; |
697 | } |
698 | |
699 | if (!matched) |
700 | { |
701 | if (!COMPLETE_TYPE_P (ctype)(((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 701, __FUNCTION__))->type_common.size) != (tree) __null)) |
702 | cxx_incomplete_type_error (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 702, __FUNCTION__))->decl_minimal.locus), |
703 | function, ctype); |
704 | else |
705 | { |
706 | if (DECL_CONV_FN_P (function)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 706, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) |
707 | fns = get_class_binding (ctype, conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER]); |
708 | |
709 | error_at (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 709, __FUNCTION__))->decl_minimal.locus), |
710 | "no declaration matches %q#D", function); |
711 | if (fns) |
712 | print_candidates (fns); |
713 | else if (DECL_CONV_FN_P (function)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 713, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) |
714 | inform (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 714, __FUNCTION__))->decl_minimal.locus), |
715 | "no conversion operators declared"); |
716 | else |
717 | inform (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 717, __FUNCTION__))->decl_minimal.locus), |
718 | "no functions named %qD", function); |
719 | inform (DECL_SOURCE_LOCATION (TYPE_NAME (ctype))((contains_struct_check ((((tree_class_check ((ctype), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 719, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 719, __FUNCTION__))->decl_minimal.locus), |
720 | "%#qT defined here", ctype); |
721 | } |
722 | matched = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
723 | } |
724 | |
725 | if (pushed_scope) |
726 | pop_scope (pushed_scope); |
727 | |
728 | return matched; |
729 | } |
730 | |
731 | /* DECL is a function with vague linkage. Remember it so that at the |
732 | end of the translation unit we can decide whether or not to emit |
733 | it. */ |
734 | |
735 | void |
736 | note_vague_linkage_fn (tree decl) |
737 | { |
738 | if (processing_template_declscope_chain->x_processing_template_decl) |
739 | return; |
740 | |
741 | DECL_DEFER_OUTPUT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 741, __FUNCTION__))->decl_with_vis.defer_output) = 1; |
742 | vec_safe_push (deferred_fns, decl); |
743 | } |
744 | |
745 | /* As above, but for variable template instantiations. */ |
746 | |
747 | void |
748 | note_variable_template_instantiation (tree decl) |
749 | { |
750 | vec_safe_push (pending_statics, decl); |
751 | } |
752 | |
753 | /* We have just processed the DECL, which is a static data member. |
754 | The other parameters are as for cp_finish_decl. */ |
755 | |
756 | void |
757 | finish_static_data_member_decl (tree decl, |
758 | tree init, bool init_const_expr_p, |
759 | tree asmspec_tree, |
760 | int flags) |
761 | { |
762 | if (DECL_TEMPLATE_INSTANTIATED (decl)((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 762, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 762, __FUNCTION__))->decl_common.lang_flag_1)) |
763 | /* We already needed to instantiate this, so the processing in this |
764 | function is unnecessary/wrong. */ |
765 | return; |
766 | |
767 | DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 767, __FUNCTION__))->decl_minimal.context) = current_class_typescope_chain->class_type; |
768 | |
769 | /* We cannot call pushdecl here, because that would fill in the |
770 | TREE_CHAIN of our decl. Instead, we modify cp_finish_decl to do |
771 | the right thing, namely, to put this decl out straight away. */ |
772 | |
773 | if (! processing_template_declscope_chain->x_processing_template_decl) |
774 | vec_safe_push (pending_statics, decl); |
775 | |
776 | if (LOCAL_CLASS_P (current_class_type)(decl_function_context (((((contains_struct_check (((tree_class_check ((((tree_class_check ((scope_chain->class_type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 776, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 776, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 776, __FUNCTION__))->common.chain)))) != (tree) __null) |
777 | /* We already complained about the template definition. */ |
778 | && !DECL_TEMPLATE_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 778, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) & 1)) |
779 | permerror (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 779, __FUNCTION__))->decl_minimal.locus), |
780 | "local class %q#T shall not have static data member %q#D", |
781 | current_class_typescope_chain->class_type, decl); |
782 | else |
783 | for (tree t = current_class_typescope_chain->class_type; TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))] == tcc_type); |
784 | t = CP_TYPE_CONTEXT (t)(!(! (((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 784, __FUNCTION__))->type_common.context)) || ((enum tree_code ) (((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 784, __FUNCTION__))->type_common.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((t), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 784, __FUNCTION__))->type_common.context) : cp_global_trees [CPTI_GLOBAL])) |
785 | if (TYPE_UNNAMED_P (t)((((((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name))->base.code))] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((t), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name))->base.code))] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag )) && !((tree_check ((((((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name))->base.code))] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 785, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag ))) |
786 | { |
787 | auto_diagnostic_group d; |
788 | if (permerror (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 788, __FUNCTION__))->decl_minimal.locus), |
789 | "static data member %qD in unnamed class", decl)) |
790 | inform (DECL_SOURCE_LOCATION (TYPE_NAME (t))((contains_struct_check ((((tree_class_check ((t), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 790, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 790, __FUNCTION__))->decl_minimal.locus), |
791 | "unnamed class defined here"); |
792 | break; |
793 | } |
794 | |
795 | if (DECL_INLINE_VAR_P (decl)((((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__))->decl_common.lang_specific)->u.base .var_declared_inline_p : false) || (cxx_dialect >= cxx17 && ((contains_struct_check (((tree_check2 (((((enum tree_code) ( decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__))->decl_common.lang_flag_8) && (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__))->decl_minimal.context) && (tree_code_type [(int) (((enum tree_code) (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)))) && !DECL_TEMPLATE_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 795, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) & 1)) |
796 | /* An inline variable is immediately defined, so don't set DECL_IN_AGGR_P. |
797 | Except that if decl is a template instantiation, it isn't defined until |
798 | instantiate_decl. */; |
799 | else |
800 | DECL_IN_AGGR_P (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 800, __FUNCTION__))->decl_common.lang_flag_3)) = 1; |
801 | |
802 | if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 802, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE |
803 | && TYPE_DOMAIN (TREE_TYPE (decl))((tree_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 803, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 803, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ) == NULL_TREE(tree) __null) |
804 | SET_VAR_HAD_UNKNOWN_BOUND (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 804, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 804, __FUNCTION__))->decl_common.lang_specific)->u.base .unknown_bound_p = true); |
805 | |
806 | if (init) |
807 | { |
808 | /* Similarly to start_decl_1, we want to complete the type in order |
809 | to do the right thing in cp_apply_type_quals_to_decl, possibly |
810 | clear TYPE_QUAL_CONST (c++/65579). */ |
811 | tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 811, __FUNCTION__))->typed.type) = complete_type (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 811, __FUNCTION__))->typed.type)); |
812 | cp_apply_type_quals_to_decl (cp_type_quals (type), decl); |
813 | } |
814 | |
815 | cp_finish_decl (decl, init, init_const_expr_p, asmspec_tree, flags); |
816 | } |
817 | |
818 | /* DECLARATOR and DECLSPECS correspond to a class member. The other |
819 | parameters are as for cp_finish_decl. Return the DECL for the |
820 | class member declared. */ |
821 | |
822 | tree |
823 | grokfield (const cp_declarator *declarator, |
824 | cp_decl_specifier_seq *declspecs, |
825 | tree init, bool init_const_expr_p, |
826 | tree asmspec_tree, |
827 | tree attrlist) |
828 | { |
829 | tree value; |
830 | const char *asmspec = 0; |
831 | int flags; |
832 | |
833 | if (init |
834 | && TREE_CODE (init)((enum tree_code) (init)->base.code) == TREE_LIST |
835 | && TREE_VALUE (init)((tree_check ((init), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 835, __FUNCTION__, (TREE_LIST)))->list.value) == error_mark_nodeglobal_trees[TI_ERROR_MARK] |
836 | && TREE_CHAIN (init)((contains_struct_check ((init), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 836, __FUNCTION__))->common.chain) == NULL_TREE(tree) __null) |
837 | init = NULL_TREE(tree) __null; |
838 | |
839 | int initialized; |
840 | if (init == ridpointers[(int)RID_DELETE]) |
841 | initialized = SD_DELETED4; |
842 | else if (init == ridpointers[(int)RID_DEFAULT]) |
843 | initialized = SD_DEFAULTED3; |
844 | else if (init) |
845 | initialized = SD_INITIALIZED1; |
846 | else |
847 | initialized = SD_UNINITIALIZED0; |
848 | |
849 | value = grokdeclarator (declarator, declspecs, FIELD, initialized, &attrlist); |
850 | if (! value || value == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
851 | /* friend or constructor went bad. */ |
852 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
853 | if (TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 853, __FUNCTION__))->typed.type) == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
854 | return value; |
855 | |
856 | if (TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL && init) |
857 | { |
858 | error_at (cp_expr_loc_or_loc (init, DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 858, __FUNCTION__))->decl_minimal.locus)), |
859 | "typedef %qD is initialized (use %qs instead)", |
860 | value, "decltype"); |
861 | init = NULL_TREE(tree) __null; |
862 | } |
863 | |
864 | /* Pass friendly classes back. */ |
865 | if (value == void_type_nodeglobal_trees[TI_VOID_TYPE]) |
866 | return value; |
867 | |
868 | if (DECL_NAME (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 868, __FUNCTION__))->decl_minimal.name) |
869 | && TREE_CODE (DECL_NAME (value))((enum tree_code) (((contains_struct_check ((value), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 869, __FUNCTION__))->decl_minimal.name))->base.code) == TEMPLATE_ID_EXPR) |
870 | { |
871 | error_at (declarator->id_loc, |
872 | "explicit template argument list not allowed"); |
873 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
874 | } |
875 | |
876 | /* Stash away type declarations. */ |
877 | if (TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL) |
878 | { |
879 | DECL_NONLOCAL (value)((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 879, __FUNCTION__))->decl_common.nonlocal_flag) = 1; |
880 | DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 880, __FUNCTION__))->decl_minimal.context) = current_class_typescope_chain->class_type; |
881 | |
882 | if (attrlist) |
883 | { |
884 | int attrflags = 0; |
885 | |
886 | /* If this is a typedef that names the class for linkage purposes |
887 | (7.1.3p8), apply any attributes directly to the type. */ |
888 | if (OVERLOAD_TYPE_P (TREE_TYPE (value))((((((enum tree_code) (((contains_struct_check ((value), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 888, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((value), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 888, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((value ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 888, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 888, __FUNCTION__))->type_common.lang_flag_5)) || ((enum tree_code) (((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 888, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE ) |
889 | && value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value)))((tree_class_check ((((tree_class_check ((((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 889, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 889, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 889, __FUNCTION__))->type_common.name)) |
890 | attrflags = ATTR_FLAG_TYPE_IN_PLACE; |
891 | |
892 | cplus_decl_attributes (&value, attrlist, attrflags); |
893 | } |
894 | |
895 | if (decl_spec_seq_has_spec_p (declspecs, ds_typedef) |
896 | && TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 896, __FUNCTION__))->typed.type) != error_mark_nodeglobal_trees[TI_ERROR_MARK] |
897 | && TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value)))((tree_class_check ((((tree_class_check ((((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 897, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 897, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 897, __FUNCTION__))->type_common.name) != value) |
898 | set_underlying_type (value); |
899 | |
900 | /* It's important that push_template_decl below follows |
901 | set_underlying_type above so that the created template |
902 | carries the properly set type of VALUE. */ |
903 | if (processing_template_declscope_chain->x_processing_template_decl) |
904 | value = push_template_decl (value); |
905 | |
906 | record_locally_defined_typedef (value); |
907 | return value; |
908 | } |
909 | |
910 | int friendp = decl_spec_seq_has_spec_p (declspecs, ds_friend); |
911 | |
912 | if (!friendp && DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 912, __FUNCTION__))->decl_common.lang_flag_3))) |
913 | { |
914 | error ("%qD is already defined in %qT", value, DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 914, __FUNCTION__))->decl_minimal.context)); |
915 | return void_type_nodeglobal_trees[TI_VOID_TYPE]; |
916 | } |
917 | |
918 | if (asmspec_tree && asmspec_tree != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
919 | asmspec = TREE_STRING_POINTER (asmspec_tree)((const char *)((tree_check ((asmspec_tree), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 919, __FUNCTION__, (STRING_CST)))->string.str)); |
920 | |
921 | if (init) |
922 | { |
923 | if (TREE_CODE (value)((enum tree_code) (value)->base.code) == FUNCTION_DECL) |
924 | { |
925 | if (init == ridpointers[(int)RID_DELETE]) |
926 | { |
927 | DECL_DELETED_FN (value)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (value)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 927, __FUNCTION__, (TEMPLATE_DECL))))))))->result : value )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 927, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (value)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (value)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 927, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 927, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 927, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = 1; |
928 | DECL_DECLARED_INLINE_P (value)((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 928, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) = 1; |
929 | } |
930 | else if (init == ridpointers[(int)RID_DEFAULT]) |
931 | { |
932 | if (defaultable_fn_check (value)) |
933 | { |
934 | DECL_DEFAULTED_FN (value)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (value)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 934, __FUNCTION__, (TEMPLATE_DECL))))))))->result : value )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 934, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (value)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (value)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 934, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 934, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 934, __FUNCTION__); <->u.fn; })->defaulted_p) = 1; |
935 | DECL_INITIALIZED_IN_CLASS_P (value)(((contains_struct_check (((tree_check2 ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 935, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 935, __FUNCTION__))->decl_common.lang_specific) ->u.base .initialized_in_class) = 1; |
936 | DECL_DECLARED_INLINE_P (value)((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 936, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) = 1; |
937 | /* grokfndecl set this to error_mark_node, but we want to |
938 | leave it unset until synthesize_method. */ |
939 | DECL_INITIAL (value)((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 939, __FUNCTION__))->decl_common.initial) = NULL_TREE(tree) __null; |
940 | } |
941 | } |
942 | else if (TREE_CODE (init)((enum tree_code) (init)->base.code) == DEFERRED_PARSE) |
943 | error ("invalid initializer for member function %qD", value); |
944 | else if (TREE_CODE (TREE_TYPE (value))((enum tree_code) (((contains_struct_check ((value), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 944, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE) |
945 | { |
946 | if (integer_zerop (init)) |
947 | DECL_PURE_VIRTUAL_P (value)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (value)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 947, __FUNCTION__, (TEMPLATE_DECL))))))))->result : value )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 947, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (value)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (value)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 947, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((value ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 947, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 947, __FUNCTION__); <->u.fn; })->pure_virtual) = 1; |
948 | else if (error_operand_p (init)((init) == global_trees[TI_ERROR_MARK] || ((init) && ( (contains_struct_check (((init)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 948, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ]))) |
949 | ; /* An error has already been reported. */ |
950 | else |
951 | error ("invalid initializer for member function %qD", |
952 | value); |
953 | } |
954 | else |
955 | { |
956 | gcc_assert (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE)((void)(!(((enum tree_code) (((contains_struct_check ((value) , (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 956, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 956, __FUNCTION__), 0 : 0)); |
957 | location_t iloc |
958 | = cp_expr_loc_or_loc (init, DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 958, __FUNCTION__))->decl_minimal.locus)); |
959 | if (friendp) |
960 | error_at (iloc, "initializer specified for friend " |
961 | "function %qD", value); |
962 | else |
963 | error_at (iloc, "initializer specified for static " |
964 | "member function %qD", value); |
965 | } |
966 | } |
967 | else if (TREE_CODE (value)((enum tree_code) (value)->base.code) == FIELD_DECL) |
968 | /* C++11 NSDMI, keep going. */; |
969 | else if (!VAR_P (value)(((enum tree_code) (value)->base.code) == VAR_DECL)) |
970 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 970, __FUNCTION__)); |
971 | } |
972 | |
973 | /* Pass friend decls back. */ |
974 | if ((TREE_CODE (value)((enum tree_code) (value)->base.code) == FUNCTION_DECL |
975 | || TREE_CODE (value)((enum tree_code) (value)->base.code) == TEMPLATE_DECL) |
976 | && DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 976, __FUNCTION__))->decl_minimal.context) != current_class_typescope_chain->class_type) |
977 | return value; |
978 | |
979 | /* Need to set this before push_template_decl. */ |
980 | if (VAR_P (value)(((enum tree_code) (value)->base.code) == VAR_DECL)) |
981 | DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 981, __FUNCTION__))->decl_minimal.context) = current_class_typescope_chain->class_type; |
982 | |
983 | if (processing_template_declscope_chain->x_processing_template_decl && VAR_OR_FUNCTION_DECL_P (value)(((enum tree_code) (value)->base.code) == VAR_DECL || ((enum tree_code) (value)->base.code) == FUNCTION_DECL)) |
984 | { |
985 | value = push_template_decl (value); |
986 | if (error_operand_p (value)((value) == global_trees[TI_ERROR_MARK] || ((value) && ((contains_struct_check (((value)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 986, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ]))) |
987 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
988 | } |
989 | |
990 | if (attrlist) |
991 | cplus_decl_attributes (&value, attrlist, 0); |
992 | |
993 | if (init && DIRECT_LIST_INIT_P (init)((((enum tree_code) (init)->base.code) == CONSTRUCTOR && ((contains_struct_check ((init), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 993, __FUNCTION__))->typed.type) == cp_global_trees[CPTI_INIT_LIST_TYPE ]) && (((tree_not_check2 (((tree_check ((init), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 993, __FUNCTION__, (CONSTRUCTOR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 993, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) |
994 | flags = LOOKUP_NORMAL((1 << 0)); |
995 | else |
996 | flags = LOOKUP_IMPLICIT(((1 << 0)) | (1 << 2)); |
997 | |
998 | switch (TREE_CODE (value)((enum tree_code) (value)->base.code)) |
999 | { |
1000 | case VAR_DECL: |
1001 | finish_static_data_member_decl (value, init, init_const_expr_p, |
1002 | asmspec_tree, flags); |
1003 | return value; |
1004 | |
1005 | case FIELD_DECL: |
1006 | if (asmspec) |
1007 | error ("%<asm%> specifiers are not permitted on non-static data members"); |
1008 | if (DECL_INITIAL (value)((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1008, __FUNCTION__))->decl_common.initial) == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1009 | init = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1010 | cp_finish_decl (value, init, /*init_const_expr_p=*/false, |
1011 | NULL_TREE(tree) __null, flags); |
1012 | DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1012, __FUNCTION__))->decl_common.lang_flag_3)) = 1; |
1013 | return value; |
1014 | |
1015 | case FUNCTION_DECL: |
1016 | if (asmspec) |
1017 | set_user_assembler_name (value, asmspec); |
1018 | |
1019 | cp_finish_decl (value, |
1020 | /*init=*/NULL_TREE(tree) __null, |
1021 | /*init_const_expr_p=*/false, |
1022 | asmspec_tree, flags); |
1023 | |
1024 | /* Pass friends back this way. */ |
1025 | if (DECL_UNIQUE_FRIEND_P (value)(((contains_struct_check (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1025, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1025, __FUNCTION__))->decl_common.lang_specific) ->u. base.friend_or_tls)) |
1026 | return void_type_nodeglobal_trees[TI_VOID_TYPE]; |
1027 | |
1028 | DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1028, __FUNCTION__))->decl_common.lang_flag_3)) = 1; |
1029 | return value; |
1030 | |
1031 | default: |
1032 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1032, __FUNCTION__)); |
1033 | } |
1034 | return NULL_TREE(tree) __null; |
1035 | } |
1036 | |
1037 | /* Like `grokfield', but for bitfields. |
1038 | WIDTH is the width of the bitfield, a constant expression. |
1039 | The other parameters are as for grokfield. */ |
1040 | |
1041 | tree |
1042 | grokbitfield (const cp_declarator *declarator, |
1043 | cp_decl_specifier_seq *declspecs, tree width, tree init, |
1044 | tree attrlist) |
1045 | { |
1046 | tree value = grokdeclarator (declarator, declspecs, BITFIELD, |
1047 | init != NULL_TREE(tree) __null, &attrlist); |
1048 | |
1049 | if (value == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1050 | return NULL_TREE(tree) __null; /* friends went bad. */ |
1051 | |
1052 | tree type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1052, __FUNCTION__))->typed.type); |
1053 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1054 | return value; |
1055 | |
1056 | /* Pass friendly classes back. */ |
1057 | if (VOID_TYPE_P (value)(((enum tree_code) (value)->base.code) == VOID_TYPE)) |
1058 | return void_type_nodeglobal_trees[TI_VOID_TYPE]; |
1059 | |
1060 | if (!INTEGRAL_OR_ENUMERATION_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || ( ((enum tree_code) (type)->base.code) == BOOLEAN_TYPE || (( enum tree_code) (type)->base.code) == INTEGER_TYPE)) |
1061 | && (INDIRECT_TYPE_P (type)((((enum tree_code) (type)->base.code) == POINTER_TYPE) || (((enum tree_code) (type)->base.code) == REFERENCE_TYPE)) || !dependent_type_p (type))) |
1062 | { |
1063 | error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1063, __FUNCTION__))->decl_minimal.locus), |
1064 | "bit-field %qD with non-integral type %qT", |
1065 | value, type); |
1066 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1067 | } |
1068 | |
1069 | if (TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL) |
1070 | { |
1071 | error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1071, __FUNCTION__))->decl_minimal.locus), |
1072 | "cannot declare %qD to be a bit-field type", value); |
1073 | return NULL_TREE(tree) __null; |
1074 | } |
1075 | |
1076 | /* Usually, finish_struct_1 catches bitfields with invalid types. |
1077 | But, in the case of bitfields with function type, we confuse |
1078 | ourselves into thinking they are member functions, so we must |
1079 | check here. */ |
1080 | if (TREE_CODE (value)((enum tree_code) (value)->base.code) == FUNCTION_DECL) |
1081 | { |
1082 | error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1082, __FUNCTION__))->decl_minimal.locus), |
1083 | "cannot declare bit-field %qD with function type", value); |
1084 | return NULL_TREE(tree) __null; |
1085 | } |
1086 | |
1087 | if (TYPE_WARN_IF_NOT_ALIGN (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1087, __FUNCTION__))->type_common.warn_if_not_align ? (( unsigned)1) << ((type)->type_common.warn_if_not_align - 1) : 0)) |
1088 | { |
1089 | error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1089, __FUNCTION__))->decl_minimal.locus), "cannot declare bit-field " |
1090 | "%qD with %<warn_if_not_aligned%> type", value); |
1091 | return NULL_TREE(tree) __null; |
1092 | } |
1093 | |
1094 | if (DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1094, __FUNCTION__))->decl_common.lang_flag_3))) |
1095 | { |
1096 | error ("%qD is already defined in the class %qT", value, |
1097 | DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1097, __FUNCTION__))->decl_minimal.context)); |
1098 | return void_type_nodeglobal_trees[TI_VOID_TYPE]; |
1099 | } |
1100 | |
1101 | if (TREE_STATIC (value)((value)->base.static_flag)) |
1102 | { |
1103 | error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1103, __FUNCTION__))->decl_minimal.locus), |
1104 | "static member %qD cannot be a bit-field", value); |
1105 | return NULL_TREE(tree) __null; |
1106 | } |
1107 | |
1108 | int flags = LOOKUP_IMPLICIT(((1 << 0)) | (1 << 2)); |
1109 | if (init && DIRECT_LIST_INIT_P (init)((((enum tree_code) (init)->base.code) == CONSTRUCTOR && ((contains_struct_check ((init), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1109, __FUNCTION__))->typed.type) == cp_global_trees[CPTI_INIT_LIST_TYPE ]) && (((tree_not_check2 (((tree_check ((init), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1109, __FUNCTION__, (CONSTRUCTOR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1109, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) |
1110 | flags = LOOKUP_NORMAL((1 << 0)); |
1111 | cp_finish_decl (value, init, false, NULL_TREE(tree) __null, flags); |
1112 | |
1113 | if (width != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1114 | { |
1115 | /* The width must be an integer type. */ |
1116 | if (!type_dependent_expression_p (width) |
1117 | && !INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (width))((((enum tree_code) (((contains_struct_check ((width), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1117, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE && !((tree_check ((((contains_struct_check ((width), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1117, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1117, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag) ) || (((enum tree_code) (((contains_struct_check ((width), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1117, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((width), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1117, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ))) |
1118 | error ("width of bit-field %qD has non-integral type %qT", value, |
1119 | TREE_TYPE (width)((contains_struct_check ((width), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1119, __FUNCTION__))->typed.type)); |
1120 | else |
1121 | { |
1122 | /* Temporarily stash the width in DECL_BIT_FIELD_REPRESENTATIVE. |
1123 | check_bitfield_decl picks it from there later and sets DECL_SIZE |
1124 | accordingly. */ |
1125 | DECL_BIT_FIELD_REPRESENTATIVE (value)((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1125, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier ) = width; |
1126 | SET_DECL_C_BIT_FIELD (value)(((contains_struct_check (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1126, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1126, __FUNCTION__))->decl_common.lang_flag_4) = 1); |
1127 | } |
1128 | } |
1129 | |
1130 | DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1130, __FUNCTION__))->decl_common.lang_flag_3)) = 1; |
1131 | |
1132 | if (attrlist) |
1133 | cplus_decl_attributes (&value, attrlist, /*flags=*/0); |
1134 | |
1135 | return value; |
1136 | } |
1137 | |
1138 | |
1139 | /* Returns true iff ATTR is an attribute which needs to be applied at |
1140 | instantiation time rather than template definition time. */ |
1141 | |
1142 | static bool |
1143 | is_late_template_attribute (tree attr, tree decl) |
1144 | { |
1145 | tree name = get_attribute_name (attr); |
1146 | tree args = TREE_VALUE (attr)((tree_check ((attr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1146, __FUNCTION__, (TREE_LIST)))->list.value); |
1147 | const struct attribute_spec *spec = lookup_attribute_spec (name); |
1148 | tree arg; |
1149 | |
1150 | if (!spec) |
1151 | /* Unknown attribute. */ |
1152 | return false; |
1153 | |
1154 | /* Attribute weak handling wants to write out assembly right away. */ |
1155 | if (is_attribute_p ("weak", name)) |
1156 | return true; |
1157 | |
1158 | /* Attributes used and unused are applied directly to typedefs for the |
1159 | benefit of maybe_warn_unused_local_typedefs. */ |
1160 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL |
1161 | && (is_attribute_p ("unused", name) |
1162 | || is_attribute_p ("used", name))) |
1163 | return false; |
1164 | |
1165 | /* Attribute tls_model wants to modify the symtab. */ |
1166 | if (is_attribute_p ("tls_model", name)) |
1167 | return true; |
1168 | |
1169 | /* #pragma omp declare simd attribute needs to be always deferred. */ |
1170 | if (flag_openmpglobal_options.x_flag_openmp |
1171 | && is_attribute_p ("omp declare simd", name)) |
1172 | return true; |
1173 | |
1174 | if (args == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1175 | return false; |
1176 | |
1177 | /* An attribute pack is clearly dependent. */ |
1178 | if (args && PACK_EXPANSION_P (args)(((enum tree_code) (args)->base.code) == TYPE_PACK_EXPANSION || ((enum tree_code) (args)->base.code) == EXPR_PACK_EXPANSION )) |
1179 | return true; |
1180 | |
1181 | /* If any of the arguments are dependent expressions, we can't evaluate |
1182 | the attribute until instantiation time. */ |
1183 | for (arg = args; arg; arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1183, __FUNCTION__))->common.chain)) |
1184 | { |
1185 | tree t = TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1185, __FUNCTION__, (TREE_LIST)))->list.value); |
1186 | |
1187 | /* If the first attribute argument is an identifier, only consider |
1188 | second and following arguments. Attributes like mode, format, |
1189 | cleanup and several target specific attributes aren't late |
1190 | just because they have an IDENTIFIER_NODE as first argument. */ |
1191 | if (arg == args && attribute_takes_identifier_p (name) |
1192 | && identifier_p (t)) |
1193 | continue; |
1194 | |
1195 | if (value_dependent_expression_p (t)) |
1196 | return true; |
1197 | } |
1198 | |
1199 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL |
1200 | || TYPE_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_type) |
1201 | || spec->type_required) |
1202 | { |
1203 | tree type = TYPE_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_type) ? decl : TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1203, __FUNCTION__))->typed.type); |
1204 | |
1205 | /* We can't apply any attributes to a completely unknown type until |
1206 | instantiation time. */ |
1207 | enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code); |
1208 | if (code == TEMPLATE_TYPE_PARM |
1209 | || code == BOUND_TEMPLATE_TEMPLATE_PARM |
1210 | || code == TYPENAME_TYPE) |
1211 | return true; |
1212 | /* Also defer most attributes on dependent types. This is not |
1213 | necessary in all cases, but is the better default. */ |
1214 | else if (dependent_type_p (type) |
1215 | /* But some attributes specifically apply to templates. */ |
1216 | && !is_attribute_p ("abi_tag", name) |
1217 | && !is_attribute_p ("deprecated", name) |
1218 | && !is_attribute_p ("visibility", name)) |
1219 | return true; |
1220 | else |
1221 | return false; |
1222 | } |
1223 | else |
1224 | return false; |
1225 | } |
1226 | |
1227 | /* ATTR_P is a list of attributes. Remove any attributes which need to be |
1228 | applied at instantiation time and return them. If IS_DEPENDENT is true, |
1229 | the declaration itself is dependent, so all attributes should be applied |
1230 | at instantiation time. */ |
1231 | |
1232 | tree |
1233 | splice_template_attributes (tree *attr_p, tree decl) |
1234 | { |
1235 | tree *p = attr_p; |
1236 | tree late_attrs = NULL_TREE(tree) __null; |
1237 | tree *q = &late_attrs; |
1238 | |
1239 | if (!p) |
1240 | return NULL_TREE(tree) __null; |
1241 | |
1242 | for (; *p; ) |
1243 | { |
1244 | if (is_late_template_attribute (*p, decl)) |
1245 | { |
1246 | ATTR_IS_DEPENDENT (*p)((tree_not_check2 (((tree_check ((*p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1246, __FUNCTION__, (TREE_LIST)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1246, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = 1; |
1247 | *q = *p; |
1248 | *p = TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1248, __FUNCTION__))->common.chain); |
1249 | q = &TREE_CHAIN (*q)((contains_struct_check ((*q), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1249, __FUNCTION__))->common.chain); |
1250 | *q = NULL_TREE(tree) __null; |
1251 | } |
1252 | else |
1253 | p = &TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1253, __FUNCTION__))->common.chain); |
1254 | } |
1255 | |
1256 | return late_attrs; |
1257 | } |
1258 | |
1259 | /* Remove any late attributes from the list in ATTR_P and attach them to |
1260 | DECL_P. */ |
1261 | |
1262 | static void |
1263 | save_template_attributes (tree *attr_p, tree *decl_p, int flags) |
1264 | { |
1265 | tree *q; |
1266 | |
1267 | if (attr_p && *attr_p == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1268 | return; |
1269 | |
1270 | tree late_attrs = splice_template_attributes (attr_p, *decl_p); |
1271 | if (!late_attrs) |
1272 | return; |
1273 | |
1274 | if (DECL_P (*decl_p)(tree_code_type[(int) (((enum tree_code) (*decl_p)->base.code ))] == tcc_declaration)) |
1275 | q = &DECL_ATTRIBUTES (*decl_p)((contains_struct_check ((*decl_p), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1275, __FUNCTION__))->decl_common.attributes); |
1276 | else |
1277 | q = &TYPE_ATTRIBUTES (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1277, __FUNCTION__))->type_common.attributes); |
1278 | |
1279 | tree old_attrs = *q; |
1280 | |
1281 | /* Merge the late attributes at the beginning with the attribute |
1282 | list. */ |
1283 | late_attrs = merge_attributes (late_attrs, *q); |
1284 | if (*q != late_attrs |
1285 | && !DECL_P (*decl_p)(tree_code_type[(int) (((enum tree_code) (*decl_p)->base.code ))] == tcc_declaration) |
1286 | && !(flags & ATTR_FLAG_TYPE_IN_PLACE)) |
1287 | { |
1288 | if (!dependent_type_p (*decl_p)) |
1289 | *decl_p = cp_build_type_attribute_variant (*decl_p, late_attrs); |
1290 | else |
1291 | { |
1292 | *decl_p = build_variant_type_copy (*decl_p); |
1293 | TYPE_ATTRIBUTES (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1293, __FUNCTION__))->type_common.attributes) = late_attrs; |
1294 | } |
1295 | } |
1296 | else |
1297 | *q = late_attrs; |
1298 | |
1299 | if (!DECL_P (*decl_p)(tree_code_type[(int) (((enum tree_code) (*decl_p)->base.code ))] == tcc_declaration) && *decl_p == TYPE_MAIN_VARIANT (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1299, __FUNCTION__))->type_common.main_variant)) |
1300 | { |
1301 | /* We've added new attributes directly to the main variant, so |
1302 | now we need to update all of the other variants to include |
1303 | these new attributes. */ |
1304 | tree variant; |
1305 | for (variant = TYPE_NEXT_VARIANT (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1305, __FUNCTION__))->type_common.next_variant); variant; |
1306 | variant = TYPE_NEXT_VARIANT (variant)((tree_class_check ((variant), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1306, __FUNCTION__))->type_common.next_variant)) |
1307 | { |
1308 | gcc_assert (TYPE_ATTRIBUTES (variant) == old_attrs)((void)(!(((tree_class_check ((variant), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1308, __FUNCTION__))->type_common.attributes) == old_attrs ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1308, __FUNCTION__), 0 : 0)); |
1309 | TYPE_ATTRIBUTES (variant)((tree_class_check ((variant), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1309, __FUNCTION__))->type_common.attributes) = TYPE_ATTRIBUTES (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1309, __FUNCTION__))->type_common.attributes); |
1310 | } |
1311 | } |
1312 | } |
1313 | |
1314 | /* True if ATTRS contains any dependent attributes that affect type |
1315 | identity. */ |
1316 | |
1317 | bool |
1318 | any_dependent_type_attributes_p (tree attrs) |
1319 | { |
1320 | for (tree a = attrs; a; a = TREE_CHAIN (a)((contains_struct_check ((a), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1320, __FUNCTION__))->common.chain)) |
1321 | if (ATTR_IS_DEPENDENT (a)((tree_not_check2 (((tree_check ((a), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1321, __FUNCTION__, (TREE_LIST)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1321, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) |
1322 | { |
1323 | const attribute_spec *as = lookup_attribute_spec (TREE_PURPOSE (a)((tree_check ((a), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1323, __FUNCTION__, (TREE_LIST)))->list.purpose)); |
1324 | if (as && as->affects_type_identity) |
1325 | return true; |
1326 | } |
1327 | return false; |
1328 | } |
1329 | |
1330 | /* Return true iff ATTRS are acceptable attributes to be applied in-place |
1331 | to a typedef which gives a previously unnamed class or enum a name for |
1332 | linkage purposes. */ |
1333 | |
1334 | bool |
1335 | attributes_naming_typedef_ok (tree attrs) |
1336 | { |
1337 | for (; attrs; attrs = TREE_CHAIN (attrs)((contains_struct_check ((attrs), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1337, __FUNCTION__))->common.chain)) |
1338 | { |
1339 | tree name = get_attribute_name (attrs); |
1340 | if (is_attribute_p ("vector_size", name)) |
1341 | return false; |
1342 | } |
1343 | return true; |
1344 | } |
1345 | |
1346 | /* Like reconstruct_complex_type, but handle also template trees. */ |
1347 | |
1348 | tree |
1349 | cp_reconstruct_complex_type (tree type, tree bottom) |
1350 | { |
1351 | tree inner, outer; |
1352 | |
1353 | if (TYPE_PTR_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE)) |
1354 | { |
1355 | inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1355, __FUNCTION__))->typed.type), bottom); |
1356 | outer = build_pointer_type_for_mode (inner, TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1356, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (type) : (type)->type_common.mode), |
1357 | TYPE_REF_CAN_ALIAS_ALL (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1357, __FUNCTION__, (POINTER_TYPE), (REFERENCE_TYPE)))-> base.static_flag)); |
1358 | } |
1359 | else if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE)) |
1360 | { |
1361 | inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1361, __FUNCTION__))->typed.type), bottom); |
1362 | outer = build_reference_type_for_mode (inner, TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1362, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (type) : (type)->type_common.mode), |
1363 | TYPE_REF_CAN_ALIAS_ALL (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1363, __FUNCTION__, (POINTER_TYPE), (REFERENCE_TYPE)))-> base.static_flag)); |
1364 | } |
1365 | else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE) |
1366 | { |
1367 | inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1367, __FUNCTION__))->typed.type), bottom); |
1368 | outer = build_cplus_array_type (inner, TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1368, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )); |
1369 | /* Don't call cp_build_qualified_type on ARRAY_TYPEs, the |
1370 | element type qualification will be handled by the recursive |
1371 | cp_reconstruct_complex_type call and cp_build_qualified_type |
1372 | for ARRAY_TYPEs changes the element type. */ |
1373 | return outer; |
1374 | } |
1375 | else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == FUNCTION_TYPE) |
1376 | { |
1377 | inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1377, __FUNCTION__))->typed.type), bottom); |
1378 | outer = build_function_type (inner, TYPE_ARG_TYPES (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1378, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); |
1379 | outer = apply_memfn_quals (outer, type_memfn_quals (type)); |
1380 | } |
1381 | else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == METHOD_TYPE) |
1382 | { |
1383 | inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1383, __FUNCTION__))->typed.type), bottom); |
1384 | /* The build_method_type_directly() routine prepends 'this' to argument list, |
1385 | so we must compensate by getting rid of it. */ |
1386 | outer |
1387 | = build_method_type_directly |
1388 | (class_of_this_parm (type), inner, |
1389 | TREE_CHAIN (TYPE_ARG_TYPES (type))((contains_struct_check ((((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1389, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1389, __FUNCTION__))->common.chain)); |
1390 | } |
1391 | else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == OFFSET_TYPE) |
1392 | { |
1393 | inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1393, __FUNCTION__))->typed.type), bottom); |
1394 | outer = build_offset_type (TYPE_OFFSET_BASETYPE (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1394, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ), inner); |
1395 | } |
1396 | else |
1397 | return bottom; |
1398 | |
1399 | if (TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1399, __FUNCTION__))->type_common.attributes)) |
1400 | outer = cp_build_type_attribute_variant (outer, TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1400, __FUNCTION__))->type_common.attributes)); |
1401 | outer = cp_build_qualified_type (outer, cp_type_quals (type))cp_build_qualified_type_real ((outer), (cp_type_quals (type)) , tf_warning_or_error); |
1402 | outer = cxx_copy_lang_qualifiers (outer, type); |
1403 | |
1404 | return outer; |
1405 | } |
1406 | |
1407 | /* Replaces any constexpr expression that may be into the attributes |
1408 | arguments with their reduced value. */ |
1409 | |
1410 | void |
1411 | cp_check_const_attributes (tree attributes) |
1412 | { |
1413 | if (attributes == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1414 | return; |
1415 | |
1416 | tree attr; |
1417 | for (attr = attributes; attr; attr = TREE_CHAIN (attr)((contains_struct_check ((attr), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1417, __FUNCTION__))->common.chain)) |
1418 | { |
1419 | tree arg; |
1420 | for (arg = TREE_VALUE (attr)((tree_check ((attr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1420, __FUNCTION__, (TREE_LIST)))->list.value); arg && TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TREE_LIST; |
1421 | arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1421, __FUNCTION__))->common.chain)) |
1422 | { |
1423 | tree expr = TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1423, __FUNCTION__, (TREE_LIST)))->list.value); |
1424 | if (EXPR_P (expr)((tree_code_type[(int) (((enum tree_code) (expr)->base.code ))]) >= tcc_reference && (tree_code_type[(int) ((( enum tree_code) (expr)->base.code))]) <= tcc_expression )) |
1425 | TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1425, __FUNCTION__, (TREE_LIST)))->list.value) = fold_non_dependent_expr (expr); |
1426 | } |
1427 | } |
1428 | } |
1429 | |
1430 | /* Return true if TYPE is an OpenMP mappable type. |
1431 | If NOTES is non-zero, emit a note message for each problem. */ |
1432 | static bool |
1433 | cp_omp_mappable_type_1 (tree type, bool notes) |
1434 | { |
1435 | bool result = true; |
1436 | |
1437 | /* Mappable type has to be complete. */ |
1438 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1438, __FUNCTION__))->type_common.size) != (tree) __null )) |
1439 | { |
1440 | if (notes && type != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1441 | { |
1442 | tree decl = TYPE_MAIN_DECL (type)((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1442, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1442, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1442, __FUNCTION__))->common.chain))); |
1443 | inform ((decl ? DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1443, __FUNCTION__))->decl_minimal.locus) : input_location), |
1444 | "incomplete type %qT is not mappable", type); |
1445 | } |
1446 | result = false; |
1447 | } |
1448 | /* Arrays have mappable type if the elements have mappable type. */ |
1449 | while (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE) |
1450 | type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1450, __FUNCTION__))->typed.type); |
1451 | /* A mappable type cannot contain virtual members. */ |
1452 | if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1452, __FUNCTION__))->type_common.lang_flag_5)) && CLASSTYPE_VTABLES (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1452, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables)) |
1453 | { |
1454 | if (notes) |
1455 | inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type))((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1455, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1455, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1455, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1455, __FUNCTION__))->decl_minimal.locus), |
1456 | "type %qT with virtual members is not mappable", type); |
1457 | result = false; |
1458 | } |
1459 | /* All data members must be non-static. */ |
1460 | if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1460, __FUNCTION__))->type_common.lang_flag_5))) |
1461 | { |
1462 | tree field; |
1463 | for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1463, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1463, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1463, __FUNCTION__))->common.chain))) |
1464 | if (VAR_P (field)(((enum tree_code) (field)->base.code) == VAR_DECL)) |
1465 | { |
1466 | if (notes) |
1467 | inform (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1467, __FUNCTION__))->decl_minimal.locus), |
1468 | "static field %qD is not mappable", field); |
1469 | result = false; |
1470 | } |
1471 | /* All fields must have mappable types. */ |
1472 | else if (TREE_CODE (field)((enum tree_code) (field)->base.code) == FIELD_DECL |
1473 | && !cp_omp_mappable_type_1 (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1473, __FUNCTION__))->typed.type), notes)) |
1474 | result = false; |
1475 | } |
1476 | return result; |
1477 | } |
1478 | |
1479 | /* Return true if TYPE is an OpenMP mappable type. */ |
1480 | bool |
1481 | cp_omp_mappable_type (tree type) |
1482 | { |
1483 | return cp_omp_mappable_type_1 (type, false); |
1484 | } |
1485 | |
1486 | /* Return true if TYPE is an OpenMP mappable type. |
1487 | Emit an error messages if not. */ |
1488 | bool |
1489 | cp_omp_emit_unmappable_type_notes (tree type) |
1490 | { |
1491 | return cp_omp_mappable_type_1 (type, true); |
1492 | } |
1493 | |
1494 | /* Return the last pushed declaration for the symbol DECL or NULL |
1495 | when no such declaration exists. */ |
1496 | |
1497 | static tree |
1498 | find_last_decl (tree decl) |
1499 | { |
1500 | tree last_decl = NULL_TREE(tree) __null; |
1501 | |
1502 | if (tree name = DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_declaration) ? DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1502, __FUNCTION__))->decl_minimal.name) : NULL_TREE(tree) __null) |
1503 | { |
1504 | /* Look up the declaration in its scope. */ |
1505 | tree pushed_scope = NULL_TREE(tree) __null; |
1506 | if (tree ctype = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1506, __FUNCTION__))->decl_minimal.context)) |
1507 | pushed_scope = push_scope (ctype); |
1508 | |
1509 | last_decl = lookup_name (name); |
1510 | |
1511 | if (pushed_scope) |
1512 | pop_scope (pushed_scope); |
1513 | |
1514 | /* The declaration may be a member conversion operator |
1515 | or a bunch of overfloads (handle the latter below). */ |
1516 | if (last_decl && BASELINK_P (last_decl)(((enum tree_code) (last_decl)->base.code) == BASELINK)) |
1517 | last_decl = BASELINK_FUNCTIONS (last_decl)(((struct tree_baselink*) (tree_check ((last_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1517, __FUNCTION__, (BASELINK))))->functions); |
1518 | } |
1519 | |
1520 | if (!last_decl) |
1521 | return NULL_TREE(tree) __null; |
1522 | |
1523 | if (DECL_P (last_decl)(tree_code_type[(int) (((enum tree_code) (last_decl)->base .code))] == tcc_declaration) || TREE_CODE (last_decl)((enum tree_code) (last_decl)->base.code) == OVERLOAD) |
1524 | { |
1525 | /* A set of overloads of the same function. */ |
1526 | for (lkp_iterator iter (last_decl); iter; ++iter) |
1527 | { |
1528 | if (TREE_CODE (*iter)((enum tree_code) (*iter)->base.code) == OVERLOAD) |
1529 | continue; |
1530 | |
1531 | if (decls_match (decl, *iter, /*record_decls=*/false)) |
1532 | return *iter; |
1533 | } |
1534 | return NULL_TREE(tree) __null; |
1535 | } |
1536 | |
1537 | return NULL_TREE(tree) __null; |
1538 | } |
1539 | |
1540 | /* Like decl_attributes, but handle C++ complexity. */ |
1541 | |
1542 | void |
1543 | cplus_decl_attributes (tree *decl, tree attributes, int flags) |
1544 | { |
1545 | if (*decl == NULL_TREE(tree) __null || *decl == void_type_nodeglobal_trees[TI_VOID_TYPE] |
1546 | || *decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1547 | return; |
1548 | |
1549 | /* Add implicit "omp declare target" attribute if requested. */ |
1550 | if (scope_chain->omp_declare_target_attribute |
1551 | && ((VAR_P (*decl)(((enum tree_code) (*decl)->base.code) == VAR_DECL) |
1552 | && (TREE_STATIC (*decl)((*decl)->base.static_flag) || DECL_EXTERNAL (*decl)((contains_struct_check ((*decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1552, __FUNCTION__))->decl_common.decl_flag_1))) |
1553 | || TREE_CODE (*decl)((enum tree_code) (*decl)->base.code) == FUNCTION_DECL)) |
1554 | { |
1555 | if (VAR_P (*decl)(((enum tree_code) (*decl)->base.code) == VAR_DECL) |
1556 | && DECL_CLASS_SCOPE_P (*decl)(((contains_struct_check ((*decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1556, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((*decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1556, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) |
1557 | error ("%q+D static data member inside of declare target directive", |
1558 | *decl); |
1559 | else if (VAR_P (*decl)(((enum tree_code) (*decl)->base.code) == VAR_DECL) |
1560 | && (processing_template_declscope_chain->x_processing_template_decl |
1561 | || !cp_omp_mappable_type (TREE_TYPE (*decl)((contains_struct_check ((*decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1561, __FUNCTION__))->typed.type)))) |
1562 | attributes = tree_cons (get_identifier ("omp declare target implicit")(__builtin_constant_p ("omp declare target implicit") ? get_identifier_with_length (("omp declare target implicit"), strlen ("omp declare target implicit" )) : get_identifier ("omp declare target implicit")), |
1563 | NULL_TREE(tree) __null, attributes); |
1564 | else |
1565 | { |
1566 | attributes = tree_cons (get_identifier ("omp declare target")(__builtin_constant_p ("omp declare target") ? get_identifier_with_length (("omp declare target"), strlen ("omp declare target")) : get_identifier ("omp declare target")), |
1567 | NULL_TREE(tree) __null, attributes); |
1568 | attributes = tree_cons (get_identifier ("omp declare target block")(__builtin_constant_p ("omp declare target block") ? get_identifier_with_length (("omp declare target block"), strlen ("omp declare target block" )) : get_identifier ("omp declare target block")), |
1569 | NULL_TREE(tree) __null, attributes); |
1570 | } |
1571 | } |
1572 | |
1573 | if (processing_template_declscope_chain->x_processing_template_decl) |
1574 | { |
1575 | if (check_for_bare_parameter_packs (attributes)) |
1576 | return; |
1577 | |
1578 | save_template_attributes (&attributes, decl, flags); |
1579 | } |
1580 | |
1581 | cp_check_const_attributes (attributes); |
1582 | |
1583 | if (TREE_CODE (*decl)((enum tree_code) (*decl)->base.code) == TEMPLATE_DECL) |
1584 | decl = &DECL_TEMPLATE_RESULT (*decl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((*decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1584, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
1585 | |
1586 | if (TREE_TYPE (*decl)((contains_struct_check ((*decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1586, __FUNCTION__))->typed.type) && TYPE_PTRMEMFUNC_P (TREE_TYPE (*decl))(((enum tree_code) (((contains_struct_check ((*decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1586, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((((contains_struct_check ((*decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1586, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1586, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1586, __FUNCTION__))->type_common.lang_flag_2)))) |
1587 | { |
1588 | attributes |
1589 | = decl_attributes (decl, attributes, flags | ATTR_FLAG_FUNCTION_NEXT); |
1590 | decl_attributes (&TYPE_PTRMEMFUNC_FN_TYPE_RAW (TREE_TYPE (*decl))(((contains_struct_check ((((tree_check3 ((((contains_struct_check ((*decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1590, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1590, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1590, __FUNCTION__))->typed.type)), |
1591 | attributes, flags); |
1592 | } |
1593 | else |
1594 | { |
1595 | tree last_decl = find_last_decl (*decl); |
1596 | decl_attributes (decl, attributes, flags, last_decl); |
1597 | } |
1598 | |
1599 | if (TREE_CODE (*decl)((enum tree_code) (*decl)->base.code) == TYPE_DECL) |
1600 | SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (*decl), TREE_TYPE (*decl))(((contains_struct_check ((((contains_struct_check ((*decl), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1600, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1600, __FUNCTION__))->typed.type) = (((contains_struct_check ((*decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1600, __FUNCTION__))->typed.type))); |
1601 | |
1602 | /* Propagate deprecation out to the template. */ |
1603 | if (TREE_DEPRECATED (*decl)((*decl)->base.deprecated_flag)) |
1604 | if (tree ti = get_template_info (*decl)) |
1605 | { |
1606 | tree tmpl = TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1606, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
1607 | tree pattern = (TYPE_P (*decl)(tree_code_type[(int) (((enum tree_code) (*decl)->base.code ))] == tcc_type) ? TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1607, __FUNCTION__))->typed.type) |
1608 | : DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1608, __FUNCTION__, (TEMPLATE_DECL))))))))->result); |
1609 | if (*decl == pattern) |
1610 | TREE_DEPRECATED (tmpl)((tmpl)->base.deprecated_flag) = true; |
1611 | } |
1612 | } |
1613 | |
1614 | /* Walks through the namespace- or function-scope anonymous union |
1615 | OBJECT, with the indicated TYPE, building appropriate VAR_DECLs. |
1616 | Returns one of the fields for use in the mangled name. */ |
1617 | |
1618 | static tree |
1619 | build_anon_union_vars (tree type, tree object) |
1620 | { |
1621 | tree main_decl = NULL_TREE(tree) __null; |
1622 | tree field; |
1623 | |
1624 | /* Rather than write the code to handle the non-union case, |
1625 | just give an error. */ |
1626 | if (TREE_CODE (type)((enum tree_code) (type)->base.code) != UNION_TYPE) |
1627 | { |
1628 | error_at (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type))((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1628, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1628, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1628, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1628, __FUNCTION__))->decl_minimal.locus), |
1629 | "anonymous struct not inside named type"); |
1630 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1631 | } |
1632 | |
1633 | for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1633, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
1634 | field != NULL_TREE(tree) __null; |
1635 | field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1635, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1635, __FUNCTION__))->common.chain))) |
1636 | { |
1637 | tree decl; |
1638 | tree ref; |
1639 | |
1640 | if (DECL_ARTIFICIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1640, __FUNCTION__))->decl_common.artificial_flag)) |
1641 | continue; |
1642 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL) |
1643 | { |
1644 | permerror (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1644, __FUNCTION__))->decl_minimal.locus), |
1645 | "%q#D invalid; an anonymous union can only " |
1646 | "have non-static data members", field); |
1647 | continue; |
1648 | } |
1649 | |
1650 | if (TREE_PRIVATE (field)((field)->base.private_flag)) |
1651 | permerror (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1651, __FUNCTION__))->decl_minimal.locus), |
1652 | "private member %q#D in anonymous union", field); |
1653 | else if (TREE_PROTECTED (field)((field)->base.protected_flag)) |
1654 | permerror (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1654, __FUNCTION__))->decl_minimal.locus), |
1655 | "protected member %q#D in anonymous union", field); |
1656 | |
1657 | if (processing_template_declscope_chain->x_processing_template_decl) |
1658 | ref = build_min_nt_loc (UNKNOWN_LOCATION((location_t) 0), COMPONENT_REF, object, |
1659 | DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1659, __FUNCTION__))->decl_minimal.name), NULL_TREE(tree) __null); |
1660 | else |
1661 | ref = build_class_member_access_expr (object, field, NULL_TREE(tree) __null, |
1662 | false, tf_warning_or_error); |
1663 | |
1664 | if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1664, __FUNCTION__))->decl_minimal.name)) |
1665 | { |
1666 | tree base; |
1667 | |
1668 | decl = build_decl (input_location, |
1669 | VAR_DECL, DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1669, __FUNCTION__))->decl_minimal.name), TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1669, __FUNCTION__))->typed.type)); |
1670 | DECL_ANON_UNION_VAR_P (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1670, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1670, __FUNCTION__))->decl_common.lang_flag_4)) = 1; |
1671 | DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1671, __FUNCTION__))->decl_common.artificial_flag) = 1; |
1672 | |
1673 | base = get_base_address (object); |
1674 | TREE_PUBLIC (decl)((decl)->base.public_flag) = TREE_PUBLIC (base)((base)->base.public_flag); |
1675 | TREE_STATIC (decl)((decl)->base.static_flag) = TREE_STATIC (base)((base)->base.static_flag); |
1676 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1676, __FUNCTION__))->decl_common.decl_flag_1) = DECL_EXTERNAL (base)((contains_struct_check ((base), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1676, __FUNCTION__))->decl_common.decl_flag_1); |
1677 | |
1678 | SET_DECL_VALUE_EXPR (decl, ref)(decl_value_expr_insert ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1678, __FUNCTION__)), ref)); |
1679 | DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1679, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)) ) ->decl_common.decl_flag_2) = 1; |
1680 | |
1681 | decl = pushdecl (decl); |
1682 | } |
1683 | else if (ANON_AGGR_TYPE_P (TREE_TYPE (field))((((((enum tree_code) (((contains_struct_check ((field), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1683, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((field), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1683, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((field ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1683, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1683, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((((contains_struct_check ((field), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1683, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1683, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr)) |
1684 | decl = build_anon_union_vars (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1684, __FUNCTION__))->typed.type), ref); |
1685 | else |
1686 | decl = 0; |
1687 | |
1688 | if (main_decl == NULL_TREE(tree) __null) |
1689 | main_decl = decl; |
1690 | } |
1691 | |
1692 | return main_decl; |
1693 | } |
1694 | |
1695 | /* Finish off the processing of a UNION_TYPE structure. If the union is an |
1696 | anonymous union, then all members must be laid out together. PUBLIC_P |
1697 | is nonzero if this union is not declared static. */ |
1698 | |
1699 | void |
1700 | finish_anon_union (tree anon_union_decl) |
1701 | { |
1702 | tree type; |
1703 | tree main_decl; |
1704 | bool public_p; |
1705 | |
1706 | if (anon_union_decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1707 | return; |
1708 | |
1709 | type = TREE_TYPE (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1709, __FUNCTION__))->typed.type); |
1710 | public_p = TREE_PUBLIC (anon_union_decl)((anon_union_decl)->base.public_flag); |
1711 | |
1712 | /* The VAR_DECL's context is the same as the TYPE's context. */ |
1713 | DECL_CONTEXT (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1713, __FUNCTION__))->decl_minimal.context) = DECL_CONTEXT (TYPE_NAME (type))((contains_struct_check ((((tree_class_check ((type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1713, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1713, __FUNCTION__))->decl_minimal.context); |
1714 | |
1715 | if (TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1715, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == NULL_TREE(tree) __null) |
1716 | return; |
1717 | |
1718 | if (public_p) |
1719 | { |
1720 | error ("namespace-scope anonymous aggregates must be static"); |
1721 | return; |
1722 | } |
1723 | |
1724 | main_decl = build_anon_union_vars (type, anon_union_decl); |
1725 | if (main_decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1726 | return; |
1727 | if (main_decl == NULL_TREE(tree) __null) |
1728 | { |
1729 | pedwarn (input_location, 0, "anonymous union with no members"); |
1730 | return; |
1731 | } |
1732 | |
1733 | if (!processing_template_declscope_chain->x_processing_template_decl) |
1734 | { |
1735 | /* Use main_decl to set the mangled name. */ |
1736 | DECL_NAME (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1736, __FUNCTION__))->decl_minimal.name) = DECL_NAME (main_decl)((contains_struct_check ((main_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1736, __FUNCTION__))->decl_minimal.name); |
1737 | maybe_commonize_var (anon_union_decl); |
1738 | if (TREE_STATIC (anon_union_decl)((anon_union_decl)->base.static_flag) || DECL_EXTERNAL (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1738, __FUNCTION__))->decl_common.decl_flag_1)) |
1739 | { |
1740 | if (DECL_DISCRIMINATOR_P (anon_union_decl)(((((enum tree_code) (anon_union_decl)->base.code) == VAR_DECL && ((anon_union_decl)->base.static_flag)) || (((enum tree_code) (anon_union_decl)->base.code) == TYPE_DECL && ((contains_struct_check ((anon_union_decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1740, __FUNCTION__))->decl_common.lang_flag_2))) && (((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1740, __FUNCTION__))->decl_minimal.context) && ( (enum tree_code) (((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1740, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL))) |
1741 | determine_local_discriminator (anon_union_decl); |
1742 | mangle_decl (anon_union_decl); |
1743 | } |
1744 | DECL_NAME (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1744, __FUNCTION__))->decl_minimal.name) = NULL_TREE(tree) __null; |
1745 | } |
1746 | |
1747 | pushdecl (anon_union_decl); |
1748 | cp_finish_decl (anon_union_decl, NULL_TREE(tree) __null, false, NULL_TREE(tree) __null, 0); |
1749 | } |
1750 | |
1751 | /* Auxiliary functions to make type signatures for |
1752 | `operator new' and `operator delete' correspond to |
1753 | what compiler will be expecting. */ |
1754 | |
1755 | tree |
1756 | coerce_new_type (tree type, location_t loc) |
1757 | { |
1758 | int e = 0; |
1759 | tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1759, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
1760 | |
1761 | gcc_assert (TREE_CODE (type) == FUNCTION_TYPE)((void)(!(((enum tree_code) (type)->base.code) == FUNCTION_TYPE ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1761, __FUNCTION__), 0 : 0)); |
1762 | |
1763 | if (!same_type_p (TREE_TYPE (type), ptr_type_node)comptypes ((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1763, __FUNCTION__))->typed.type)), (global_trees[TI_PTR_TYPE ]), 0)) |
1764 | { |
1765 | e = 1; |
1766 | error_at (loc, "%<operator new%> must return type %qT", |
1767 | ptr_type_nodeglobal_trees[TI_PTR_TYPE]); |
1768 | } |
1769 | |
1770 | if (args && args != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) |
1771 | { |
1772 | if (TREE_PURPOSE (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1772, __FUNCTION__, (TREE_LIST)))->list.purpose)) |
1773 | { |
1774 | /* [basic.stc.dynamic.allocation] |
1775 | |
1776 | The first parameter shall not have an associated default |
1777 | argument. */ |
1778 | error_at (loc, "the first parameter of %<operator new%> cannot " |
1779 | "have a default argument"); |
1780 | /* Throw away the default argument. */ |
1781 | TREE_PURPOSE (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1781, __FUNCTION__, (TREE_LIST)))->list.purpose) = NULL_TREE(tree) __null; |
1782 | } |
1783 | |
1784 | if (!same_type_p (TREE_VALUE (args), size_type_node)comptypes ((((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1784, __FUNCTION__, (TREE_LIST)))->list.value)), (global_trees [TI_SIZE_TYPE]), 0)) |
1785 | { |
1786 | e = 2; |
1787 | args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1787, __FUNCTION__))->common.chain); |
1788 | } |
1789 | } |
1790 | else |
1791 | e = 2; |
1792 | |
1793 | if (e == 2) |
1794 | permerror (loc, "%<operator new%> takes type %<size_t%> (%qT) " |
1795 | "as first parameter", size_type_nodeglobal_trees[TI_SIZE_TYPE]); |
1796 | |
1797 | switch (e) |
1798 | { |
1799 | case 2: |
1800 | args = tree_cons (NULL_TREE(tree) __null, size_type_nodeglobal_trees[TI_SIZE_TYPE], args); |
1801 | /* Fall through. */ |
1802 | case 1: |
1803 | type = (cxx_copy_lang_qualifiers |
1804 | (build_function_type (ptr_type_nodeglobal_trees[TI_PTR_TYPE], args), |
1805 | type)); |
1806 | /* Fall through. */ |
1807 | default:; |
1808 | } |
1809 | return type; |
1810 | } |
1811 | |
1812 | void |
1813 | coerce_delete_type (tree decl, location_t loc) |
1814 | { |
1815 | int e = 0; |
1816 | tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1816, __FUNCTION__))->typed.type); |
1817 | tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1817, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
1818 | |
1819 | gcc_assert (TREE_CODE (type) == FUNCTION_TYPE)((void)(!(((enum tree_code) (type)->base.code) == FUNCTION_TYPE ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1819, __FUNCTION__), 0 : 0)); |
1820 | |
1821 | if (!same_type_p (TREE_TYPE (type), void_type_node)comptypes ((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1821, __FUNCTION__))->typed.type)), (global_trees[TI_VOID_TYPE ]), 0)) |
1822 | { |
1823 | e = 1; |
1824 | error_at (loc, "%<operator delete%> must return type %qT", |
1825 | void_type_nodeglobal_trees[TI_VOID_TYPE]); |
1826 | } |
1827 | |
1828 | tree ptrtype = ptr_type_nodeglobal_trees[TI_PTR_TYPE]; |
1829 | if (destroying_delete_p (decl)) |
1830 | { |
1831 | if (DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1831, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1831, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) |
1832 | /* If the function is a destroying operator delete declared in class |
1833 | type C, the type of its first parameter shall be C*. */ |
1834 | ptrtype = build_pointer_type (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1834, __FUNCTION__))->decl_minimal.context)); |
1835 | else |
1836 | /* A destroying operator delete shall be a class member function named |
1837 | operator delete. */ |
1838 | error_at (loc, |
1839 | "destroying %<operator delete%> must be a member function"); |
1840 | const ovl_op_info_t *op = IDENTIFIER_OVL_OP_INFO (DECL_NAME (decl))(&ovl_op_info[((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1840, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1840, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1840, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)][((tree_check ((((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1840, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1840, __FUNCTION__, (IDENTIFIER_NODE)))->base.u.bits.address_space )]); |
1841 | if (op->flags & OVL_OP_FLAG_VEC) |
1842 | error_at (loc, "%<operator delete[]%> cannot be a destroying delete"); |
1843 | if (!usual_deallocation_fn_p (decl)) |
1844 | error_at (loc, "destroying %<operator delete%> must be a usual " |
1845 | "deallocation function"); |
1846 | } |
1847 | |
1848 | if (!args || args == void_list_nodeglobal_trees[TI_VOID_LIST_NODE] |
1849 | || !same_type_p (TREE_VALUE (args), ptrtype)comptypes ((((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1849, __FUNCTION__, (TREE_LIST)))->list.value)), (ptrtype ), 0)) |
1850 | { |
1851 | e = 2; |
1852 | if (args && args != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) |
1853 | args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1853, __FUNCTION__))->common.chain); |
1854 | error_at (loc, "%<operator delete%> takes type %qT as first parameter", |
1855 | ptrtype); |
1856 | } |
1857 | switch (e) |
1858 | { |
1859 | case 2: |
1860 | args = tree_cons (NULL_TREE(tree) __null, ptrtype, args); |
1861 | /* Fall through. */ |
1862 | case 1: |
1863 | type = (cxx_copy_lang_qualifiers |
1864 | (build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE], args), |
1865 | type)); |
1866 | /* Fall through. */ |
1867 | default:; |
1868 | } |
1869 | |
1870 | TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1870, __FUNCTION__))->typed.type) = type; |
1871 | } |
1872 | |
1873 | /* DECL is a VAR_DECL for a vtable: walk through the entries in the vtable |
1874 | and mark them as needed. */ |
1875 | |
1876 | static void |
1877 | mark_vtable_entries (tree decl, vec<tree> &consteval_vtables) |
1878 | { |
1879 | tree fnaddr; |
1880 | unsigned HOST_WIDE_INTlong idx; |
1881 | |
1882 | /* It's OK for the vtable to refer to deprecated virtual functions. */ |
1883 | warning_sentinel w(warn_deprecated_declglobal_options.x_warn_deprecated_decl); |
1884 | |
1885 | bool consteval_seen = false; |
1886 | |
1887 | FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (DECL_INITIAL (decl)),for (idx = 0; (idx >= vec_safe_length (((tree_check ((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : ((fnaddr = (*(((tree_check ((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) [idx].value), true); (idx)++) |
1888 | idx, fnaddr)for (idx = 0; (idx >= vec_safe_length (((tree_check ((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : ((fnaddr = (*(((tree_check ((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1887, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) [idx].value), true); (idx)++) |
1889 | { |
1890 | tree fn; |
1891 | |
1892 | STRIP_NOPS (fnaddr)(fnaddr) = tree_strip_nop_conversions ((const_cast<union tree_node *> (((fnaddr))))); |
1893 | |
1894 | if (TREE_CODE (fnaddr)((enum tree_code) (fnaddr)->base.code) != ADDR_EXPR |
1895 | && TREE_CODE (fnaddr)((enum tree_code) (fnaddr)->base.code) != FDESC_EXPR) |
1896 | /* This entry is an offset: a virtual base class offset, a |
1897 | virtual call offset, an RTTI offset, etc. */ |
1898 | continue; |
1899 | |
1900 | fn = TREE_OPERAND (fnaddr, 0)(*((const_cast<tree*> (tree_operand_check ((fnaddr), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1900, __FUNCTION__))))); |
1901 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL && DECL_IMMEDIATE_FUNCTION_P (fn)(((contains_struct_check (((tree_check (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__))->decl_common.lang_specific) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1901, __FUNCTION__); <->u.fn; })->immediate_fn_p : false)) |
1902 | { |
1903 | if (!consteval_seen) |
1904 | { |
1905 | consteval_seen = true; |
1906 | consteval_vtables.safe_push (decl); |
1907 | } |
1908 | continue; |
1909 | } |
1910 | TREE_ADDRESSABLE (fn)((fn)->base.addressable_flag) = 1; |
1911 | /* When we don't have vcall offsets, we output thunks whenever |
1912 | we output the vtables that contain them. With vcall offsets, |
1913 | we know all the thunks we'll need when we emit a virtual |
1914 | function, so we emit the thunks there instead. */ |
1915 | if (DECL_THUNK_P (fn)(((enum tree_code) (fn)->base.code) == FUNCTION_DECL && ((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1915, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1915, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1915, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1915, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1915, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1915, __FUNCTION__); <->u.fn; })->thunk_p)) |
1916 | use_thunk (fn, /*emit_p=*/0); |
1917 | /* Set the location, as marking the function could cause |
1918 | instantiation. We do not need to preserve the incoming |
1919 | location, as we're called from c_parse_final_cleanups, which |
1920 | takes care of that. */ |
1921 | input_location = DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1921, __FUNCTION__))->decl_minimal.locus); |
1922 | mark_used (fn); |
1923 | } |
1924 | } |
1925 | |
1926 | /* Replace any consteval functions in vtables with null pointers. */ |
1927 | |
1928 | static void |
1929 | clear_consteval_vfns (vec<tree> &consteval_vtables) |
1930 | { |
1931 | for (tree vtable : consteval_vtables) |
1932 | for (constructor_elt &elt : CONSTRUCTOR_ELTS (DECL_INITIAL (vtable))((tree_check ((((contains_struct_check ((vtable), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1932, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1932, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)) |
1933 | { |
1934 | tree fn = cp_get_fndecl_from_callee (elt.value, /*fold*/false); |
1935 | if (fn && DECL_IMMEDIATE_FUNCTION_P (fn)(((contains_struct_check (((tree_check (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__))->decl_common.lang_specific) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1935, __FUNCTION__); <->u.fn; })->immediate_fn_p : false)) |
1936 | elt.value = build_zero_cst (vtable_entry_typecp_global_trees[CPTI_VTABLE_ENTRY_TYPE]); |
1937 | } |
1938 | } |
1939 | |
1940 | /* Adjust the TLS model on variable DECL if need be, typically after |
1941 | the linkage of DECL has been modified. */ |
1942 | |
1943 | static void |
1944 | adjust_var_decl_tls_model (tree decl) |
1945 | { |
1946 | if (CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1946, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1946, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) |
1947 | && !lookup_attribute ("tls_model", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1947, __FUNCTION__))->decl_common.attributes))) |
1948 | set_decl_tls_model (decl, decl_default_tls_model (decl)); |
1949 | } |
1950 | |
1951 | /* Set DECL up to have the closest approximation of "initialized common" |
1952 | linkage available. */ |
1953 | |
1954 | void |
1955 | comdat_linkage (tree decl) |
1956 | { |
1957 | if (flag_weakglobal_options.x_flag_weak) |
1958 | make_decl_one_only (decl, cxx_comdat_group (decl)); |
1959 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
1960 | || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1960, __FUNCTION__))->decl_common.artificial_flag))) |
1961 | /* We can just emit function and compiler-generated variables |
1962 | statically; having multiple copies is (for the most part) only |
1963 | a waste of space. |
1964 | |
1965 | There are two correctness issues, however: the address of a |
1966 | template instantiation with external linkage should be the |
1967 | same, independent of what translation unit asks for the |
1968 | address, and this will not hold when we emit multiple copies of |
1969 | the function. However, there's little else we can do. |
1970 | |
1971 | Also, by default, the typeinfo implementation assumes that |
1972 | there will be only one copy of the string used as the name for |
1973 | each type. Therefore, if weak symbols are unavailable, the |
1974 | run-time library should perform a more conservative check; it |
1975 | should perform a string comparison, rather than an address |
1976 | comparison. */ |
1977 | TREE_PUBLIC (decl)((decl)->base.public_flag) = 0; |
1978 | else |
1979 | { |
1980 | /* Static data member template instantiations, however, cannot |
1981 | have multiple copies. */ |
1982 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1982, __FUNCTION__))->decl_common.initial) == 0 |
1983 | || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1983, __FUNCTION__))->decl_common.initial) == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1984 | DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1984, __FUNCTION__))->decl_with_vis.common_flag) = 1; |
1985 | else if (EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1985, __FUNCTION__))->decl_common.initial))->base.code ) == CONSTRUCTOR && vec_safe_is_empty(((tree_check (( ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1985, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1985, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)) && !(((tree_not_check2 ((((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1985, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1985, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)))) |
1986 | { |
1987 | DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1987, __FUNCTION__))->decl_with_vis.common_flag) = 1; |
1988 | DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1988, __FUNCTION__))->decl_common.initial) = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1989 | } |
1990 | else if (!DECL_EXPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1990, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 3)) |
1991 | { |
1992 | /* We can't do anything useful; leave vars for explicit |
1993 | instantiation. */ |
1994 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1994, __FUNCTION__))->decl_common.decl_flag_1) = 1; |
1995 | DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 1995, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 0; |
1996 | } |
1997 | } |
1998 | |
1999 | if (TREE_PUBLIC (decl)((decl)->base.public_flag)) |
2000 | DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2000, __FUNCTION__))->decl_with_vis.comdat_flag) = 1; |
2001 | |
2002 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
2003 | adjust_var_decl_tls_model (decl); |
2004 | } |
2005 | |
2006 | /* For win32 we also want to put explicit instantiations in |
2007 | linkonce sections, so that they will be merged with implicit |
2008 | instantiations; otherwise we get duplicate symbol errors. |
2009 | For Darwin we do not want explicit instantiations to be |
2010 | linkonce. */ |
2011 | |
2012 | void |
2013 | maybe_make_one_only (tree decl) |
2014 | { |
2015 | /* We used to say that this was not necessary on targets that support weak |
2016 | symbols, because the implicit instantiations will defer to the explicit |
2017 | one. However, that's not actually the case in SVR4; a strong definition |
2018 | after a weak one is an error. Also, not making explicit |
2019 | instantiations one_only means that we can end up with two copies of |
2020 | some template instantiations. */ |
2021 | if (! flag_weakglobal_options.x_flag_weak) |
2022 | return; |
2023 | |
2024 | /* We can't set DECL_COMDAT on functions, or cp_finish_file will think |
2025 | we can get away with not emitting them if they aren't used. We need |
2026 | to for variables so that cp_finish_decl will update their linkage, |
2027 | because their DECL_INITIAL may not have been set properly yet. */ |
2028 | |
2029 | if (!TARGET_WEAK_NOT_IN_ARCHIVE_TOC0 |
2030 | || (! DECL_EXPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2030, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 3) |
2031 | && ! DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2031, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2))) |
2032 | { |
2033 | make_decl_one_only (decl, cxx_comdat_group (decl)); |
2034 | |
2035 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
2036 | { |
2037 | varpool_node *node = varpool_node::get_create (decl); |
2038 | DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2038, __FUNCTION__))->decl_with_vis.comdat_flag) = 1; |
2039 | /* Mark it needed so we don't forget to emit it. */ |
2040 | node->forced_by_abi = true; |
2041 | TREE_USED (decl)((decl)->base.used_flag) = 1; |
2042 | |
2043 | adjust_var_decl_tls_model (decl); |
2044 | } |
2045 | } |
2046 | } |
2047 | |
2048 | /* Returns true iff DECL, a FUNCTION_DECL or VAR_DECL, has vague linkage. |
2049 | This predicate will give the right answer during parsing of the |
2050 | function, which other tests may not. */ |
2051 | |
2052 | bool |
2053 | vague_linkage_p (tree decl) |
2054 | { |
2055 | if (!TREE_PUBLIC (decl)((decl)->base.public_flag)) |
2056 | { |
2057 | /* maybe_thunk_body clears TREE_PUBLIC and DECL_ABSTRACT_P on the |
2058 | maybe-in-charge 'tor variants; in that case we need to check one of |
2059 | the "clones" for the real linkage. But only in that case; before |
2060 | maybe_clone_body we haven't yet copied the linkage to the clones. */ |
2061 | if (DECL_MAYBE_IN_CHARGE_CDTOR_P (decl)((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2061, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2061, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])) |
2062 | && !DECL_ABSTRACT_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2062, __FUNCTION__))->decl_common.abstract_flag) |
2063 | && DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2063, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2063, __FUNCTION__))->common.chain)) |
2064 | && DECL_CLONED_FUNCTION_P (DECL_CHAIN (decl))(((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check (((( (contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2064, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) |
2065 | return vague_linkage_p (DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2065, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2065, __FUNCTION__))->common.chain))); |
2066 | |
2067 | gcc_checking_assert (!DECL_COMDAT (decl))((void)(!(!((contains_struct_check ((decl), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2067, __FUNCTION__))->decl_with_vis.comdat_flag)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2067, __FUNCTION__), 0 : 0)); |
2068 | return false; |
2069 | } |
2070 | /* Unfortunately, import_export_decl has not always been called |
2071 | before the function is processed, so we cannot simply check |
2072 | DECL_COMDAT. */ |
2073 | if (DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2073, __FUNCTION__))->decl_with_vis.comdat_flag) |
2074 | || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
2075 | && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2075, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag )) |
2076 | || (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2076, __FUNCTION__))->decl_common.lang_specific) |
2077 | && DECL_TEMPLATE_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2077, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) & 1)) |
2078 | || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_INLINE_VAR_P (decl)((((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__))->decl_common.lang_specific)->u.base .var_declared_inline_p : false) || (cxx_dialect >= cxx17 && ((contains_struct_check (((tree_check2 (((((enum tree_code) ( decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__))->decl_common.lang_flag_8) && (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2078, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)))))) |
2079 | return true; |
2080 | else if (DECL_FUNCTION_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2080, __FUNCTION__))->decl_minimal.context) && ( (enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2080, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL)) |
2081 | /* A local static in an inline effectively has vague linkage. */ |
2082 | return (TREE_STATIC (decl)((decl)->base.static_flag) |
2083 | && vague_linkage_p (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2083, __FUNCTION__))->decl_minimal.context))); |
2084 | else |
2085 | return false; |
2086 | } |
2087 | |
2088 | /* Determine whether or not we want to specifically import or export CTYPE, |
2089 | using various heuristics. */ |
2090 | |
2091 | static void |
2092 | import_export_class (tree ctype) |
2093 | { |
2094 | /* -1 for imported, 1 for exported. */ |
2095 | int import_export = 0; |
2096 | |
2097 | /* It only makes sense to call this function at EOF. The reason is |
2098 | that this function looks at whether or not the first non-inline |
2099 | non-abstract virtual member function has been defined in this |
2100 | translation unit. But, we can't possibly know that until we've |
2101 | seen the entire translation unit. */ |
2102 | gcc_assert (at_eof)((void)(!(at_eof) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2102, __FUNCTION__), 0 : 0)); |
2103 | |
2104 | if (CLASSTYPE_INTERFACE_KNOWN (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2104, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_unknown == 0)) |
2105 | return; |
2106 | |
2107 | /* If MULTIPLE_SYMBOL_SPACES is set and we saw a #pragma interface, |
2108 | we will have CLASSTYPE_INTERFACE_ONLY set but not |
2109 | CLASSTYPE_INTERFACE_KNOWN. In that case, we don't want to use this |
2110 | heuristic because someone will supply a #pragma implementation |
2111 | elsewhere, and deducing it here would produce a conflict. */ |
2112 | if (CLASSTYPE_INTERFACE_ONLY (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2112, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_only)) |
2113 | return; |
2114 | |
2115 | if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2115, __FUNCTION__))->type_common.attributes))) |
2116 | import_export = -1; |
2117 | else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2117, __FUNCTION__))->type_common.attributes))) |
2118 | import_export = 1; |
2119 | else if (CLASSTYPE_IMPLICIT_INSTANTIATION (ctype)(((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2119, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 1) |
2120 | && !flag_implicit_templatesglobal_options.x_flag_implicit_templates) |
2121 | /* For a template class, without -fimplicit-templates, check the |
2122 | repository. If the virtual table is assigned to this |
2123 | translation unit, then export the class; otherwise, import |
2124 | it. */ |
2125 | import_export = -1; |
2126 | else if (TYPE_POLYMORPHIC_P (ctype)(((tree_not_check2 ((ctype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2126, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2))) |
2127 | { |
2128 | /* The ABI specifies that the virtual table and associated |
2129 | information are emitted with the key method, if any. */ |
2130 | tree method = CLASSTYPE_KEY_METHOD (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2130, __FUNCTION__))->type_with_lang_specific.lang_specific ))->key_method); |
2131 | /* If weak symbol support is not available, then we must be |
2132 | careful not to emit the vtable when the key function is |
2133 | inline. An inline function can be defined in multiple |
2134 | translation units. If we were to emit the vtable in each |
2135 | translation unit containing a definition, we would get |
2136 | multiple definition errors at link-time. */ |
2137 | if (method && (flag_weakglobal_options.x_flag_weak || ! DECL_DECLARED_INLINE_P (method)((tree_check ((method), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2137, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ))) |
2138 | import_export = (DECL_REALLY_EXTERN (method)(((contains_struct_check ((method), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2138, __FUNCTION__))->decl_common.decl_flag_1) && (!((contains_struct_check ((method), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2138, __FUNCTION__))->decl_common.lang_specific) || !((( contains_struct_check ((method), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2138, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern))) ? -1 : 1); |
2139 | } |
2140 | |
2141 | /* When MULTIPLE_SYMBOL_SPACES is set, we cannot count on seeing |
2142 | a definition anywhere else. */ |
2143 | if (MULTIPLE_SYMBOL_SPACES0 && import_export == -1) |
2144 | import_export = 0; |
2145 | |
2146 | /* Allow back ends the chance to overrule the decision. */ |
2147 | if (targetm.cxx.import_export_class) |
2148 | import_export = targetm.cxx.import_export_class (ctype, import_export); |
2149 | |
2150 | if (import_export) |
2151 | { |
2152 | SET_CLASSTYPE_INTERFACE_KNOWN (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2152, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_unknown = 0); |
2153 | CLASSTYPE_INTERFACE_ONLY (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2153, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_only) = (import_export < 0); |
2154 | } |
2155 | } |
2156 | |
2157 | /* Return true if VAR has already been provided to the back end; in that |
2158 | case VAR should not be modified further by the front end. */ |
2159 | static bool |
2160 | var_finalized_p (tree var) |
2161 | { |
2162 | return varpool_node::get_create (var)->definition; |
2163 | } |
2164 | |
2165 | /* DECL is a VAR_DECL or FUNCTION_DECL which, for whatever reason, |
2166 | must be emitted in this translation unit. Mark it as such. */ |
2167 | |
2168 | void |
2169 | mark_needed (tree decl) |
2170 | { |
2171 | TREE_USED (decl)((decl)->base.used_flag) = 1; |
2172 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) |
2173 | { |
2174 | /* Extern inline functions don't become needed when referenced. |
2175 | If we know a method will be emitted in other TU and no new |
2176 | functions can be marked reachable, just use the external |
2177 | definition. */ |
2178 | struct cgraph_node *node = cgraph_node::get_create (decl); |
2179 | node->forced_by_abi = true; |
2180 | |
2181 | /* #pragma interface can call mark_needed for |
2182 | maybe-in-charge 'tors; mark the clones as well. */ |
2183 | tree clone; |
2184 | FOR_EACH_CLONE (clone, decl)if (!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL && ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ; else for (clone = (((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->common.chain)); clone && ( ((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((clone ), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((clone) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]))); clone = (((contains_struct_check ( ((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2184, __FUNCTION__))->common.chain))) |
2185 | mark_needed (clone); |
2186 | } |
2187 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
2188 | { |
2189 | varpool_node *node = varpool_node::get_create (decl); |
2190 | /* C++ frontend use mark_decl_references to force COMDAT variables |
2191 | to be output that might appear dead otherwise. */ |
2192 | node->forced_by_abi = true; |
2193 | } |
2194 | } |
2195 | |
2196 | /* DECL is either a FUNCTION_DECL or a VAR_DECL. This function |
2197 | returns true if a definition of this entity should be provided in |
2198 | this object file. Callers use this function to determine whether |
2199 | or not to let the back end know that a definition of DECL is |
2200 | available in this translation unit. */ |
2201 | |
2202 | bool |
2203 | decl_needed_p (tree decl) |
2204 | { |
2205 | gcc_assert (VAR_OR_FUNCTION_DECL_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum tree_code) (decl)->base.code) == FUNCTION_DECL) ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2205, __FUNCTION__), 0 : 0)); |
2206 | /* This function should only be called at the end of the translation |
2207 | unit. We cannot be sure of whether or not something will be |
2208 | COMDAT until that point. */ |
2209 | gcc_assert (at_eof)((void)(!(at_eof) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2209, __FUNCTION__), 0 : 0)); |
2210 | |
2211 | /* All entities with external linkage that are not COMDAT/EXTERN should be |
2212 | emitted; they may be referred to from other object files. */ |
2213 | if (TREE_PUBLIC (decl)((decl)->base.public_flag) && !DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2213, __FUNCTION__))->decl_with_vis.comdat_flag) && !DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2213, __FUNCTION__))->decl_common.decl_flag_1) && (!((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2213, __FUNCTION__))->decl_common.lang_specific) || !((( contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2213, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern)))) |
2214 | return true; |
2215 | |
2216 | /* Functions marked "dllexport" must be emitted so that they are |
2217 | visible to other DLLs. */ |
2218 | if (flag_keep_inline_dllexportglobal_options.x_flag_keep_inline_dllexport |
2219 | && lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2219, __FUNCTION__))->decl_common.attributes))) |
2220 | return true; |
2221 | |
2222 | /* When not optimizing, do not bother to produce definitions for extern |
2223 | symbols. */ |
2224 | if (DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2224, __FUNCTION__))->decl_common.decl_flag_1) && (!((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2224, __FUNCTION__))->decl_common.lang_specific) || !((( contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2224, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern))) |
2225 | && ((TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL |
2226 | && !optimizeglobal_options.x_optimize) |
2227 | || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
2228 | && !opt_for_fn (decl, optimize)(opts_for_fn (decl)->x_optimize))) |
2229 | && !lookup_attribute ("always_inline", decl)) |
2230 | return false; |
2231 | |
2232 | /* If this entity was used, let the back end see it; it will decide |
2233 | whether or not to emit it into the object file. */ |
2234 | if (TREE_USED (decl)((decl)->base.used_flag)) |
2235 | return true; |
2236 | |
2237 | /* Virtual functions might be needed for devirtualization. */ |
2238 | if (flag_devirtualizeglobal_options.x_flag_devirtualize |
2239 | && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
2240 | && DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2240, __FUNCTION__))->decl_common.virtual_flag)) |
2241 | return true; |
2242 | |
2243 | /* Otherwise, DECL does not need to be emitted -- yet. A subsequent |
2244 | reference to DECL might cause it to be emitted later. */ |
2245 | return false; |
2246 | } |
2247 | |
2248 | /* If necessary, write out the vtables for the dynamic class CTYPE. |
2249 | Returns true if any vtables were emitted. */ |
2250 | |
2251 | static bool |
2252 | maybe_emit_vtables (tree ctype, vec<tree> &consteval_vtables) |
2253 | { |
2254 | tree vtbl; |
2255 | tree primary_vtbl; |
2256 | int needed = 0; |
2257 | varpool_node *current = NULL__null, *last = NULL__null; |
2258 | |
2259 | /* If the vtables for this class have already been emitted there is |
2260 | nothing more to do. */ |
2261 | primary_vtbl = CLASSTYPE_VTABLES (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2261, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables); |
2262 | if (var_finalized_p (primary_vtbl)) |
2263 | return false; |
2264 | /* Ignore dummy vtables made by get_vtable_decl. */ |
2265 | if (TREE_TYPE (primary_vtbl)((contains_struct_check ((primary_vtbl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2265, __FUNCTION__))->typed.type) == void_type_nodeglobal_trees[TI_VOID_TYPE]) |
2266 | return false; |
2267 | |
2268 | /* On some targets, we cannot determine the key method until the end |
2269 | of the translation unit -- which is when this function is |
2270 | called. */ |
2271 | if (!targetm.cxx.key_method_may_be_inline ()) |
2272 | determine_key_method (ctype); |
2273 | |
2274 | /* See if any of the vtables are needed. */ |
2275 | for (vtbl = CLASSTYPE_VTABLES (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2275, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables); vtbl; vtbl = DECL_CHAIN (vtbl)(((contains_struct_check (((contains_struct_check ((vtbl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2275, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2275, __FUNCTION__))->common.chain))) |
2276 | { |
2277 | import_export_decl (vtbl); |
2278 | if (DECL_NOT_REALLY_EXTERN (vtbl)(((contains_struct_check ((vtbl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2278, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) && decl_needed_p (vtbl)) |
2279 | needed = 1; |
2280 | } |
2281 | if (!needed) |
2282 | { |
2283 | /* If the references to this class' vtables are optimized away, |
2284 | still emit the appropriate debugging information. See |
2285 | dfs_debug_mark. */ |
2286 | if (DECL_COMDAT (primary_vtbl)((contains_struct_check ((primary_vtbl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2286, __FUNCTION__))->decl_with_vis.comdat_flag) |
2287 | && CLASSTYPE_DEBUG_REQUESTED (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2287, __FUNCTION__))->type_with_lang_specific.lang_specific ))->debug_requested)) |
2288 | note_debug_info_needed (ctype); |
2289 | return false; |
2290 | } |
2291 | |
2292 | /* The ABI requires that we emit all of the vtables if we emit any |
2293 | of them. */ |
2294 | for (vtbl = CLASSTYPE_VTABLES (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2294, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables); vtbl; vtbl = DECL_CHAIN (vtbl)(((contains_struct_check (((contains_struct_check ((vtbl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2294, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2294, __FUNCTION__))->common.chain))) |
2295 | { |
2296 | /* Mark entities references from the virtual table as used. */ |
2297 | mark_vtable_entries (vtbl, consteval_vtables); |
2298 | |
2299 | if (TREE_TYPE (DECL_INITIAL (vtbl))((contains_struct_check ((((contains_struct_check ((vtbl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2299, __FUNCTION__))->decl_common.initial)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2299, __FUNCTION__))->typed.type) == 0) |
2300 | { |
2301 | vec<tree, va_gc> *cleanups = NULL__null; |
2302 | tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl)((contains_struct_check ((vtbl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2302, __FUNCTION__))->decl_common.initial), &cleanups, |
2303 | LOOKUP_NORMAL((1 << 0))); |
2304 | |
2305 | /* It had better be all done at compile-time. */ |
2306 | gcc_assert (!expr && !cleanups)((void)(!(!expr && !cleanups) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2306, __FUNCTION__), 0 : 0)); |
2307 | } |
2308 | |
2309 | /* Write it out. */ |
2310 | DECL_EXTERNAL (vtbl)((contains_struct_check ((vtbl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2310, __FUNCTION__))->decl_common.decl_flag_1) = 0; |
2311 | rest_of_decl_compilation (vtbl, 1, 1); |
2312 | |
2313 | /* Because we're only doing syntax-checking, we'll never end up |
2314 | actually marking the variable as written. */ |
2315 | if (flag_syntax_onlyglobal_options.x_flag_syntax_only) |
2316 | TREE_ASM_WRITTEN (vtbl)((vtbl)->base.asm_written_flag) = 1; |
2317 | else if (DECL_ONE_ONLY (vtbl)(decl_comdat_group (vtbl) != (tree) __null && (((vtbl )->base.public_flag) || ((contains_struct_check ((vtbl), ( TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2317, __FUNCTION__))->decl_common.decl_flag_1)))) |
2318 | { |
2319 | current = varpool_node::get_create (vtbl); |
2320 | if (last) |
2321 | current->add_to_same_comdat_group (last); |
2322 | last = current; |
2323 | } |
2324 | } |
2325 | |
2326 | /* For abstract classes, the destructor has been removed from the |
2327 | vtable (in class.c's build_vtbl_initializer). For a compiler- |
2328 | generated destructor, it hence might not have been generated in |
2329 | this translation unit - and with '#pragma interface' it might |
2330 | never get generated. */ |
2331 | if (CLASSTYPE_PURE_VIRTUALS (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2331, __FUNCTION__))->type_with_lang_specific.lang_specific ))->pure_virtuals) |
2332 | && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2332, __FUNCTION__))->type_common.lang_flag_4)) |
2333 | && !CLASSTYPE_LAZY_DESTRUCTOR (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2333, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_destructor) |
2334 | && DECL_DEFAULTED_IN_CLASS_P (CLASSTYPE_DESTRUCTOR (ctype))((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) ((get_class_binding_direct (ctype, cp_global_trees [CPTI_DTOR_IDENTIFIER])))->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check (((get_class_binding_direct (ctype, cp_global_trees [CPTI_DTOR_IDENTIFIER]))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2334, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER])))), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2334, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) ((get_class_binding_direct (ctype, cp_global_trees [CPTI_DTOR_IDENTIFIER])))->base.code) == FUNCTION_DECL || ( ((enum tree_code) ((get_class_binding_direct (ctype, cp_global_trees [CPTI_DTOR_IDENTIFIER])))->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((get_class_binding_direct (ctype, cp_global_trees [CPTI_DTOR_IDENTIFIER]))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2334, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER]))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2334, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2334, __FUNCTION__); <->u.fn; })->defaulted_p) && (((contains_struct_check (((tree_check2 (((get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER]))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2334, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2334, __FUNCTION__))->decl_common.lang_specific) ->u. base.initialized_in_class))) |
2335 | note_vague_linkage_fn (CLASSTYPE_DESTRUCTOR (ctype)(get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER ]))); |
2336 | |
2337 | /* Since we're writing out the vtable here, also write the debug |
2338 | info. */ |
2339 | note_debug_info_needed (ctype); |
2340 | |
2341 | return true; |
2342 | } |
2343 | |
2344 | /* A special return value from type_visibility meaning internal |
2345 | linkage. */ |
2346 | |
2347 | enum { VISIBILITY_ANON = VISIBILITY_INTERNAL+1 }; |
2348 | |
2349 | static int expr_visibility (tree); |
2350 | static int type_visibility (tree); |
2351 | |
2352 | /* walk_tree helper function for type_visibility. */ |
2353 | |
2354 | static tree |
2355 | min_vis_r (tree *tp, int *walk_subtrees, void *data) |
2356 | { |
2357 | int *vis_p = (int *)data; |
2358 | int this_vis = VISIBILITY_DEFAULT; |
2359 | if (! TYPE_P (*tp)(tree_code_type[(int) (((enum tree_code) (*tp)->base.code) )] == tcc_type)) |
2360 | *walk_subtrees = 0; |
2361 | else if (OVERLOAD_TYPE_P (*tp)((((((enum tree_code) (*tp)->base.code)) == RECORD_TYPE || (((enum tree_code) (*tp)->base.code)) == UNION_TYPE) && ((tree_class_check ((*tp), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2361, __FUNCTION__))->type_common.lang_flag_5)) || ((enum tree_code) (*tp)->base.code) == ENUMERAL_TYPE) |
2362 | && !TREE_PUBLIC (TYPE_MAIN_DECL (*tp))((((((contains_struct_check (((tree_class_check ((((tree_class_check ((*tp), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2362, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2362, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2362, __FUNCTION__))->common.chain))))->base.public_flag )) |
2363 | { |
2364 | this_vis = VISIBILITY_ANON; |
2365 | *walk_subtrees = 0; |
2366 | } |
2367 | else if (CLASS_TYPE_P (*tp)(((((enum tree_code) (*tp)->base.code)) == RECORD_TYPE || ( ((enum tree_code) (*tp)->base.code)) == UNION_TYPE) && ((tree_class_check ((*tp), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2367, __FUNCTION__))->type_common.lang_flag_5))) |
2368 | { |
2369 | this_vis = CLASSTYPE_VISIBILITY (*tp)((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((*tp), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2369, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2369, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2369, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2369, __FUNCTION__))->decl_with_vis.visibility); |
2370 | *walk_subtrees = 0; |
2371 | } |
2372 | else if (TREE_CODE (*tp)((enum tree_code) (*tp)->base.code) == ARRAY_TYPE |
2373 | && uses_template_parms (TYPE_DOMAIN (*tp)((tree_check ((*tp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2373, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ))) |
2374 | this_vis = expr_visibility (TYPE_MAX_VALUE (TYPE_DOMAIN (*tp))((tree_check5 ((((tree_check ((*tp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2374, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2374, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval )); |
2375 | |
2376 | if (this_vis > *vis_p) |
2377 | *vis_p = this_vis; |
2378 | |
2379 | /* Tell cp_walk_subtrees to look through typedefs. */ |
2380 | if (*walk_subtrees == 1) |
2381 | *walk_subtrees = 2; |
2382 | |
2383 | return NULL__null; |
2384 | } |
2385 | |
2386 | /* walk_tree helper function for expr_visibility. */ |
2387 | |
2388 | static tree |
2389 | min_vis_expr_r (tree *tp, int */*walk_subtrees*/, void *data) |
2390 | { |
2391 | int *vis_p = (int *)data; |
2392 | int tpvis = VISIBILITY_DEFAULT; |
2393 | |
2394 | switch (TREE_CODE (*tp)((enum tree_code) (*tp)->base.code)) |
2395 | { |
2396 | case CAST_EXPR: |
2397 | case IMPLICIT_CONV_EXPR: |
2398 | case STATIC_CAST_EXPR: |
2399 | case REINTERPRET_CAST_EXPR: |
2400 | case CONST_CAST_EXPR: |
2401 | case DYNAMIC_CAST_EXPR: |
2402 | case NEW_EXPR: |
2403 | case CONSTRUCTOR: |
2404 | case LAMBDA_EXPR: |
2405 | tpvis = type_visibility (TREE_TYPE (*tp)((contains_struct_check ((*tp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2405, __FUNCTION__))->typed.type)); |
2406 | break; |
2407 | |
2408 | case VAR_DECL: |
2409 | case FUNCTION_DECL: |
2410 | if (! TREE_PUBLIC (*tp)((*tp)->base.public_flag)) |
2411 | tpvis = VISIBILITY_ANON; |
2412 | else |
2413 | tpvis = DECL_VISIBILITY (*tp)((contains_struct_check ((*tp), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2413, __FUNCTION__))->decl_with_vis.visibility); |
2414 | break; |
2415 | |
2416 | default: |
2417 | break; |
2418 | } |
2419 | |
2420 | if (tpvis > *vis_p) |
2421 | *vis_p = tpvis; |
2422 | |
2423 | return NULL_TREE(tree) __null; |
2424 | } |
2425 | |
2426 | /* Returns the visibility of TYPE, which is the minimum visibility of its |
2427 | component types. */ |
2428 | |
2429 | static int |
2430 | type_visibility (tree type) |
2431 | { |
2432 | int vis = VISIBILITY_DEFAULT; |
2433 | cp_walk_tree_without_duplicates (&type, min_vis_r, &vis)walk_tree_without_duplicates_1 (&type, min_vis_r, &vis , cp_walk_subtrees); |
2434 | return vis; |
2435 | } |
2436 | |
2437 | /* Returns the visibility of an expression EXPR that appears in the signature |
2438 | of a function template, which is the minimum visibility of names that appear |
2439 | in its mangling. */ |
2440 | |
2441 | static int |
2442 | expr_visibility (tree expr) |
2443 | { |
2444 | int vis = VISIBILITY_DEFAULT; |
2445 | cp_walk_tree_without_duplicates (&expr, min_vis_expr_r, &vis)walk_tree_without_duplicates_1 (&expr, min_vis_expr_r, & vis, cp_walk_subtrees); |
2446 | return vis; |
2447 | } |
2448 | |
2449 | /* Limit the visibility of DECL to VISIBILITY, if not explicitly |
2450 | specified (or if VISIBILITY is static). If TMPL is true, this |
2451 | constraint is for a template argument, and takes precedence |
2452 | over explicitly-specified visibility on the template. */ |
2453 | |
2454 | static void |
2455 | constrain_visibility (tree decl, int visibility, bool tmpl) |
2456 | { |
2457 | if (visibility == VISIBILITY_ANON) |
2458 | { |
2459 | /* extern "C" declarations aren't affected by the anonymous |
2460 | namespace. */ |
2461 | if (!DECL_EXTERN_C_P (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2461, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2461, __FUNCTION__))->decl_common.lang_specific)->u.base .language : (((enum tree_code) (decl)->base.code) == FUNCTION_DECL ? lang_c : lang_cplusplus)) == lang_c)) |
2462 | { |
2463 | TREE_PUBLIC (decl)((decl)->base.public_flag) = 0; |
2464 | DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2464, __FUNCTION__))->decl_with_vis.weak_flag) = 0; |
2465 | DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2465, __FUNCTION__))->decl_with_vis.common_flag) = 0; |
2466 | DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2466, __FUNCTION__))->decl_with_vis.comdat_flag) = false; |
2467 | if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum tree_code) (decl)->base.code) == FUNCTION_DECL)) |
2468 | { |
2469 | struct symtab_node *snode = symtab_node::get (decl); |
2470 | |
2471 | if (snode) |
2472 | snode->set_comdat_group (NULL__null); |
2473 | } |
2474 | DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2474, __FUNCTION__))->decl_common.lang_flag_5) = 1; |
2475 | if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2475, __FUNCTION__))->decl_common.lang_specific)) |
2476 | DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2476, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 1; |
2477 | } |
2478 | } |
2479 | else if (visibility > DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2479, __FUNCTION__))->decl_with_vis.visibility) |
2480 | && (tmpl || !DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2480, __FUNCTION__))->decl_with_vis.visibility_specified ))) |
2481 | { |
2482 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2482, __FUNCTION__))->decl_with_vis.visibility) = (enum symbol_visibility) visibility; |
2483 | /* This visibility was not specified. */ |
2484 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2484, __FUNCTION__))->decl_with_vis.visibility_specified ) = false; |
2485 | } |
2486 | } |
2487 | |
2488 | /* Constrain the visibility of DECL based on the visibility of its template |
2489 | arguments. */ |
2490 | |
2491 | static void |
2492 | constrain_visibility_for_template (tree decl, tree targs) |
2493 | { |
2494 | /* If this is a template instantiation, check the innermost |
2495 | template args for visibility constraints. The outer template |
2496 | args are covered by the class check. */ |
2497 | tree args = INNERMOST_TEMPLATE_ARGS (targs)(get_innermost_template_args ((targs), 1)); |
2498 | int i; |
2499 | for (i = TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2499, __FUNCTION__, (TREE_VEC)))->base.u.length); i > 0; --i) |
2500 | { |
2501 | int vis = 0; |
2502 | |
2503 | tree arg = TREE_VEC_ELT (args, i-1)(*((const_cast<tree *> (tree_vec_elt_check ((args), (i- 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2503, __FUNCTION__))))); |
2504 | if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code) )] == tcc_type)) |
2505 | vis = type_visibility (arg); |
2506 | else |
2507 | vis = expr_visibility (arg); |
2508 | if (vis) |
2509 | constrain_visibility (decl, vis, true); |
2510 | } |
2511 | } |
2512 | |
2513 | /* Like c_determine_visibility, but with additional C++-specific |
2514 | behavior. |
2515 | |
2516 | Function-scope entities can rely on the function's visibility because |
2517 | it is set in start_preparsed_function. |
2518 | |
2519 | Class-scope entities cannot rely on the class's visibility until the end |
2520 | of the enclosing class definition. |
2521 | |
2522 | Note that because namespaces have multiple independent definitions, |
2523 | namespace visibility is handled elsewhere using the #pragma visibility |
2524 | machinery rather than by decorating the namespace declaration. |
2525 | |
2526 | The goal is for constraints from the type to give a diagnostic, and |
2527 | other constraints to be applied silently. */ |
2528 | |
2529 | void |
2530 | determine_visibility (tree decl) |
2531 | { |
2532 | /* Remember that all decls get VISIBILITY_DEFAULT when built. */ |
2533 | |
2534 | /* Only relevant for names with external linkage. */ |
2535 | if (!TREE_PUBLIC (decl)((decl)->base.public_flag)) |
2536 | return; |
2537 | |
2538 | /* Cloned constructors and destructors get the same visibility as |
2539 | the underlying function. That should be set up in |
2540 | maybe_clone_body. */ |
2541 | gcc_assert (!DECL_CLONED_FUNCTION_P (decl))((void)(!(!(((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2541, __FUNCTION__), 0 : 0)); |
2542 | |
2543 | bool orig_visibility_specified = DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2543, __FUNCTION__))->decl_with_vis.visibility_specified ); |
2544 | enum symbol_visibility orig_visibility = DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2544, __FUNCTION__))->decl_with_vis.visibility); |
2545 | |
2546 | /* The decl may be a template instantiation, which could influence |
2547 | visibilty. */ |
2548 | tree template_decl = NULL_TREE(tree) __null; |
2549 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL) |
2550 | { |
2551 | if (CLASS_TYPE_P (TREE_TYPE (decl))(((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2551, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2551, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((decl ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2551, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2551, __FUNCTION__))->type_common.lang_flag_5))) |
2552 | { |
2553 | if (CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl))((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2553, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2553, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template)) |
2554 | template_decl = decl; |
2555 | } |
2556 | else if (TYPE_TEMPLATE_INFO (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2556, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2556, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2556, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2556, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2556, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE ) ? ((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2556, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2556, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )) |
2557 | template_decl = decl; |
2558 | } |
2559 | else if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2559, __FUNCTION__))->decl_common.lang_specific) && DECL_USE_TEMPLATE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2559, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template)) |
2560 | template_decl = decl; |
2561 | |
2562 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL |
2563 | && LAMBDA_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE && ((((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2563, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag )) |
2564 | && CLASSTYPE_LAMBDA_EXPR (TREE_TYPE (decl))((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2564, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2564, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr) != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2565 | if (tree extra = LAMBDA_TYPE_EXTRA_SCOPE (TREE_TYPE (decl))((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2565, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2565, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2565, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope))) |
2566 | { |
2567 | /* The lambda's visibility is limited by that of its extra |
2568 | scope. */ |
2569 | int vis = 0; |
2570 | if (TYPE_P (extra)(tree_code_type[(int) (((enum tree_code) (extra)->base.code ))] == tcc_type)) |
2571 | vis = type_visibility (extra); |
2572 | else |
2573 | vis = expr_visibility (extra); |
2574 | constrain_visibility (decl, vis, false); |
2575 | } |
2576 | |
2577 | /* If DECL is a member of a class, visibility specifiers on the |
2578 | class can influence the visibility of the DECL. */ |
2579 | tree class_type = NULL_TREE(tree) __null; |
2580 | if (DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2580, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2580, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) |
2581 | class_type = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2581, __FUNCTION__))->decl_minimal.context); |
2582 | else |
2583 | { |
2584 | /* Not a class member. */ |
2585 | |
2586 | /* Virtual tables have DECL_CONTEXT set to their associated class, |
2587 | so they are automatically handled above. */ |
2588 | gcc_assert (!VAR_P (decl)((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL ) || !((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2589, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2589, __FUNCTION__))->decl_common.virtual_flag)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2589, __FUNCTION__), 0 : 0)) |
2589 | || !DECL_VTABLE_OR_VTT_P (decl))((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL ) || !((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2589, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2589, __FUNCTION__))->decl_common.virtual_flag)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2589, __FUNCTION__), 0 : 0)); |
2590 | |
2591 | if (DECL_FUNCTION_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2591, __FUNCTION__))->decl_minimal.context) && ( (enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2591, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL) && ! DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2591, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2592 | { |
2593 | /* Local statics and classes get the visibility of their |
2594 | containing function by default, except that |
2595 | -fvisibility-inlines-hidden doesn't affect them. */ |
2596 | tree fn = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2596, __FUNCTION__))->decl_minimal.context); |
2597 | if (DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2597, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2598 | { |
2599 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2599, __FUNCTION__))->decl_with_vis.visibility) = DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2599, __FUNCTION__))->decl_with_vis.visibility); |
2600 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2600, __FUNCTION__))->decl_with_vis.visibility_specified ) = |
2601 | DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2601, __FUNCTION__))->decl_with_vis.visibility_specified ); |
2602 | } |
2603 | else |
2604 | { |
2605 | if (DECL_CLASS_SCOPE_P (fn)(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2605, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2605, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) |
2606 | determine_visibility_from_class (decl, DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2606, __FUNCTION__))->decl_minimal.context)); |
2607 | else if (determine_hidden_inline (fn)) |
2608 | { |
2609 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2609, __FUNCTION__))->decl_with_vis.visibility) = default_visibilityglobal_options.x_default_visibility; |
2610 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2610, __FUNCTION__))->decl_with_vis.visibility_specified ) = |
2611 | visibility_options.inpragma; |
2612 | } |
2613 | else |
2614 | { |
2615 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2615, __FUNCTION__))->decl_with_vis.visibility) = DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2615, __FUNCTION__))->decl_with_vis.visibility); |
2616 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2616, __FUNCTION__))->decl_with_vis.visibility_specified ) = |
2617 | DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2617, __FUNCTION__))->decl_with_vis.visibility_specified ); |
2618 | } |
2619 | } |
2620 | |
2621 | /* Local classes in templates have CLASSTYPE_USE_TEMPLATE set, |
2622 | but have no TEMPLATE_INFO, so don't try to check it. */ |
2623 | template_decl = NULL_TREE(tree) __null; |
2624 | } |
2625 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2625, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2625, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) |
2626 | && flag_visibility_ms_compatglobal_options.x_flag_visibility_ms_compat) |
2627 | { |
2628 | /* Under -fvisibility-ms-compat, types are visible by default, |
2629 | even though their contents aren't. */ |
2630 | tree underlying_type = TREE_TYPE (DECL_NAME (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2630, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2630, __FUNCTION__))->typed.type); |
2631 | int underlying_vis = type_visibility (underlying_type); |
2632 | if (underlying_vis == VISIBILITY_ANON |
2633 | || (CLASS_TYPE_P (underlying_type)(((((enum tree_code) (underlying_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (underlying_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((underlying_type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2633, __FUNCTION__))->type_common.lang_flag_5)) |
2634 | && CLASSTYPE_VISIBILITY_SPECIFIED (underlying_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((underlying_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2634, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2634, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2634, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2634, __FUNCTION__))->decl_with_vis.visibility_specified ))) |
2635 | constrain_visibility (decl, underlying_vis, false); |
2636 | else |
2637 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2637, __FUNCTION__))->decl_with_vis.visibility) = VISIBILITY_DEFAULT; |
2638 | } |
2639 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2639, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2639, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) |
2640 | { |
2641 | /* tinfo visibility is based on the type it's for. */ |
2642 | constrain_visibility |
2643 | (decl, type_visibility (TREE_TYPE (DECL_NAME (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2643, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2643, __FUNCTION__))->typed.type)), false); |
2644 | |
2645 | /* Give the target a chance to override the visibility associated |
2646 | with DECL. */ |
2647 | if (TREE_PUBLIC (decl)((decl)->base.public_flag) |
2648 | && !DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2648, __FUNCTION__))->decl_common.decl_flag_1) && (!((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2648, __FUNCTION__))->decl_common.lang_specific) || !((( contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2648, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern))) |
2649 | && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))(((((enum tree_code) (((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2649, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2649, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2649, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2649, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((( (contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2649, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2649, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2649, __FUNCTION__))->type_common.lang_flag_5)) |
2650 | && !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE (DECL_NAME (decl)))((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2650, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2650, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2650, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2650, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2650, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2650, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2651 | targetm.cxx.determine_class_data_visibility (decl); |
2652 | } |
2653 | else if (template_decl) |
2654 | /* Template instantiations and specializations get visibility based |
2655 | on their template unless they override it with an attribute. */; |
2656 | else if (! DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2656, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2657 | { |
2658 | if (determine_hidden_inline (decl)) |
2659 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2659, __FUNCTION__))->decl_with_vis.visibility) = VISIBILITY_HIDDEN; |
2660 | else |
2661 | { |
2662 | /* Set default visibility to whatever the user supplied with |
2663 | #pragma GCC visibility or a namespace visibility attribute. */ |
2664 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2664, __FUNCTION__))->decl_with_vis.visibility) = default_visibilityglobal_options.x_default_visibility; |
2665 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2665, __FUNCTION__))->decl_with_vis.visibility_specified ) = visibility_options.inpragma; |
2666 | } |
2667 | } |
2668 | } |
2669 | |
2670 | if (template_decl) |
2671 | { |
2672 | /* If the specialization doesn't specify visibility, use the |
2673 | visibility from the template. */ |
2674 | tree tinfo = get_template_info (template_decl); |
2675 | tree args = TI_ARGS (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2675, __FUNCTION__, (TEMPLATE_INFO))))->args; |
2676 | tree attribs = (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL |
2677 | ? TYPE_ATTRIBUTES (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2677, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2677, __FUNCTION__))->type_common.attributes) |
2678 | : DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2678, __FUNCTION__))->decl_common.attributes)); |
2679 | tree attr = lookup_attribute ("visibility", attribs); |
2680 | |
2681 | if (args != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2682 | { |
2683 | tree pattern = DECL_TEMPLATE_RESULT (TI_TEMPLATE (tinfo))((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2683, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2683, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
2684 | |
2685 | if (!DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2685, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2686 | { |
2687 | if (!attr |
2688 | && determine_hidden_inline (decl)) |
2689 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2689, __FUNCTION__))->decl_with_vis.visibility) = VISIBILITY_HIDDEN; |
2690 | else |
2691 | { |
2692 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2692, __FUNCTION__))->decl_with_vis.visibility) = DECL_VISIBILITY (pattern)((contains_struct_check ((pattern), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2692, __FUNCTION__))->decl_with_vis.visibility); |
2693 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2693, __FUNCTION__))->decl_with_vis.visibility_specified ) |
2694 | = DECL_VISIBILITY_SPECIFIED (pattern)((contains_struct_check ((pattern), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2694, __FUNCTION__))->decl_with_vis.visibility_specified ); |
2695 | } |
2696 | } |
2697 | |
2698 | if (args |
2699 | /* Template argument visibility outweighs #pragma or namespace |
2700 | visibility, but not an explicit attribute. */ |
2701 | && !attr) |
2702 | { |
2703 | int depth = TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2703, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2703, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2703, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2703, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1); |
2704 | if (DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2704, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2705 | { |
2706 | /* A class template member with explicit visibility |
2707 | overrides the class visibility, so we need to apply |
2708 | all the levels of template args directly. */ |
2709 | int i; |
2710 | for (i = 1; i <= depth; ++i) |
2711 | { |
2712 | tree lev = TMPL_ARGS_LEVEL (args, i)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2712, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2712, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2712, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*(( const_cast<tree *> (tree_vec_elt_check ((args), ((i) - 1 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2712, __FUNCTION__))))) : (args)); |
2713 | constrain_visibility_for_template (decl, lev); |
2714 | } |
2715 | } |
2716 | else if (PRIMARY_TEMPLATE_P (TI_TEMPLATE (tinfo))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2716, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2716, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2716, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2716, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2716, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))) |
2717 | /* Limit visibility based on its template arguments. */ |
2718 | constrain_visibility_for_template (decl, args); |
2719 | } |
2720 | } |
2721 | } |
2722 | |
2723 | if (class_type) |
2724 | determine_visibility_from_class (decl, class_type); |
2725 | |
2726 | if (decl_anon_ns_mem_p (decl)) |
2727 | /* Names in an anonymous namespace get internal linkage. */ |
2728 | constrain_visibility (decl, VISIBILITY_ANON, false); |
2729 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL) |
2730 | { |
2731 | /* Propagate anonymity from type to decl. */ |
2732 | int tvis = type_visibility (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2732, __FUNCTION__))->typed.type)); |
2733 | if (tvis == VISIBILITY_ANON |
2734 | || ! DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2734, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2735 | constrain_visibility (decl, tvis, false); |
2736 | } |
2737 | else if (no_linkage_check (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2737, __FUNCTION__))->typed.type), /*relaxed_p=*/true)) |
2738 | /* DR 757: A type without linkage shall not be used as the type of a |
2739 | variable or function with linkage, unless |
2740 | o the variable or function has extern "C" linkage (7.5 [dcl.link]), or |
2741 | o the variable or function is not used (3.2 [basic.def.odr]) or is |
2742 | defined in the same translation unit. |
2743 | |
2744 | Since non-extern "C" decls need to be defined in the same |
2745 | translation unit, we can make the type internal. */ |
2746 | constrain_visibility (decl, VISIBILITY_ANON, false); |
2747 | |
2748 | /* If visibility changed and DECL already has DECL_RTL, ensure |
2749 | symbol flags are updated. */ |
2750 | if ((DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2750, __FUNCTION__))->decl_with_vis.visibility) != orig_visibility |
2751 | || DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2751, __FUNCTION__))->decl_with_vis.visibility_specified ) != orig_visibility_specified) |
2752 | && ((VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_STATIC (decl)((decl)->base.static_flag)) |
2753 | || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) |
2754 | && DECL_RTL_SET_P (decl)(((tree_contains_struct[(((enum tree_code) (decl)->base.code ))][(TS_DECL_WRTL)])) && (contains_struct_check ((decl ), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2754, __FUNCTION__))->decl_with_rtl.rtl != __null)) |
2755 | make_decl_rtl (decl); |
2756 | } |
2757 | |
2758 | /* By default, static data members and function members receive |
2759 | the visibility of their containing class. */ |
2760 | |
2761 | static void |
2762 | determine_visibility_from_class (tree decl, tree class_type) |
2763 | { |
2764 | if (DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2764, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2765 | return; |
2766 | |
2767 | if (determine_hidden_inline (decl)) |
2768 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2768, __FUNCTION__))->decl_with_vis.visibility) = VISIBILITY_HIDDEN; |
2769 | else |
2770 | { |
2771 | /* Default to the class visibility. */ |
2772 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2772, __FUNCTION__))->decl_with_vis.visibility) = CLASSTYPE_VISIBILITY (class_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2772, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2772, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2772, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2772, __FUNCTION__))->decl_with_vis.visibility); |
2773 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2773, __FUNCTION__))->decl_with_vis.visibility_specified ) |
2774 | = CLASSTYPE_VISIBILITY_SPECIFIED (class_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2774, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2774, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2774, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2774, __FUNCTION__))->decl_with_vis.visibility_specified ); |
2775 | } |
2776 | |
2777 | /* Give the target a chance to override the visibility associated |
2778 | with DECL. */ |
2779 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) |
2780 | && TREE_PUBLIC (decl)((decl)->base.public_flag) |
2781 | && (DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2781, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2781, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) || DECL_VTABLE_OR_VTT_P (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2781, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2781, __FUNCTION__))->decl_common.virtual_flag)) |
2782 | && !DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2782, __FUNCTION__))->decl_common.decl_flag_1) && (!((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2782, __FUNCTION__))->decl_common.lang_specific) || !((( contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2782, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern))) |
2783 | && !CLASSTYPE_VISIBILITY_SPECIFIED (class_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2783, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2783, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2783, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2783, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2784 | targetm.cxx.determine_class_data_visibility (decl); |
2785 | } |
2786 | |
2787 | /* Returns true iff DECL is an inline that should get hidden visibility |
2788 | because of -fvisibility-inlines-hidden. */ |
2789 | |
2790 | static bool |
2791 | determine_hidden_inline (tree decl) |
2792 | { |
2793 | return (visibility_options.inlines_hidden |
2794 | /* Don't do this for inline templates; specializations might not be |
2795 | inline, and we don't want them to inherit the hidden |
2796 | visibility. We'll set it here for all inline instantiations. */ |
2797 | && !processing_template_declscope_chain->x_processing_template_decl |
2798 | && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
2799 | && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2799, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) |
2800 | && (! DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2800, __FUNCTION__))->decl_common.lang_specific) |
2801 | || ! DECL_EXPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2801, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 3))); |
2802 | } |
2803 | |
2804 | /* Constrain the visibility of a class TYPE based on the visibility of its |
2805 | field types. Warn if any fields require lesser visibility. */ |
2806 | |
2807 | void |
2808 | constrain_class_visibility (tree type) |
2809 | { |
2810 | tree binfo; |
2811 | tree t; |
2812 | int i; |
2813 | |
2814 | int vis = type_visibility (type); |
2815 | |
2816 | if (vis == VISIBILITY_ANON |
2817 | || DECL_IN_SYSTEM_HEADER (TYPE_MAIN_DECL (type))(in_system_header_at (((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2817, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2817, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2817, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2817, __FUNCTION__))->decl_minimal.locus)))) |
2818 | return; |
2819 | |
2820 | /* Don't warn about visibility if the class has explicit visibility. */ |
2821 | if (CLASSTYPE_VISIBILITY_SPECIFIED (type)((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2821, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2821, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2821, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2821, __FUNCTION__))->decl_with_vis.visibility_specified )) |
2822 | vis = VISIBILITY_INTERNAL; |
2823 | |
2824 | for (t = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2824, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); t; t = DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2824, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2824, __FUNCTION__))->common.chain))) |
2825 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FIELD_DECL && TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2825, __FUNCTION__))->typed.type) != error_mark_nodeglobal_trees[TI_ERROR_MARK] |
2826 | && !DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2826, __FUNCTION__))->decl_common.artificial_flag)) |
2827 | { |
2828 | tree ftype = strip_pointer_or_array_types (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2828, __FUNCTION__))->typed.type)); |
2829 | int subvis = type_visibility (ftype); |
2830 | |
2831 | if (subvis == VISIBILITY_ANON) |
2832 | { |
2833 | if (!in_main_input_context()) |
2834 | { |
2835 | tree nlt = no_linkage_check (ftype, /*relaxed_p=*/false); |
2836 | if (nlt) |
2837 | { |
2838 | if (same_type_p (TREE_TYPE (t), nlt)comptypes ((((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2838, __FUNCTION__))->typed.type)), (nlt), 0)) |
2839 | warning (OPT_Wsubobject_linkage, "\ |
2840 | %qT has a field %qD whose type has no linkage", |
2841 | type, t); |
2842 | else |
2843 | warning (OPT_Wsubobject_linkage, "\ |
2844 | %qT has a field %qD whose type depends on the type %qT which has no linkage", |
2845 | type, t, nlt); |
2846 | } |
2847 | else |
2848 | warning (OPT_Wsubobject_linkage, "\ |
2849 | %qT has a field %qD whose type uses the anonymous namespace", |
2850 | type, t); |
2851 | } |
2852 | } |
2853 | else if (MAYBE_CLASS_TYPE_P (ftype)((((enum tree_code) (ftype)->base.code) == TEMPLATE_TYPE_PARM || ((enum tree_code) (ftype)->base.code) == TYPENAME_TYPE || ((enum tree_code) (ftype)->base.code) == TYPEOF_TYPE || ((enum tree_code) (ftype)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (ftype)->base.code) == DECLTYPE_TYPE ) || (((((enum tree_code) (ftype)->base.code)) == RECORD_TYPE || (((enum tree_code) (ftype)->base.code)) == UNION_TYPE) && ((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2853, __FUNCTION__))->type_common.lang_flag_5))) |
2854 | && vis < VISIBILITY_HIDDEN |
2855 | && subvis >= VISIBILITY_HIDDEN) |
2856 | warning (OPT_Wattributes, "\ |
2857 | %qT declared with greater visibility than the type of its field %qD", |
2858 | type, t); |
2859 | } |
2860 | |
2861 | binfo = TYPE_BINFO (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2861, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
2862 | for (i = 0; BINFO_BASE_ITERATE (binfo, i, t)((&(tree_check ((binfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2862, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(t))); ++i) |
2863 | { |
2864 | int subvis = type_visibility (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2864, __FUNCTION__))->typed.type)); |
2865 | |
2866 | if (subvis == VISIBILITY_ANON) |
2867 | { |
2868 | if (!in_main_input_context()) |
2869 | { |
2870 | tree nlt = no_linkage_check (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2870, __FUNCTION__))->typed.type), /*relaxed_p=*/false); |
2871 | if (nlt) |
2872 | { |
2873 | if (same_type_p (TREE_TYPE (t), nlt)comptypes ((((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2873, __FUNCTION__))->typed.type)), (nlt), 0)) |
2874 | warning (OPT_Wsubobject_linkage, "\ |
2875 | %qT has a base %qT whose type has no linkage", |
2876 | type, TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2876, __FUNCTION__))->typed.type)); |
2877 | else |
2878 | warning (OPT_Wsubobject_linkage, "\ |
2879 | %qT has a base %qT whose type depends on the type %qT which has no linkage", |
2880 | type, TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2880, __FUNCTION__))->typed.type), nlt); |
2881 | } |
2882 | else |
2883 | warning (OPT_Wsubobject_linkage, "\ |
2884 | %qT has a base %qT whose type uses the anonymous namespace", |
2885 | type, TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2885, __FUNCTION__))->typed.type)); |
2886 | } |
2887 | } |
2888 | else if (vis < VISIBILITY_HIDDEN |
2889 | && subvis >= VISIBILITY_HIDDEN) |
2890 | warning (OPT_Wattributes, "\ |
2891 | %qT declared with greater visibility than its base %qT", |
2892 | type, TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2892, __FUNCTION__))->typed.type)); |
2893 | } |
2894 | } |
2895 | |
2896 | /* Functions for adjusting the visibility of a tagged type and its nested |
2897 | types and declarations when it gets a name for linkage purposes from a |
2898 | typedef. */ |
2899 | // FIXME: It is now a DR for such a class type to contain anything |
2900 | // other than C. So at minium most of this can probably be deleted. |
2901 | |
2902 | /* First reset the visibility of all the types. */ |
2903 | |
2904 | static void |
2905 | reset_type_linkage_1 (tree type) |
2906 | { |
2907 | set_linkage_according_to_type (type, TYPE_MAIN_DECL (type)((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2907, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2907, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2907, __FUNCTION__))->common.chain)))); |
2908 | if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2908, __FUNCTION__))->type_common.lang_flag_5))) |
2909 | for (tree member = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2909, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); member; member = DECL_CHAIN (member)(((contains_struct_check (((contains_struct_check ((member), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2909, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2909, __FUNCTION__))->common.chain))) |
2910 | if (DECL_IMPLICIT_TYPEDEF_P (member)(((enum tree_code) (member)->base.code) == TYPE_DECL && ((contains_struct_check ((member), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2910, __FUNCTION__))->decl_common.lang_flag_2))) |
2911 | reset_type_linkage_1 (TREE_TYPE (member)((contains_struct_check ((member), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2911, __FUNCTION__))->typed.type)); |
2912 | } |
2913 | |
2914 | /* Then reset the visibility of any static data members or member |
2915 | functions that use those types. */ |
2916 | |
2917 | static void |
2918 | reset_decl_linkage (tree decl) |
2919 | { |
2920 | if (TREE_PUBLIC (decl)((decl)->base.public_flag)) |
2921 | return; |
2922 | if (DECL_CLONED_FUNCTION_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2922, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) |
2923 | return; |
2924 | TREE_PUBLIC (decl)((decl)->base.public_flag) = true; |
2925 | DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2925, __FUNCTION__))->decl_common.lang_flag_5) = false; |
2926 | determine_visibility (decl); |
2927 | tentative_decl_linkage (decl); |
2928 | } |
2929 | |
2930 | void |
2931 | reset_type_linkage (tree type) |
2932 | { |
2933 | reset_type_linkage_1 (type); |
2934 | if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2934, __FUNCTION__))->type_common.lang_flag_5))) |
2935 | { |
2936 | if (tree vt = CLASSTYPE_VTABLES (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2936, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables)) |
2937 | { |
2938 | tree name = mangle_vtbl_for_type (type); |
2939 | DECL_NAME (vt)((contains_struct_check ((vt), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2939, __FUNCTION__))->decl_minimal.name) = name; |
2940 | SET_DECL_ASSEMBLER_NAME (vt, name)overwrite_decl_assembler_name (vt, name); |
2941 | reset_decl_linkage (vt); |
2942 | } |
2943 | if (tree ti = CLASSTYPE_TYPEINFO_VAR (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2943, __FUNCTION__))->type_with_lang_specific.lang_specific ))->typeinfo_var)) |
2944 | { |
2945 | tree name = mangle_typeinfo_for_type (type); |
2946 | DECL_NAME (ti)((contains_struct_check ((ti), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2946, __FUNCTION__))->decl_minimal.name) = name; |
2947 | SET_DECL_ASSEMBLER_NAME (ti, name)overwrite_decl_assembler_name (ti, name); |
2948 | TREE_TYPE (name)((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2948, __FUNCTION__))->typed.type) = type; |
2949 | reset_decl_linkage (ti); |
2950 | } |
2951 | for (tree m = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2951, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); m; m = DECL_CHAIN (m)(((contains_struct_check (((contains_struct_check ((m), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2951, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2951, __FUNCTION__))->common.chain))) |
2952 | { |
2953 | tree mem = STRIP_TEMPLATE (m)(((enum tree_code) (m)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((m), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2953, __FUNCTION__, (TEMPLATE_DECL))))))))->result : m); |
2954 | if (TREE_CODE (mem)((enum tree_code) (mem)->base.code) == VAR_DECL || TREE_CODE (mem)((enum tree_code) (mem)->base.code) == FUNCTION_DECL) |
2955 | reset_decl_linkage (mem); |
2956 | else if (DECL_IMPLICIT_TYPEDEF_P (mem)(((enum tree_code) (mem)->base.code) == TYPE_DECL && ((contains_struct_check ((mem), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2956, __FUNCTION__))->decl_common.lang_flag_2))) |
2957 | reset_type_linkage (TREE_TYPE (mem)((contains_struct_check ((mem), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2957, __FUNCTION__))->typed.type)); |
2958 | } |
2959 | } |
2960 | } |
2961 | |
2962 | /* Set up our initial idea of what the linkage of DECL should be. */ |
2963 | |
2964 | void |
2965 | tentative_decl_linkage (tree decl) |
2966 | { |
2967 | if (DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2967, __FUNCTION__))->decl_common.lang_flag_5)) |
2968 | /* We've already made a decision as to how this function will |
2969 | be handled. */; |
2970 | else if (vague_linkage_p (decl)) |
2971 | { |
2972 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
2973 | && decl_defined_p (decl)) |
2974 | { |
2975 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2975, __FUNCTION__))->decl_common.decl_flag_1) = 1; |
2976 | DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2976, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 1; |
2977 | note_vague_linkage_fn (decl); |
2978 | /* A non-template inline function with external linkage will |
2979 | always be COMDAT. As we must eventually determine the |
2980 | linkage of all functions, and as that causes writes to |
2981 | the data mapped in from the PCH file, it's advantageous |
2982 | to mark the functions at this point. */ |
2983 | if (DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2983, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) |
2984 | && (!DECL_IMPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2984, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 1) |
2985 | || DECL_DEFAULTED_FN (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2985, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2985, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2985, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2985, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2985, __FUNCTION__); <->u.fn; })->defaulted_p))) |
2986 | { |
2987 | /* This function must have external linkage, as |
2988 | otherwise DECL_INTERFACE_KNOWN would have been |
2989 | set. */ |
2990 | gcc_assert (TREE_PUBLIC (decl))((void)(!(((decl)->base.public_flag)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2990, __FUNCTION__), 0 : 0)); |
2991 | comdat_linkage (decl); |
2992 | DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 2992, __FUNCTION__))->decl_common.lang_flag_5) = 1; |
2993 | } |
2994 | } |
2995 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
2996 | maybe_commonize_var (decl); |
2997 | } |
2998 | } |
2999 | |
3000 | /* DECL is a FUNCTION_DECL or VAR_DECL. If the object file linkage |
3001 | for DECL has not already been determined, do so now by setting |
3002 | DECL_EXTERNAL, DECL_COMDAT and other related flags. Until this |
3003 | function is called entities with vague linkage whose definitions |
3004 | are available must have TREE_PUBLIC set. |
3005 | |
3006 | If this function decides to place DECL in COMDAT, it will set |
3007 | appropriate flags -- but will not clear DECL_EXTERNAL. It is up to |
3008 | the caller to decide whether or not to clear DECL_EXTERNAL. Some |
3009 | callers defer that decision until it is clear that DECL is actually |
3010 | required. */ |
3011 | |
3012 | void |
3013 | import_export_decl (tree decl) |
3014 | { |
3015 | bool comdat_p; |
3016 | bool import_p; |
3017 | tree class_type = NULL_TREE(tree) __null; |
3018 | |
3019 | if (DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3019, __FUNCTION__))->decl_common.lang_flag_5)) |
3020 | return; |
3021 | |
3022 | /* We cannot determine what linkage to give to an entity with vague |
3023 | linkage until the end of the file. For example, a virtual table |
3024 | for a class will be defined if and only if the key method is |
3025 | defined in this translation unit. */ |
3026 | gcc_assert (at_eof)((void)(!(at_eof) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3026, __FUNCTION__), 0 : 0)); |
3027 | /* Object file linkage for explicit instantiations is handled in |
3028 | mark_decl_instantiated. For static variables in functions with |
3029 | vague linkage, maybe_commonize_var is used. |
3030 | |
3031 | Therefore, the only declarations that should be provided to this |
3032 | function are those with external linkage that are: |
3033 | |
3034 | * implicit instantiations of function templates |
3035 | |
3036 | * inline function |
3037 | |
3038 | * implicit instantiations of static data members of class |
3039 | templates |
3040 | |
3041 | * virtual tables |
3042 | |
3043 | * typeinfo objects |
3044 | |
3045 | Furthermore, all entities that reach this point must have a |
3046 | definition available in this translation unit. |
3047 | |
3048 | The following assertions check these conditions. */ |
3049 | gcc_assert (VAR_OR_FUNCTION_DECL_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum tree_code) (decl)->base.code) == FUNCTION_DECL) ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3049, __FUNCTION__), 0 : 0)); |
3050 | /* Any code that creates entities with TREE_PUBLIC cleared should |
3051 | also set DECL_INTERFACE_KNOWN. */ |
3052 | gcc_assert (TREE_PUBLIC (decl))((void)(!(((decl)->base.public_flag)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3052, __FUNCTION__), 0 : 0)); |
3053 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) |
3054 | gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3054, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 1) || (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific) && (((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) && !(((contains_struct_check ((decl ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template)) || ((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3056, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag )) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3056, __FUNCTION__), 0 : 0)) |
3055 | || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3054, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 1) || (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific) && (((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) && !(((contains_struct_check ((decl ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template)) || ((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3056, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag )) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3056, __FUNCTION__), 0 : 0)) |
3056 | || DECL_DECLARED_INLINE_P (decl))((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3054, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 1) || (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific) && (((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) && !(((contains_struct_check ((decl ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3055, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template)) || ((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3056, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag )) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3056, __FUNCTION__), 0 : 0)); |
3057 | else |
3058 | gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3058, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 1) || ((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3059, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3059, __FUNCTION__))->decl_common.virtual_flag) || ((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__), 0 : 0)) |
3059 | || DECL_VTABLE_OR_VTT_P (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3058, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 1) || ((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3059, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3059, __FUNCTION__))->decl_common.virtual_flag) || ((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__), 0 : 0)) |
3060 | || DECL_TINFO_P (decl))((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3058, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 1) || ((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3059, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3059, __FUNCTION__))->decl_common.virtual_flag) || ((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3060, __FUNCTION__), 0 : 0)); |
3061 | /* Check that a definition of DECL is available in this translation |
3062 | unit. */ |
3063 | gcc_assert (!DECL_REALLY_EXTERN (decl))((void)(!(!(((contains_struct_check ((decl), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3063, __FUNCTION__))->decl_common.decl_flag_1) && (!((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3063, __FUNCTION__))->decl_common.lang_specific) || !((( contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3063, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3063, __FUNCTION__), 0 : 0)); |
3064 | |
3065 | /* Assume that DECL will not have COMDAT linkage. */ |
3066 | comdat_p = false; |
3067 | /* Assume that DECL will not be imported into this translation |
3068 | unit. */ |
3069 | import_p = false; |
3070 | |
3071 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_VTABLE_OR_VTT_P (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3071, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3071, __FUNCTION__))->decl_common.virtual_flag)) |
3072 | { |
3073 | class_type = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3073, __FUNCTION__))->decl_minimal.context); |
3074 | import_export_class (class_type); |
3075 | if (CLASSTYPE_INTERFACE_KNOWN (class_type)((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3075, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_unknown == 0) |
3076 | && CLASSTYPE_INTERFACE_ONLY (class_type)((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3076, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_only)) |
3077 | import_p = true; |
3078 | else if ((!flag_weakglobal_options.x_flag_weak || TARGET_WEAK_NOT_IN_ARCHIVE_TOC0) |
3079 | && !CLASSTYPE_USE_TEMPLATE (class_type)((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3079, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) |
3080 | && CLASSTYPE_KEY_METHOD (class_type)((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3080, __FUNCTION__))->type_with_lang_specific.lang_specific ))->key_method) |
3081 | && !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))((tree_check ((((((tree_class_check ((class_type), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3081, __FUNCTION__))->type_with_lang_specific.lang_specific ))->key_method)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3081, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag )) |
3082 | /* The ABI requires that all virtual tables be emitted with |
3083 | COMDAT linkage. However, on systems where COMDAT symbols |
3084 | don't show up in the table of contents for a static |
3085 | archive, or on systems without weak symbols (where we |
3086 | approximate COMDAT linkage by using internal linkage), the |
3087 | linker will report errors about undefined symbols because |
3088 | it will not see the virtual table definition. Therefore, |
3089 | in the case that we know that the virtual table will be |
3090 | emitted in only one translation unit, we make the virtual |
3091 | table an ordinary definition with external linkage. */ |
3092 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3092, __FUNCTION__))->decl_common.decl_flag_1) = 0; |
3093 | else if (CLASSTYPE_INTERFACE_KNOWN (class_type)((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3093, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_unknown == 0)) |
3094 | { |
3095 | /* CLASS_TYPE is being exported from this translation unit, |
3096 | so DECL should be defined here. */ |
3097 | if (!flag_weakglobal_options.x_flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type)(((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3097, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 3)) |
3098 | /* If a class is declared in a header with the "extern |
3099 | template" extension, then it will not be instantiated, |
3100 | even in translation units that would normally require |
3101 | it. Often such classes are explicitly instantiated in |
3102 | one translation unit. Therefore, the explicit |
3103 | instantiation must be made visible to other translation |
3104 | units. */ |
3105 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3105, __FUNCTION__))->decl_common.decl_flag_1) = 0; |
3106 | else |
3107 | { |
3108 | /* The generic C++ ABI says that class data is always |
3109 | COMDAT, even if there is a key function. Some |
3110 | variants (e.g., the ARM EABI) says that class data |
3111 | only has COMDAT linkage if the class data might be |
3112 | emitted in more than one translation unit. When the |
3113 | key method can be inline and is inline, we still have |
3114 | to arrange for comdat even though |
3115 | class_data_always_comdat is false. */ |
3116 | if (!CLASSTYPE_KEY_METHOD (class_type)((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3116, __FUNCTION__))->type_with_lang_specific.lang_specific ))->key_method) |
3117 | || DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))((tree_check ((((((tree_class_check ((class_type), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3117, __FUNCTION__))->type_with_lang_specific.lang_specific ))->key_method)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3117, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) |
3118 | || targetm.cxx.class_data_always_comdat ()) |
3119 | { |
3120 | /* The ABI requires COMDAT linkage. Normally, we |
3121 | only emit COMDAT things when they are needed; |
3122 | make sure that we realize that this entity is |
3123 | indeed needed. */ |
3124 | comdat_p = true; |
3125 | mark_needed (decl); |
3126 | } |
3127 | } |
3128 | } |
3129 | else if (!flag_implicit_templatesglobal_options.x_flag_implicit_templates |
3130 | && CLASSTYPE_IMPLICIT_INSTANTIATION (class_type)(((((tree_class_check ((class_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3130, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 1)) |
3131 | import_p = true; |
3132 | else |
3133 | comdat_p = true; |
3134 | } |
3135 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3135, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3135, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) |
3136 | { |
3137 | tree type = TREE_TYPE (DECL_NAME (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3137, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3137, __FUNCTION__))->typed.type); |
3138 | if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3138, __FUNCTION__))->type_common.lang_flag_5))) |
3139 | { |
3140 | class_type = type; |
3141 | import_export_class (type); |
3142 | if (CLASSTYPE_INTERFACE_KNOWN (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3142, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_unknown == 0) |
3143 | && TYPE_POLYMORPHIC_P (type)(((tree_not_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3143, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) |
3144 | && CLASSTYPE_INTERFACE_ONLY (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3144, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_only) |
3145 | /* If -fno-rtti was specified, then we cannot be sure |
3146 | that RTTI information will be emitted with the |
3147 | virtual table of the class, so we must emit it |
3148 | wherever it is used. */ |
3149 | && flag_rttiglobal_options.x_flag_rtti) |
3150 | import_p = true; |
3151 | else |
3152 | { |
3153 | if (CLASSTYPE_INTERFACE_KNOWN (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3153, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_unknown == 0) |
3154 | && !CLASSTYPE_INTERFACE_ONLY (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3154, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_only)) |
3155 | { |
3156 | comdat_p = (targetm.cxx.class_data_always_comdat () |
3157 | || (CLASSTYPE_KEY_METHOD (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3157, __FUNCTION__))->type_with_lang_specific.lang_specific ))->key_method) |
3158 | && DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type))((tree_check ((((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3158, __FUNCTION__))->type_with_lang_specific.lang_specific ))->key_method)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3158, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ))); |
3159 | mark_needed (decl); |
3160 | if (!flag_weakglobal_options.x_flag_weak) |
3161 | { |
3162 | comdat_p = false; |
3163 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3163, __FUNCTION__))->decl_common.decl_flag_1) = 0; |
3164 | } |
3165 | } |
3166 | else |
3167 | comdat_p = true; |
3168 | } |
3169 | } |
3170 | else |
3171 | comdat_p = true; |
3172 | } |
3173 | else if (DECL_TEMPLOID_INSTANTIATION (decl)(((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3173, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) & 1) || (((contains_struct_check ((decl), ( TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3173, __FUNCTION__))->decl_common.lang_specific) && (((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3173, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3173, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) && !(((contains_struct_check ((decl ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3173, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template)))) |
3174 | { |
3175 | /* DECL is an implicit instantiation of a function or static |
3176 | data member. */ |
3177 | if (flag_implicit_templatesglobal_options.x_flag_implicit_templates |
3178 | || (flag_implicit_inline_templatesglobal_options.x_flag_implicit_inline_templates |
3179 | && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
3180 | && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3180, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ))) |
3181 | comdat_p = true; |
3182 | else |
3183 | /* If we are not implicitly generating templates, then mark |
3184 | this entity as undefined in this translation unit. */ |
3185 | import_p = true; |
3186 | } |
3187 | else if (DECL_FUNCTION_MEMBER_P (decl)((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3187, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE ) || (__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3187, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3187, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3187, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3187, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3187, __FUNCTION__); <->u.fn; })->static_function ))) |
3188 | { |
3189 | if (!DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3189, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag )) |
3190 | { |
3191 | tree ctype = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3191, __FUNCTION__))->decl_minimal.context); |
3192 | import_export_class (ctype); |
3193 | if (CLASSTYPE_INTERFACE_KNOWN (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3193, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_unknown == 0)) |
3194 | { |
3195 | DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3195, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) |
3196 | = ! (CLASSTYPE_INTERFACE_ONLY (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3196, __FUNCTION__))->type_with_lang_specific.lang_specific ))->interface_only) |
3197 | || (DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3197, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) |
3198 | && ! flag_implement_inlinesglobal_options.x_flag_implement_inlines |
3199 | && !DECL_VINDEX (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3199, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex ))); |
3200 | |
3201 | if (!DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3201, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern)) |
3202 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3202, __FUNCTION__))->decl_common.decl_flag_1) = 1; |
3203 | |
3204 | /* Always make artificials weak. */ |
3205 | if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3205, __FUNCTION__))->decl_common.artificial_flag) && flag_weakglobal_options.x_flag_weak) |
3206 | comdat_p = true; |
3207 | else |
3208 | maybe_make_one_only (decl); |
3209 | } |
3210 | } |
3211 | else |
3212 | comdat_p = true; |
3213 | } |
3214 | else |
3215 | comdat_p = true; |
3216 | |
3217 | if (import_p) |
3218 | { |
3219 | /* If we are importing DECL into this translation unit, mark is |
3220 | an undefined here. */ |
3221 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3221, __FUNCTION__))->decl_common.decl_flag_1) = 1; |
3222 | DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3222, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 0; |
3223 | } |
3224 | else if (comdat_p) |
3225 | { |
3226 | /* If we decided to put DECL in COMDAT, mark it accordingly at |
3227 | this point. */ |
3228 | comdat_linkage (decl); |
3229 | } |
3230 | |
3231 | DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3231, __FUNCTION__))->decl_common.lang_flag_5) = 1; |
3232 | } |
3233 | |
3234 | /* Return an expression that performs the destruction of DECL, which |
3235 | must be a VAR_DECL whose type has a non-trivial destructor, or is |
3236 | an array whose (innermost) elements have a non-trivial destructor. */ |
3237 | |
3238 | tree |
3239 | build_cleanup (tree decl) |
3240 | { |
3241 | tree clean = cxx_maybe_build_cleanup (decl, tf_warning_or_error); |
3242 | gcc_assert (clean != NULL_TREE)((void)(!(clean != (tree) __null) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3242, __FUNCTION__), 0 : 0)); |
3243 | return clean; |
3244 | } |
3245 | |
3246 | /* GUARD is a helper variable for DECL; make them have the same linkage and |
3247 | visibility. */ |
3248 | |
3249 | void |
3250 | copy_linkage (tree guard, tree decl) |
3251 | { |
3252 | TREE_PUBLIC (guard)((guard)->base.public_flag) = TREE_PUBLIC (decl)((decl)->base.public_flag); |
3253 | TREE_STATIC (guard)((guard)->base.static_flag) = TREE_STATIC (decl)((decl)->base.static_flag); |
3254 | DECL_COMMON (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3254, __FUNCTION__))->decl_with_vis.common_flag) = DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3254, __FUNCTION__))->decl_with_vis.common_flag); |
3255 | DECL_COMDAT (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3255, __FUNCTION__))->decl_with_vis.comdat_flag) = DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3255, __FUNCTION__))->decl_with_vis.comdat_flag); |
3256 | if (TREE_STATIC (guard)((guard)->base.static_flag)) |
3257 | { |
3258 | CP_DECL_THREAD_LOCAL_P (guard)(((tree_not_check2 (((tree_check ((guard), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3258, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3258, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) = CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3258, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3258, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)); |
3259 | set_decl_tls_model (guard, DECL_TLS_MODEL (decl)decl_tls_model (decl)); |
3260 | if (DECL_ONE_ONLY (decl)(decl_comdat_group (decl) != (tree) __null && (((decl )->base.public_flag) || ((contains_struct_check ((decl), ( TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3260, __FUNCTION__))->decl_common.decl_flag_1)))) |
3261 | make_decl_one_only (guard, cxx_comdat_group (guard)); |
3262 | if (TREE_PUBLIC (decl)((decl)->base.public_flag)) |
3263 | DECL_WEAK (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3263, __FUNCTION__))->decl_with_vis.weak_flag) = DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3263, __FUNCTION__))->decl_with_vis.weak_flag); |
3264 | /* Also check vague_linkage_p, as DECL_WEAK and DECL_ONE_ONLY might not |
3265 | be set until import_export_decl at EOF. */ |
3266 | if (vague_linkage_p (decl)) |
3267 | comdat_linkage (guard); |
3268 | DECL_VISIBILITY (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3268, __FUNCTION__))->decl_with_vis.visibility) = DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3268, __FUNCTION__))->decl_with_vis.visibility); |
3269 | DECL_VISIBILITY_SPECIFIED (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3269, __FUNCTION__))->decl_with_vis.visibility_specified ) = DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3269, __FUNCTION__))->decl_with_vis.visibility_specified ); |
3270 | } |
3271 | } |
3272 | |
3273 | /* Returns the initialization guard variable for the variable DECL, |
3274 | which has static storage duration. */ |
3275 | |
3276 | tree |
3277 | get_guard (tree decl) |
3278 | { |
3279 | tree sname = mangle_guard_variable (decl); |
3280 | tree guard = get_global_binding (sname); |
3281 | if (! guard) |
3282 | { |
3283 | tree guard_type; |
3284 | |
3285 | /* We use a type that is big enough to contain a mutex as well |
3286 | as an integer counter. */ |
3287 | guard_type = targetm.cxx.guard_type (); |
3288 | guard = build_decl (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3288, __FUNCTION__))->decl_minimal.locus), |
3289 | VAR_DECL, sname, guard_type); |
3290 | |
3291 | /* The guard should have the same linkage as what it guards. */ |
3292 | copy_linkage (guard, decl); |
3293 | |
3294 | DECL_ARTIFICIAL (guard)((contains_struct_check ((guard), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3294, __FUNCTION__))->decl_common.artificial_flag) = 1; |
3295 | DECL_IGNORED_P (guard)((contains_struct_check ((guard), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3295, __FUNCTION__))->decl_common.ignored_flag) = 1; |
3296 | TREE_USED (guard)((guard)->base.used_flag) = 1; |
3297 | pushdecl_top_level_and_finish (guard, NULL_TREE(tree) __null); |
3298 | } |
3299 | return guard; |
3300 | } |
3301 | |
3302 | /* Returns true if accessing the GUARD atomic is expensive, |
3303 | i.e. involves a call to __sync_synchronize or similar. |
3304 | In this case let __cxa_guard_acquire handle the atomics. */ |
3305 | |
3306 | static bool |
3307 | is_atomic_expensive_p (machine_mode mode) |
3308 | { |
3309 | if (!flag_inline_atomicsglobal_options.x_flag_inline_atomics) |
3310 | return true; |
3311 | |
3312 | if (!can_compare_and_swap_p (mode, false) || !can_atomic_load_p (mode)) |
3313 | return true; |
3314 | |
3315 | return false; |
3316 | } |
3317 | |
3318 | /* Return an atomic load of src with the appropriate memory model. */ |
3319 | |
3320 | static tree |
3321 | build_atomic_load_type (tree src, HOST_WIDE_INTlong model, tree type) |
3322 | { |
3323 | tree ptr_type = build_pointer_type (type); |
3324 | tree mem_model = build_int_cst (integer_type_nodeinteger_types[itk_int], model); |
3325 | tree t, addr, val; |
3326 | unsigned int size; |
3327 | int fncode; |
3328 | |
3329 | size = tree_to_uhwi (TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3329, __FUNCTION__))->type_common.size_unit)); |
3330 | |
3331 | fncode = BUILT_IN_ATOMIC_LOAD_N + exact_log2 (size) + 1; |
3332 | t = builtin_decl_implicit ((enum built_in_function) fncode); |
3333 | |
3334 | addr = build1 (ADDR_EXPR, ptr_type, src); |
3335 | val = build_call_expr (t, 2, addr, mem_model); |
3336 | return val; |
3337 | } |
3338 | |
3339 | /* Return those bits of the GUARD variable that should be set when the |
3340 | guarded entity is actually initialized. */ |
3341 | |
3342 | static tree |
3343 | get_guard_bits (tree guard) |
3344 | { |
3345 | if (!targetm.cxx.guard_mask_bit ()) |
3346 | { |
3347 | /* We only set the first byte of the guard, in order to leave room |
3348 | for a mutex in the high-order bits. */ |
3349 | guard = build1 (ADDR_EXPR, |
3350 | build_pointer_type (TREE_TYPE (guard)((contains_struct_check ((guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3350, __FUNCTION__))->typed.type)), |
3351 | guard); |
3352 | guard = build1 (NOP_EXPR, |
3353 | build_pointer_type (char_type_nodeinteger_types[itk_char]), |
3354 | guard); |
3355 | guard = build1 (INDIRECT_REF, char_type_nodeinteger_types[itk_char], guard); |
3356 | } |
3357 | |
3358 | return guard; |
3359 | } |
3360 | |
3361 | /* Return an expression which determines whether or not the GUARD |
3362 | variable has already been initialized. */ |
3363 | |
3364 | tree |
3365 | get_guard_cond (tree guard, bool thread_safe) |
3366 | { |
3367 | tree guard_value; |
3368 | |
3369 | if (!thread_safe) |
3370 | guard = get_guard_bits (guard); |
3371 | else |
3372 | { |
3373 | tree type = targetm.cxx.guard_mask_bit () |
3374 | ? TREE_TYPE (guard)((contains_struct_check ((guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3374, __FUNCTION__))->typed.type) : char_type_nodeinteger_types[itk_char]; |
3375 | |
3376 | if (is_atomic_expensive_p (TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3376, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (type) : (type)->type_common.mode))) |
3377 | guard = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
3378 | else |
3379 | guard = build_atomic_load_type (guard, MEMMODEL_ACQUIRE, type); |
3380 | } |
3381 | |
3382 | /* Mask off all but the low bit. */ |
3383 | if (targetm.cxx.guard_mask_bit ()) |
3384 | { |
3385 | guard_value = integer_one_nodeglobal_trees[TI_INTEGER_ONE]; |
3386 | if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))comptypes ((((contains_struct_check ((guard_value), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3386, __FUNCTION__))->typed.type)), (((contains_struct_check ((guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3386, __FUNCTION__))->typed.type)), 0)) |
3387 | guard_value = fold_convert (TREE_TYPE (guard), guard_value)fold_convert_loc (((location_t) 0), ((contains_struct_check ( (guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3387, __FUNCTION__))->typed.type), guard_value); |
3388 | guard = cp_build_binary_op (input_location, |
3389 | BIT_AND_EXPR, guard, guard_value, |
3390 | tf_warning_or_error); |
3391 | } |
3392 | |
3393 | guard_value = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
3394 | if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))comptypes ((((contains_struct_check ((guard_value), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3394, __FUNCTION__))->typed.type)), (((contains_struct_check ((guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3394, __FUNCTION__))->typed.type)), 0)) |
3395 | guard_value = fold_convert (TREE_TYPE (guard), guard_value)fold_convert_loc (((location_t) 0), ((contains_struct_check ( (guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3395, __FUNCTION__))->typed.type), guard_value); |
3396 | return cp_build_binary_op (input_location, |
3397 | EQ_EXPR, guard, guard_value, |
3398 | tf_warning_or_error); |
3399 | } |
3400 | |
3401 | /* Return an expression which sets the GUARD variable, indicating that |
3402 | the variable being guarded has been initialized. */ |
3403 | |
3404 | tree |
3405 | set_guard (tree guard) |
3406 | { |
3407 | tree guard_init; |
3408 | |
3409 | /* Set the GUARD to one. */ |
3410 | guard = get_guard_bits (guard); |
3411 | guard_init = integer_one_nodeglobal_trees[TI_INTEGER_ONE]; |
3412 | if (!same_type_p (TREE_TYPE (guard_init), TREE_TYPE (guard))comptypes ((((contains_struct_check ((guard_init), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3412, __FUNCTION__))->typed.type)), (((contains_struct_check ((guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3412, __FUNCTION__))->typed.type)), 0)) |
3413 | guard_init = fold_convert (TREE_TYPE (guard), guard_init)fold_convert_loc (((location_t) 0), ((contains_struct_check ( (guard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3413, __FUNCTION__))->typed.type), guard_init); |
3414 | return cp_build_modify_expr (input_location, guard, NOP_EXPR, guard_init, |
3415 | tf_warning_or_error); |
3416 | } |
3417 | |
3418 | /* Returns true iff we can tell that VAR does not have a dynamic |
3419 | initializer. */ |
3420 | |
3421 | static bool |
3422 | var_defined_without_dynamic_init (tree var) |
3423 | { |
3424 | /* If it's defined in another TU, we can't tell. */ |
3425 | if (DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3425, __FUNCTION__))->decl_common.decl_flag_1)) |
3426 | return false; |
3427 | /* If it has a non-trivial destructor, registering the destructor |
3428 | counts as dynamic initialization. */ |
3429 | if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (var))(((tree_class_check ((((contains_struct_check ((var), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3429, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3429, __FUNCTION__))->type_common.lang_flag_4))) |
3430 | return false; |
3431 | /* If it's in this TU, its initializer has been processed, unless |
3432 | it's a case of self-initialization, then DECL_INITIALIZED_P is |
3433 | false while the initializer is handled by finish_id_expression. */ |
3434 | if (!DECL_INITIALIZED_P (var)(((tree_not_check2 (((tree_check ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3434, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3434, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1))) |
3435 | return false; |
3436 | /* If it has no initializer or a constant one, it's not dynamic. */ |
3437 | return (!DECL_NONTRIVIALLY_INITIALIZED_P (var)(((tree_not_check2 (((tree_check ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3437, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3437, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_6)) |
3438 | || DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (var)(((tree_not_check2 (((tree_check ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3438, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3438, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2))); |
3439 | } |
3440 | |
3441 | /* Returns true iff VAR is a variable that needs uses to be |
3442 | wrapped for possible dynamic initialization. */ |
3443 | |
3444 | static bool |
3445 | var_needs_tls_wrapper (tree var) |
3446 | { |
3447 | return (!error_operand_p (var)((var) == global_trees[TI_ERROR_MARK] || ((var) && (( contains_struct_check (((var)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3447, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ])) |
3448 | && CP_DECL_THREAD_LOCAL_P (var)(((tree_not_check2 (((tree_check ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3448, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3448, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) |
3449 | && !DECL_GNU_TLS_P (var)(((contains_struct_check (((tree_check ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3449, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3449, __FUNCTION__))->decl_common.lang_specific) && ((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3449, __FUNCTION__))->decl_common.lang_specific)->u.base .friend_or_tls) |
3450 | && !DECL_FUNCTION_SCOPE_P (var)(((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3450, __FUNCTION__))->decl_minimal.context) && ( (enum tree_code) (((contains_struct_check ((var), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3450, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL) |
3451 | && !var_defined_without_dynamic_init (var)); |
3452 | } |
3453 | |
3454 | /* Get the FUNCTION_DECL for the shared TLS init function for this |
3455 | translation unit. */ |
3456 | |
3457 | static tree |
3458 | get_local_tls_init_fn (location_t loc) |
3459 | { |
3460 | tree sname = get_identifier ("__tls_init")(__builtin_constant_p ("__tls_init") ? get_identifier_with_length (("__tls_init"), strlen ("__tls_init")) : get_identifier ("__tls_init" )); |
3461 | tree fn = get_global_binding (sname); |
3462 | if (!fn) |
3463 | { |
3464 | fn = build_lang_decl_loc (loc, FUNCTION_DECL, sname, |
3465 | build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE], |
3466 | void_list_nodeglobal_trees[TI_VOID_LIST_NODE])); |
3467 | SET_DECL_LANGUAGE (fn, lang_c)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3467, __FUNCTION__))->decl_common.lang_specific)->u.base .language = (lang_c)); |
3468 | TREE_PUBLIC (fn)((fn)->base.public_flag) = false; |
3469 | DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3469, __FUNCTION__))->decl_common.artificial_flag) = true; |
3470 | mark_used (fn); |
3471 | set_global_binding (fn); |
3472 | } |
3473 | return fn; |
3474 | } |
3475 | |
3476 | /* Get a FUNCTION_DECL for the init function for the thread_local |
3477 | variable VAR. The init function will be an alias to the function |
3478 | that initializes all the non-local TLS variables in the translation |
3479 | unit. The init function is only used by the wrapper function. */ |
3480 | |
3481 | static tree |
3482 | get_tls_init_fn (tree var) |
3483 | { |
3484 | /* Only C++11 TLS vars need this init fn. */ |
3485 | if (!var_needs_tls_wrapper (var)) |
3486 | return NULL_TREE(tree) __null; |
3487 | |
3488 | /* If -fno-extern-tls-init, assume that we don't need to call |
3489 | a tls init function for a variable defined in another TU. */ |
3490 | if (!flag_extern_tls_initglobal_options.x_flag_extern_tls_init && DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3490, __FUNCTION__))->decl_common.decl_flag_1)) |
3491 | return NULL_TREE(tree) __null; |
3492 | |
3493 | /* If the variable is internal, or if we can't generate aliases, |
3494 | call the local init function directly. */ |
3495 | if (!TREE_PUBLIC (var)((var)->base.public_flag) || !TARGET_SUPPORTS_ALIASES1) |
3496 | return get_local_tls_init_fn (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3496, __FUNCTION__))->decl_minimal.locus)); |
3497 | |
3498 | tree sname = mangle_tls_init_fn (var); |
3499 | tree fn = get_global_binding (sname); |
3500 | if (!fn) |
3501 | { |
3502 | fn = build_lang_decl (FUNCTION_DECL, sname, |
3503 | build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE], |
3504 | void_list_nodeglobal_trees[TI_VOID_LIST_NODE])); |
3505 | SET_DECL_LANGUAGE (fn, lang_c)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3505, __FUNCTION__))->decl_common.lang_specific)->u.base .language = (lang_c)); |
3506 | TREE_PUBLIC (fn)((fn)->base.public_flag) = TREE_PUBLIC (var)((var)->base.public_flag); |
3507 | DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3507, __FUNCTION__))->decl_common.artificial_flag) = true; |
3508 | DECL_COMDAT (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3508, __FUNCTION__))->decl_with_vis.comdat_flag) = DECL_COMDAT (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3508, __FUNCTION__))->decl_with_vis.comdat_flag); |
3509 | DECL_EXTERNAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3509, __FUNCTION__))->decl_common.decl_flag_1) = DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3509, __FUNCTION__))->decl_common.decl_flag_1); |
3510 | if (DECL_ONE_ONLY (var)(decl_comdat_group (var) != (tree) __null && (((var)-> base.public_flag) || ((contains_struct_check ((var), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3510, __FUNCTION__))->decl_common.decl_flag_1)))) |
3511 | make_decl_one_only (fn, cxx_comdat_group (fn)); |
3512 | if (TREE_PUBLIC (var)((var)->base.public_flag)) |
3513 | { |
3514 | tree obtype = strip_array_types (non_reference (TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3514, __FUNCTION__))->typed.type))); |
3515 | /* If the variable is defined somewhere else and might have static |
3516 | initialization, make the init function a weak reference. */ |
3517 | if ((!TYPE_NEEDS_CONSTRUCTING (obtype)((tree_class_check ((obtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3517, __FUNCTION__))->type_common.needs_constructing_flag ) |
3518 | || TYPE_HAS_CONSTEXPR_CTOR (obtype)((((tree_class_check ((obtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3518, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_constexpr_ctor) |
3519 | || TYPE_HAS_TRIVIAL_DFLT (obtype)(((((tree_class_check ((obtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3519, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_default_ctor) && ! ((((tree_class_check (( obtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3519, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt))) |
3520 | && TYPE_HAS_TRIVIAL_DESTRUCTOR (obtype)(!(((tree_class_check ((obtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3520, __FUNCTION__))->type_common.lang_flag_4))) |
3521 | && DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3521, __FUNCTION__))->decl_common.decl_flag_1)) |
3522 | declare_weak (fn); |
3523 | else |
3524 | DECL_WEAK (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3524, __FUNCTION__))->decl_with_vis.weak_flag) = DECL_WEAK (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3524, __FUNCTION__))->decl_with_vis.weak_flag); |
3525 | } |
3526 | DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3526, __FUNCTION__))->decl_with_vis.visibility) = DECL_VISIBILITY (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3526, __FUNCTION__))->decl_with_vis.visibility); |
3527 | DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3527, __FUNCTION__))->decl_with_vis.visibility_specified ) = DECL_VISIBILITY_SPECIFIED (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3527, __FUNCTION__))->decl_with_vis.visibility_specified ); |
3528 | DECL_DLLIMPORT_P (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3528, __FUNCTION__))->decl_with_vis.dllimport_flag) = DECL_DLLIMPORT_P (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3528, __FUNCTION__))->decl_with_vis.dllimport_flag); |
3529 | DECL_IGNORED_P (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3529, __FUNCTION__))->decl_common.ignored_flag) = 1; |
3530 | mark_used (fn); |
3531 | |
3532 | DECL_BEFRIENDING_CLASSES (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3532, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3532, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3532, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3532, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3532, __FUNCTION__); <->u.fn; })->befriending_classes ) = var; |
3533 | |
3534 | set_global_binding (fn); |
3535 | } |
3536 | return fn; |
3537 | } |
3538 | |
3539 | /* Get a FUNCTION_DECL for the init wrapper function for the thread_local |
3540 | variable VAR. The wrapper function calls the init function (if any) for |
3541 | VAR and then returns a reference to VAR. The wrapper function is used |
3542 | in place of VAR everywhere VAR is mentioned. */ |
3543 | |
3544 | static tree |
3545 | get_tls_wrapper_fn (tree var) |
3546 | { |
3547 | /* Only C++11 TLS vars need this wrapper fn. */ |
3548 | if (!var_needs_tls_wrapper (var)) |
3549 | return NULL_TREE(tree) __null; |
3550 | |
3551 | tree sname = mangle_tls_wrapper_fn (var); |
3552 | tree fn = get_global_binding (sname); |
3553 | if (!fn) |
3554 | { |
3555 | /* A named rvalue reference is an lvalue, so the wrapper should |
3556 | always return an lvalue reference. */ |
3557 | tree type = non_reference (TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3557, __FUNCTION__))->typed.type)); |
3558 | type = build_reference_type (type); |
3559 | tree fntype = build_function_type (type, void_list_nodeglobal_trees[TI_VOID_LIST_NODE]); |
3560 | |
3561 | fn = build_lang_decl_loc (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3561, __FUNCTION__))->decl_minimal.locus), |
3562 | FUNCTION_DECL, sname, fntype); |
3563 | SET_DECL_LANGUAGE (fn, lang_c)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3563, __FUNCTION__))->decl_common.lang_specific)->u.base .language = (lang_c)); |
3564 | TREE_PUBLIC (fn)((fn)->base.public_flag) = TREE_PUBLIC (var)((var)->base.public_flag); |
3565 | DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3565, __FUNCTION__))->decl_common.artificial_flag) = true; |
3566 | DECL_IGNORED_P (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3566, __FUNCTION__))->decl_common.ignored_flag) = 1; |
3567 | /* The wrapper is inline and emitted everywhere var is used. */ |
3568 | DECL_DECLARED_INLINE_P (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3568, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) = true; |
3569 | if (TREE_PUBLIC (var)((var)->base.public_flag)) |
3570 | { |
3571 | comdat_linkage (fn); |
3572 | #ifdef HAVE_GAS_HIDDEN1 |
3573 | /* Make the wrapper bind locally; there's no reason to share |
3574 | the wrapper between multiple shared objects. */ |
3575 | DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3575, __FUNCTION__))->decl_with_vis.visibility) = VISIBILITY_INTERNAL; |
3576 | DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3576, __FUNCTION__))->decl_with_vis.visibility_specified ) = true; |
3577 | #endif |
3578 | } |
3579 | if (!TREE_PUBLIC (fn)((fn)->base.public_flag)) |
3580 | DECL_INTERFACE_KNOWN (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3580, __FUNCTION__))->decl_common.lang_flag_5) = true; |
3581 | mark_used (fn); |
3582 | note_vague_linkage_fn (fn); |
3583 | |
3584 | #if 0 |
3585 | /* We want CSE to commonize calls to the wrapper, but marking it as |
3586 | pure is unsafe since it has side-effects. I guess we need a new |
3587 | ECF flag even weaker than ECF_PURE. FIXME! */ |
3588 | DECL_PURE_P (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3588, __FUNCTION__, (FUNCTION_DECL)))->function_decl.pure_flag ) = true; |
3589 | #endif |
3590 | |
3591 | DECL_BEFRIENDING_CLASSES (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3591, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3591, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3591, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3591, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3591, __FUNCTION__); <->u.fn; })->befriending_classes ) = var; |
3592 | |
3593 | set_global_binding (fn); |
3594 | } |
3595 | return fn; |
3596 | } |
3597 | |
3598 | /* If EXPR is a thread_local variable that should be wrapped by init |
3599 | wrapper function, return a call to that function, otherwise return |
3600 | NULL. */ |
3601 | |
3602 | tree |
3603 | maybe_get_tls_wrapper_call (tree expr) |
3604 | { |
3605 | if (VAR_P (expr)(((enum tree_code) (expr)->base.code) == VAR_DECL) |
3606 | && !processing_template_declscope_chain->x_processing_template_decl |
3607 | && !cp_unevaluated_operand |
3608 | && CP_DECL_THREAD_LOCAL_P (expr)(((tree_not_check2 (((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3608, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3608, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
3609 | if (tree wrap = get_tls_wrapper_fn (expr)) |
3610 | return build_cxx_call (wrap, 0, NULL__null, tf_warning_or_error); |
3611 | return NULL__null; |
3612 | } |
3613 | |
3614 | /* At EOF, generate the definition for the TLS wrapper function FN: |
3615 | |
3616 | T& var_wrapper() { |
3617 | if (init_fn) init_fn(); |
3618 | return var; |
3619 | } */ |
3620 | |
3621 | static void |
3622 | generate_tls_wrapper (tree fn) |
3623 | { |
3624 | tree var = DECL_BEFRIENDING_CLASSES (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3624, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3624, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3624, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3624, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3624, __FUNCTION__); <->u.fn; })->befriending_classes ); |
3625 | |
3626 | start_preparsed_function (fn, NULL_TREE(tree) __null, SF_DEFAULT0 | SF_PRE_PARSED1); |
3627 | tree body = begin_function_body (); |
3628 | /* Only call the init fn if there might be one. */ |
3629 | if (tree init_fn = get_tls_init_fn (var)) |
3630 | { |
3631 | tree if_stmt = NULL_TREE(tree) __null; |
3632 | /* If init_fn is a weakref, make sure it exists before calling. */ |
3633 | if (lookup_attribute ("weak", DECL_ATTRIBUTES (init_fn)((contains_struct_check ((init_fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3633, __FUNCTION__))->decl_common.attributes))) |
3634 | { |
3635 | if_stmt = begin_if_stmt (); |
3636 | tree addr = cp_build_addr_expr (init_fn, tf_warning_or_error); |
3637 | tree cond = cp_build_binary_op (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3637, __FUNCTION__))->decl_minimal.locus), |
3638 | NE_EXPR, addr, nullptr_nodecp_global_trees[CPTI_NULLPTR], |
3639 | tf_warning_or_error); |
3640 | finish_if_stmt_cond (cond, if_stmt); |
3641 | } |
3642 | finish_expr_stmt (build_cxx_call |
3643 | (init_fn, 0, NULL__null, tf_warning_or_error)); |
3644 | if (if_stmt) |
3645 | { |
3646 | finish_then_clause (if_stmt); |
3647 | finish_if_stmt (if_stmt); |
3648 | } |
3649 | } |
3650 | else |
3651 | /* If there's no initialization, the wrapper is a constant function. */ |
3652 | TREE_READONLY (fn)((non_type_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3652, __FUNCTION__))->base.readonly_flag) = true; |
3653 | finish_return_stmt (convert_from_reference (var)); |
3654 | finish_function_body (body); |
3655 | expand_or_defer_fn (finish_function (/*inline_p=*/false)); |
3656 | } |
3657 | |
3658 | /* Start the process of running a particular set of global constructors |
3659 | or destructors. Subroutine of do_[cd]tors. Also called from |
3660 | vtv_start_verification_constructor_init_function. */ |
3661 | |
3662 | static tree |
3663 | start_objects (int method_type, int initp) |
3664 | { |
3665 | /* Make ctor or dtor function. METHOD_TYPE may be 'I' or 'D'. */ |
3666 | int module_init = 0; |
3667 | |
3668 | if (initp == DEFAULT_INIT_PRIORITY65535 && method_type == 'I') |
3669 | module_init = module_initializer_kind (); |
3670 | |
3671 | tree name = NULL_TREE(tree) __null; |
3672 | if (module_init > 0) |
3673 | name = mangle_module_global_init (0); |
3674 | else |
3675 | { |
3676 | char type[14]; |
3677 | |
3678 | unsigned len = sprintf (type, "sub_%c", method_type); |
3679 | if (initp != DEFAULT_INIT_PRIORITY65535) |
3680 | { |
3681 | char joiner = '_'; |
3682 | #ifdef JOINER'.' |
3683 | joiner = JOINER'.'; |
3684 | #endif |
3685 | type[len++] = joiner; |
3686 | sprintf (type + len, "%.5u", initp); |
3687 | } |
3688 | name = get_file_function_name (type); |
3689 | } |
3690 | |
3691 | tree fntype = build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE], void_list_nodeglobal_trees[TI_VOID_LIST_NODE]); |
3692 | tree fndecl = build_lang_decl (FUNCTION_DECL, name, fntype); |
3693 | DECL_CONTEXT (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3693, __FUNCTION__))->decl_minimal.context) = FROB_CONTEXT (global_namespace)((cp_global_trees[CPTI_GLOBAL]) == cp_global_trees[CPTI_GLOBAL ] ? ((contains_struct_check ((cp_global_trees[CPTI_GLOBAL]), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3693, __FUNCTION__))->decl_minimal.context) : (cp_global_trees [CPTI_GLOBAL])); |
3694 | if (module_init > 0) |
3695 | { |
3696 | SET_DECL_ASSEMBLER_NAME (fndecl, name)overwrite_decl_assembler_name (fndecl, name); |
3697 | TREE_PUBLIC (fndecl)((fndecl)->base.public_flag) = true; |
3698 | determine_visibility (fndecl); |
3699 | } |
3700 | else |
3701 | TREE_PUBLIC (fndecl)((fndecl)->base.public_flag) = 0; |
3702 | start_preparsed_function (fndecl, /*attrs=*/NULL_TREE(tree) __null, SF_PRE_PARSED1); |
3703 | |
3704 | /* Mark as artificial because it's not explicitly in the user's |
3705 | source code. */ |
3706 | DECL_ARTIFICIAL (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3706, __FUNCTION__))->decl_common.artificial_flag) = 1; |
3707 | |
3708 | /* Mark this declaration as used to avoid spurious warnings. */ |
3709 | TREE_USED (current_function_decl)((current_function_decl)->base.used_flag) = 1; |
3710 | |
3711 | /* Mark this function as a global constructor or destructor. */ |
3712 | if (method_type == 'I') |
3713 | DECL_GLOBAL_CTOR_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((current_function_decl) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3713, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3713, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3713, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3713, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3713, __FUNCTION__); <->u.fn; })->global_ctor_p ) = 1; |
3714 | else |
3715 | DECL_GLOBAL_DTOR_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((current_function_decl) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3715, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3715, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3715, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3715, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3715, __FUNCTION__); <->u.fn; })->global_dtor_p ) = 1; |
3716 | |
3717 | tree body = begin_compound_stmt (BCS_FN_BODY); |
3718 | |
3719 | if (module_init > 0) |
3720 | { |
3721 | // 'static bool __in_chrg = false; |
3722 | // if (__inchrg) return; |
3723 | // __inchrg = true |
3724 | tree var = build_lang_decl (VAR_DECL, in_charge_identifiercp_global_trees[CPTI_IN_CHARGE_IDENTIFIER], |
3725 | boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE]); |
3726 | DECL_CONTEXT (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3726, __FUNCTION__))->decl_minimal.context) = fndecl; |
3727 | DECL_ARTIFICIAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3727, __FUNCTION__))->decl_common.artificial_flag) = true; |
3728 | TREE_STATIC (var)((var)->base.static_flag) = true; |
3729 | pushdecl (var); |
3730 | cp_finish_decl (var, NULL_TREE(tree) __null, false, NULL_TREE(tree) __null, 0); |
3731 | |
3732 | tree if_stmt = begin_if_stmt (); |
3733 | finish_if_stmt_cond (var, if_stmt); |
3734 | finish_return_stmt (NULL_TREE(tree) __null); |
3735 | finish_then_clause (if_stmt); |
3736 | finish_if_stmt (if_stmt); |
3737 | |
3738 | tree assign = build2 (MODIFY_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], |
3739 | var, boolean_true_nodeglobal_trees[TI_BOOLEAN_TRUE]); |
3740 | TREE_SIDE_EFFECTS (assign)((non_type_check ((assign), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3740, __FUNCTION__))->base.side_effects_flag) = true; |
3741 | finish_expr_stmt (assign); |
3742 | } |
3743 | |
3744 | if (module_init) |
3745 | module_add_import_initializers (); |
3746 | |
3747 | return body; |
3748 | } |
3749 | |
3750 | /* Finish the process of running a particular set of global constructors |
3751 | or destructors. Subroutine of do_[cd]tors. */ |
3752 | |
3753 | static void |
3754 | finish_objects (int method_type, int initp, tree body) |
3755 | { |
3756 | /* Finish up. */ |
3757 | finish_compound_stmt (body); |
3758 | tree fn = finish_function (/*inline_p=*/false); |
3759 | |
3760 | if (method_type == 'I') |
3761 | { |
3762 | DECL_STATIC_CONSTRUCTOR (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3762, __FUNCTION__, (FUNCTION_DECL)))->function_decl.static_ctor_flag ) = 1; |
3763 | decl_init_priority_insert (fn, initp); |
3764 | } |
3765 | else |
3766 | { |
3767 | DECL_STATIC_DESTRUCTOR (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3767, __FUNCTION__, (FUNCTION_DECL)))->function_decl.static_dtor_flag ) = 1; |
3768 | decl_fini_priority_insert (fn, initp); |
3769 | } |
3770 | |
3771 | expand_or_defer_fn (fn); |
3772 | } |
3773 | |
3774 | /* The names of the parameters to the function created to handle |
3775 | initializations and destructions for objects with static storage |
3776 | duration. */ |
3777 | #define INITIALIZE_P_IDENTIFIER"__initialize_p" "__initialize_p" |
3778 | #define PRIORITY_IDENTIFIER"__priority" "__priority" |
3779 | |
3780 | /* The name of the function we create to handle initializations and |
3781 | destructions for objects with static storage duration. */ |
3782 | #define SSDF_IDENTIFIER"__static_initialization_and_destruction" "__static_initialization_and_destruction" |
3783 | |
3784 | /* The declaration for the __INITIALIZE_P argument. */ |
3785 | static GTY(()) tree initialize_p_decl; |
3786 | |
3787 | /* The declaration for the __PRIORITY argument. */ |
3788 | static GTY(()) tree priority_decl; |
3789 | |
3790 | /* The declaration for the static storage duration function. */ |
3791 | static GTY(()) tree ssdf_decl; |
3792 | |
3793 | /* All the static storage duration functions created in this |
3794 | translation unit. */ |
3795 | static GTY(()) vec<tree, va_gc> *ssdf_decls; |
3796 | |
3797 | /* A map from priority levels to information about that priority |
3798 | level. There may be many such levels, so efficient lookup is |
3799 | important. */ |
3800 | static splay_tree priority_info_map; |
3801 | |
3802 | /* Begins the generation of the function that will handle all |
3803 | initialization and destruction of objects with static storage |
3804 | duration. The function generated takes two parameters of type |
3805 | `int': __INITIALIZE_P and __PRIORITY. If __INITIALIZE_P is |
3806 | nonzero, it performs initializations. Otherwise, it performs |
3807 | destructions. It only performs those initializations or |
3808 | destructions with the indicated __PRIORITY. The generated function |
3809 | returns no value. |
3810 | |
3811 | It is assumed that this function will only be called once per |
3812 | translation unit. */ |
3813 | |
3814 | static tree |
3815 | start_static_storage_duration_function (unsigned count) |
3816 | { |
3817 | tree type; |
3818 | tree body; |
3819 | char id[sizeof (SSDF_IDENTIFIER"__static_initialization_and_destruction") + 1 /* '\0' */ + 32]; |
3820 | |
3821 | /* Create the identifier for this function. It will be of the form |
3822 | SSDF_IDENTIFIER_<number>. */ |
3823 | sprintf (id, "%s_%u", SSDF_IDENTIFIER"__static_initialization_and_destruction", count); |
3824 | |
3825 | type = build_function_type_list (void_type_nodeglobal_trees[TI_VOID_TYPE], |
3826 | integer_type_nodeinteger_types[itk_int], integer_type_nodeinteger_types[itk_int], |
3827 | NULL_TREE(tree) __null); |
3828 | |
3829 | /* Create the FUNCTION_DECL itself. */ |
3830 | ssdf_decl = build_lang_decl (FUNCTION_DECL, |
3831 | get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id) , strlen (id)) : get_identifier (id)), |
3832 | type); |
3833 | TREE_PUBLIC (ssdf_decl)((ssdf_decl)->base.public_flag) = 0; |
3834 | DECL_ARTIFICIAL (ssdf_decl)((contains_struct_check ((ssdf_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3834, __FUNCTION__))->decl_common.artificial_flag) = 1; |
3835 | |
3836 | /* Put this function in the list of functions to be called from the |
3837 | static constructors and destructors. */ |
3838 | if (!ssdf_decls) |
3839 | { |
3840 | vec_alloc (ssdf_decls, 32); |
3841 | |
3842 | /* Take this opportunity to initialize the map from priority |
3843 | numbers to information about that priority level. */ |
3844 | priority_info_map = splay_tree_new (splay_tree_compare_ints, |
3845 | /*delete_key_fn=*/0, |
3846 | /*delete_value_fn=*/ |
3847 | splay_tree_delete_pointers); |
3848 | |
3849 | /* We always need to generate functions for the |
3850 | DEFAULT_INIT_PRIORITY so enter it now. That way when we walk |
3851 | priorities later, we'll be sure to find the |
3852 | DEFAULT_INIT_PRIORITY. */ |
3853 | get_priority_info (DEFAULT_INIT_PRIORITY65535); |
3854 | } |
3855 | |
3856 | vec_safe_push (ssdf_decls, ssdf_decl); |
3857 | |
3858 | /* Create the argument list. */ |
3859 | initialize_p_decl = cp_build_parm_decl |
3860 | (ssdf_decl, get_identifier (INITIALIZE_P_IDENTIFIER)(__builtin_constant_p ("__initialize_p") ? get_identifier_with_length (("__initialize_p"), strlen ("__initialize_p")) : get_identifier ("__initialize_p")), integer_type_nodeinteger_types[itk_int]); |
3861 | TREE_USED (initialize_p_decl)((initialize_p_decl)->base.used_flag) = 1; |
3862 | priority_decl = cp_build_parm_decl |
3863 | (ssdf_decl, get_identifier (PRIORITY_IDENTIFIER)(__builtin_constant_p ("__priority") ? get_identifier_with_length (("__priority"), strlen ("__priority")) : get_identifier ("__priority" )), integer_type_nodeinteger_types[itk_int]); |
3864 | TREE_USED (priority_decl)((priority_decl)->base.used_flag) = 1; |
3865 | |
3866 | DECL_CHAIN (initialize_p_decl)(((contains_struct_check (((contains_struct_check ((initialize_p_decl ), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3866, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3866, __FUNCTION__))->common.chain)) = priority_decl; |
3867 | DECL_ARGUMENTS (ssdf_decl)((tree_check ((ssdf_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3867, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = initialize_p_decl; |
3868 | |
3869 | /* Put the function in the global scope. */ |
3870 | pushdecl (ssdf_decl); |
3871 | |
3872 | /* Start the function itself. This is equivalent to declaring the |
3873 | function as: |
3874 | |
3875 | static void __ssdf (int __initialize_p, init __priority_p); |
3876 | |
3877 | It is static because we only need to call this function from the |
3878 | various constructor and destructor functions for this module. */ |
3879 | start_preparsed_function (ssdf_decl, |
3880 | /*attrs=*/NULL_TREE(tree) __null, |
3881 | SF_PRE_PARSED1); |
3882 | |
3883 | /* Set up the scope of the outermost block in the function. */ |
3884 | body = begin_compound_stmt (BCS_FN_BODY); |
3885 | |
3886 | return body; |
3887 | } |
3888 | |
3889 | /* Finish the generation of the function which performs initialization |
3890 | and destruction of objects with static storage duration. After |
3891 | this point, no more such objects can be created. */ |
3892 | |
3893 | static void |
3894 | finish_static_storage_duration_function (tree body) |
3895 | { |
3896 | /* Close out the function. */ |
3897 | finish_compound_stmt (body); |
3898 | expand_or_defer_fn (finish_function (/*inline_p=*/false)); |
3899 | } |
3900 | |
3901 | /* Return the information about the indicated PRIORITY level. If no |
3902 | code to handle this level has yet been generated, generate the |
3903 | appropriate prologue. */ |
3904 | |
3905 | static priority_info |
3906 | get_priority_info (int priority) |
3907 | { |
3908 | priority_info pi; |
3909 | splay_tree_node n; |
3910 | |
3911 | n = splay_tree_lookup (priority_info_map, |
3912 | (splay_tree_key) priority); |
3913 | if (!n) |
3914 | { |
3915 | /* Create a new priority information structure, and insert it |
3916 | into the map. */ |
3917 | pi = XNEW (struct priority_info_s)((struct priority_info_s *) xmalloc (sizeof (struct priority_info_s ))); |
3918 | pi->initializations_p = 0; |
3919 | pi->destructions_p = 0; |
3920 | splay_tree_insert (priority_info_map, |
3921 | (splay_tree_key) priority, |
3922 | (splay_tree_value) pi); |
3923 | } |
3924 | else |
3925 | pi = (priority_info) n->value; |
3926 | |
3927 | return pi; |
3928 | } |
3929 | |
3930 | /* The effective initialization priority of a DECL. */ |
3931 | |
3932 | #define DECL_EFFECTIVE_INIT_PRIORITY(decl)((!((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3932, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p ) || (decl_init_priority_lookup (decl)) == 0) ? 65535 : (decl_init_priority_lookup (decl))) \ |
3933 | ((!DECL_HAS_INIT_PRIORITY_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3933, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p ) || DECL_INIT_PRIORITY (decl)(decl_init_priority_lookup (decl)) == 0) \ |
3934 | ? DEFAULT_INIT_PRIORITY65535 : DECL_INIT_PRIORITY (decl)(decl_init_priority_lookup (decl))) |
3935 | |
3936 | /* Whether a DECL needs a guard to protect it against multiple |
3937 | initialization. */ |
3938 | |
3939 | #define NEEDS_GUARD_P(decl)(((decl)->base.public_flag) && (((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3939, __FUNCTION__))->decl_with_vis.common_flag) || (decl_comdat_group (decl) != (tree) __null && (((decl)->base.public_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3939, __FUNCTION__))->decl_common.decl_flag_1))) || ((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3939, __FUNCTION__))->decl_with_vis.weak_flag))) (TREE_PUBLIC (decl)((decl)->base.public_flag) && (DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3939, __FUNCTION__))->decl_with_vis.common_flag) \ |
3940 | || DECL_ONE_ONLY (decl)(decl_comdat_group (decl) != (tree) __null && (((decl )->base.public_flag) || ((contains_struct_check ((decl), ( TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3940, __FUNCTION__))->decl_common.decl_flag_1))) \ |
3941 | || DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3941, __FUNCTION__))->decl_with_vis.weak_flag))) |
3942 | |
3943 | /* Called from one_static_initialization_or_destruction(), |
3944 | via walk_tree. |
3945 | Walks the initializer list of a global variable and looks for |
3946 | temporary variables (DECL_NAME() == NULL and DECL_ARTIFICIAL != 0) |
3947 | and that have their DECL_CONTEXT() == NULL. |
3948 | For each such temporary variable, set their DECL_CONTEXT() to |
3949 | the current function. This is necessary because otherwise |
3950 | some optimizers (enabled by -O2 -fprofile-arcs) might crash |
3951 | when trying to refer to a temporary variable that does not have |
3952 | it's DECL_CONTECT() properly set. */ |
3953 | static tree |
3954 | fix_temporary_vars_context_r (tree *node, |
3955 | int * /*unused*/, |
3956 | void * /*unused1*/) |
3957 | { |
3958 | gcc_assert (current_function_decl)((void)(!(current_function_decl) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3958, __FUNCTION__), 0 : 0)); |
3959 | |
3960 | if (TREE_CODE (*node)((enum tree_code) (*node)->base.code) == BIND_EXPR) |
3961 | { |
3962 | tree var; |
3963 | |
3964 | for (var = BIND_EXPR_VARS (*node)((*((const_cast<tree*> (tree_operand_check (((tree_check ((*node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3964, __FUNCTION__, (BIND_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3964, __FUNCTION__)))))); var; var = DECL_CHAIN (var)(((contains_struct_check (((contains_struct_check ((var), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3964, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3964, __FUNCTION__))->common.chain))) |
3965 | if (VAR_P (var)(((enum tree_code) (var)->base.code) == VAR_DECL) |
3966 | && !DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3966, __FUNCTION__))->decl_minimal.name) |
3967 | && DECL_ARTIFICIAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3967, __FUNCTION__))->decl_common.artificial_flag) |
3968 | && !DECL_CONTEXT (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3968, __FUNCTION__))->decl_minimal.context)) |
3969 | DECL_CONTEXT (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3969, __FUNCTION__))->decl_minimal.context) = current_function_decl; |
3970 | } |
3971 | |
3972 | return NULL_TREE(tree) __null; |
3973 | } |
3974 | |
3975 | /* Set up to handle the initialization or destruction of DECL. If |
3976 | INITP is nonzero, we are initializing the variable. Otherwise, we |
3977 | are destroying it. */ |
3978 | |
3979 | static void |
3980 | one_static_initialization_or_destruction (tree decl, tree init, bool initp) |
3981 | { |
3982 | tree guard_if_stmt = NULL_TREE(tree) __null; |
3983 | tree guard; |
3984 | |
3985 | /* If we are supposed to destruct and there's a trivial destructor, |
3986 | nothing has to be done. */ |
3987 | if (!initp |
3988 | && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))(!(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3988, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3988, __FUNCTION__))->type_common.lang_flag_4)))) |
3989 | return; |
3990 | |
3991 | /* Trick the compiler into thinking we are at the file and line |
3992 | where DECL was declared so that error-messages make sense, and so |
3993 | that the debugger will show somewhat sensible file and line |
3994 | information. */ |
3995 | input_location = DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 3995, __FUNCTION__))->decl_minimal.locus); |
3996 | |
3997 | /* Make sure temporary variables in the initialiser all have |
3998 | their DECL_CONTEXT() set to a value different from NULL_TREE. |
3999 | This can happen when global variables initializers are built. |
4000 | In that case, the DECL_CONTEXT() of the global variables _AND_ of all |
4001 | the temporary variables that might have been generated in the |
4002 | accompanying initializers is NULL_TREE, meaning the variables have been |
4003 | declared in the global namespace. |
4004 | What we want to do here is to fix that and make sure the DECL_CONTEXT() |
4005 | of the temporaries are set to the current function decl. */ |
4006 | cp_walk_tree_without_duplicates (&init,walk_tree_without_duplicates_1 (&init, fix_temporary_vars_context_r , __null, cp_walk_subtrees) |
4007 | fix_temporary_vars_context_r,walk_tree_without_duplicates_1 (&init, fix_temporary_vars_context_r , __null, cp_walk_subtrees) |
4008 | NULL)walk_tree_without_duplicates_1 (&init, fix_temporary_vars_context_r , __null, cp_walk_subtrees); |
4009 | |
4010 | /* Because of: |
4011 | |
4012 | [class.access.spec] |
4013 | |
4014 | Access control for implicit calls to the constructors, |
4015 | the conversion functions, or the destructor called to |
4016 | create and destroy a static data member is performed as |
4017 | if these calls appeared in the scope of the member's |
4018 | class. |
4019 | |
4020 | we pretend we are in a static member function of the class of |
4021 | which the DECL is a member. */ |
4022 | if (member_p (decl)) |
4023 | { |
4024 | DECL_CONTEXT (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4024, __FUNCTION__))->decl_minimal.context) = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4024, __FUNCTION__))->decl_minimal.context); |
4025 | DECL_STATIC_FUNCTION_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((current_function_decl) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4025, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4025, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4025, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4025, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4025, __FUNCTION__); <->u.fn; })->static_function ) = 1; |
4026 | } |
4027 | |
4028 | /* Assume we don't need a guard. */ |
4029 | guard = NULL_TREE(tree) __null; |
4030 | /* We need a guard if this is an object with external linkage that |
4031 | might be initialized in more than one place. (For example, a |
4032 | static data member of a template, when the data member requires |
4033 | construction.) */ |
4034 | if (NEEDS_GUARD_P (decl)(((decl)->base.public_flag) && (((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4034, __FUNCTION__))->decl_with_vis.common_flag) || (decl_comdat_group (decl) != (tree) __null && (((decl)->base.public_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4034, __FUNCTION__))->decl_common.decl_flag_1))) || ((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4034, __FUNCTION__))->decl_with_vis.weak_flag)))) |
4035 | { |
4036 | tree guard_cond; |
4037 | |
4038 | guard = get_guard (decl); |
4039 | |
4040 | /* When using __cxa_atexit, we just check the GUARD as we would |
4041 | for a local static. */ |
4042 | if (flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit) |
4043 | { |
4044 | /* When using __cxa_atexit, we never try to destroy |
4045 | anything from a static destructor. */ |
4046 | gcc_assert (initp)((void)(!(initp) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4046, __FUNCTION__), 0 : 0)); |
4047 | guard_cond = get_guard_cond (guard, false); |
4048 | } |
4049 | /* If we don't have __cxa_atexit, then we will be running |
4050 | destructors from .fini sections, or their equivalents. So, |
4051 | we need to know how many times we've tried to initialize this |
4052 | object. We do initializations only if the GUARD is zero, |
4053 | i.e., if we are the first to initialize the variable. We do |
4054 | destructions only if the GUARD is one, i.e., if we are the |
4055 | last to destroy the variable. */ |
4056 | else if (initp) |
4057 | guard_cond |
4058 | = cp_build_binary_op (input_location, |
4059 | EQ_EXPR, |
4060 | cp_build_unary_op (PREINCREMENT_EXPR, |
4061 | guard, |
4062 | /*noconvert=*/true, |
4063 | tf_warning_or_error), |
4064 | integer_one_nodeglobal_trees[TI_INTEGER_ONE], |
4065 | tf_warning_or_error); |
4066 | else |
4067 | guard_cond |
4068 | = cp_build_binary_op (input_location, |
4069 | EQ_EXPR, |
4070 | cp_build_unary_op (PREDECREMENT_EXPR, |
4071 | guard, |
4072 | /*noconvert=*/true, |
4073 | tf_warning_or_error), |
4074 | integer_zero_nodeglobal_trees[TI_INTEGER_ZERO], |
4075 | tf_warning_or_error); |
4076 | |
4077 | guard_if_stmt = begin_if_stmt (); |
4078 | finish_if_stmt_cond (guard_cond, guard_if_stmt); |
4079 | } |
4080 | |
4081 | |
4082 | /* If we're using __cxa_atexit, we have not already set the GUARD, |
4083 | so we must do so now. */ |
4084 | if (guard && initp && flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit) |
4085 | finish_expr_stmt (set_guard (guard)); |
4086 | |
4087 | /* Perform the initialization or destruction. */ |
4088 | if (initp) |
4089 | { |
4090 | if (init) |
4091 | { |
4092 | finish_expr_stmt (init); |
4093 | if (sanitize_flags_p (SANITIZE_ADDRESS, decl)) |
4094 | { |
4095 | varpool_node *vnode = varpool_node::get (decl); |
4096 | if (vnode) |
4097 | vnode->dynamically_initialized = 1; |
4098 | } |
4099 | } |
4100 | |
4101 | /* If we're using __cxa_atexit, register a function that calls the |
4102 | destructor for the object. */ |
4103 | if (flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit) |
4104 | finish_expr_stmt (register_dtor_fn (decl)); |
4105 | } |
4106 | else |
4107 | finish_expr_stmt (build_cleanup (decl)); |
4108 | |
4109 | /* Finish the guard if-stmt, if necessary. */ |
4110 | if (guard) |
4111 | { |
4112 | finish_then_clause (guard_if_stmt); |
4113 | finish_if_stmt (guard_if_stmt); |
4114 | } |
4115 | |
4116 | /* Now that we're done with DECL we don't need to pretend to be a |
4117 | member of its class any longer. */ |
4118 | DECL_CONTEXT (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4118, __FUNCTION__))->decl_minimal.context) = NULL_TREE(tree) __null; |
4119 | DECL_STATIC_FUNCTION_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((current_function_decl) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4119, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4119, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (current_function_decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4119, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4119, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4119, __FUNCTION__); <->u.fn; })->static_function ) = 0; |
4120 | } |
4121 | |
4122 | /* Generate code to do the initialization or destruction of the decls in VARS, |
4123 | a TREE_LIST of VAR_DECL with static storage duration. |
4124 | Whether initialization or destruction is performed is specified by INITP. */ |
4125 | |
4126 | static void |
4127 | do_static_initialization_or_destruction (tree vars, bool initp) |
4128 | { |
4129 | tree node, init_if_stmt, cond; |
4130 | |
4131 | /* Build the outer if-stmt to check for initialization or destruction. */ |
4132 | init_if_stmt = begin_if_stmt (); |
4133 | cond = initp ? integer_one_nodeglobal_trees[TI_INTEGER_ONE] : integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
4134 | cond = cp_build_binary_op (input_location, |
4135 | EQ_EXPR, |
4136 | initialize_p_decl, |
4137 | cond, |
4138 | tf_warning_or_error); |
4139 | finish_if_stmt_cond (cond, init_if_stmt); |
4140 | |
4141 | /* To make sure dynamic construction doesn't access globals from other |
4142 | compilation units where they might not be yet constructed, for |
4143 | -fsanitize=address insert __asan_before_dynamic_init call that |
4144 | prevents access to either all global variables that need construction |
4145 | in other compilation units, or at least those that haven't been |
4146 | initialized yet. Variables that need dynamic construction in |
4147 | the current compilation unit are kept accessible. */ |
4148 | if (initp && (flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS)) |
4149 | finish_expr_stmt (asan_dynamic_init_call (/*after_p=*/false)); |
4150 | |
4151 | node = vars; |
4152 | do { |
4153 | tree decl = TREE_VALUE (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4153, __FUNCTION__, (TREE_LIST)))->list.value); |
4154 | tree priority_if_stmt; |
4155 | int priority; |
4156 | priority_info pi; |
4157 | |
4158 | /* If we don't need a destructor, there's nothing to do. Avoid |
4159 | creating a possibly empty if-stmt. */ |
4160 | if (!initp && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))(!(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4160, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4160, __FUNCTION__))->type_common.lang_flag_4)))) |
4161 | { |
4162 | node = TREE_CHAIN (node)((contains_struct_check ((node), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4162, __FUNCTION__))->common.chain); |
4163 | continue; |
4164 | } |
4165 | |
4166 | /* Remember that we had an initialization or finalization at this |
4167 | priority. */ |
4168 | priority = DECL_EFFECTIVE_INIT_PRIORITY (decl)((!((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4168, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p ) || (decl_init_priority_lookup (decl)) == 0) ? 65535 : (decl_init_priority_lookup (decl))); |
4169 | pi = get_priority_info (priority); |
4170 | if (initp) |
4171 | pi->initializations_p = 1; |
4172 | else |
4173 | pi->destructions_p = 1; |
4174 | |
4175 | /* Conditionalize this initialization on being in the right priority |
4176 | and being initializing/finalizing appropriately. */ |
4177 | priority_if_stmt = begin_if_stmt (); |
4178 | cond = cp_build_binary_op (input_location, |
4179 | EQ_EXPR, |
4180 | priority_decl, |
4181 | build_int_cst (NULL_TREE(tree) __null, priority), |
4182 | tf_warning_or_error); |
4183 | finish_if_stmt_cond (cond, priority_if_stmt); |
4184 | |
4185 | /* Process initializers with same priority. */ |
4186 | for (; node |
4187 | && DECL_EFFECTIVE_INIT_PRIORITY (TREE_VALUE (node))((!((tree_check ((((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4187, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4187, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p ) || (decl_init_priority_lookup (((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4187, __FUNCTION__, (TREE_LIST)))->list.value))) == 0) ? 65535 : (decl_init_priority_lookup (((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4187, __FUNCTION__, (TREE_LIST)))->list.value)))) == priority; |
4188 | node = TREE_CHAIN (node)((contains_struct_check ((node), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4188, __FUNCTION__))->common.chain)) |
4189 | /* Do one initialization or destruction. */ |
4190 | one_static_initialization_or_destruction (TREE_VALUE (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4190, __FUNCTION__, (TREE_LIST)))->list.value), |
4191 | TREE_PURPOSE (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4191, __FUNCTION__, (TREE_LIST)))->list.purpose), initp); |
4192 | |
4193 | /* Finish up the priority if-stmt body. */ |
4194 | finish_then_clause (priority_if_stmt); |
4195 | finish_if_stmt (priority_if_stmt); |
4196 | |
4197 | } while (node); |
4198 | |
4199 | /* Revert what __asan_before_dynamic_init did by calling |
4200 | __asan_after_dynamic_init. */ |
4201 | if (initp && (flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS)) |
4202 | finish_expr_stmt (asan_dynamic_init_call (/*after_p=*/true)); |
4203 | |
4204 | /* Finish up the init/destruct if-stmt body. */ |
4205 | finish_then_clause (init_if_stmt); |
4206 | finish_if_stmt (init_if_stmt); |
4207 | } |
4208 | |
4209 | /* VARS is a list of variables with static storage duration which may |
4210 | need initialization and/or finalization. Remove those variables |
4211 | that don't really need to be initialized or finalized, and return |
4212 | the resulting list. The order in which the variables appear in |
4213 | VARS is in reverse order of the order in which they should actually |
4214 | be initialized. The list we return is in the unreversed order; |
4215 | i.e., the first variable should be initialized first. */ |
4216 | |
4217 | static tree |
4218 | prune_vars_needing_no_initialization (tree *vars) |
4219 | { |
4220 | tree *var = vars; |
4221 | tree result = NULL_TREE(tree) __null; |
4222 | |
4223 | while (*var) |
4224 | { |
4225 | tree t = *var; |
4226 | tree decl = TREE_VALUE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4226, __FUNCTION__, (TREE_LIST)))->list.value); |
4227 | tree init = TREE_PURPOSE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4227, __FUNCTION__, (TREE_LIST)))->list.purpose); |
4228 | |
4229 | /* Deal gracefully with error. */ |
4230 | if (error_operand_p (decl)((decl) == global_trees[TI_ERROR_MARK] || ((decl) && ( (contains_struct_check (((decl)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4230, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ]))) |
4231 | { |
4232 | var = &TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4232, __FUNCTION__))->common.chain); |
4233 | continue; |
4234 | } |
4235 | |
4236 | /* The only things that can be initialized are variables. */ |
4237 | gcc_assert (VAR_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL )) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4237, __FUNCTION__), 0 : 0)); |
4238 | |
4239 | /* If this object is not defined, we don't need to do anything |
4240 | here. */ |
4241 | if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4241, __FUNCTION__))->decl_common.decl_flag_1)) |
4242 | { |
4243 | var = &TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4243, __FUNCTION__))->common.chain); |
4244 | continue; |
4245 | } |
4246 | |
4247 | /* Also, if the initializer already contains errors, we can bail |
4248 | out now. */ |
4249 | if (init && TREE_CODE (init)((enum tree_code) (init)->base.code) == TREE_LIST |
4250 | && value_member (error_mark_nodeglobal_trees[TI_ERROR_MARK], init)) |
4251 | { |
4252 | var = &TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4252, __FUNCTION__))->common.chain); |
4253 | continue; |
4254 | } |
4255 | |
4256 | /* This variable is going to need initialization and/or |
4257 | finalization, so we add it to the list. */ |
4258 | *var = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4258, __FUNCTION__))->common.chain); |
4259 | TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4259, __FUNCTION__))->common.chain) = result; |
4260 | result = t; |
4261 | } |
4262 | |
4263 | return result; |
4264 | } |
4265 | |
4266 | /* Make sure we have told the back end about all the variables in |
4267 | VARS. */ |
4268 | |
4269 | static void |
4270 | write_out_vars (tree vars) |
4271 | { |
4272 | tree v; |
4273 | |
4274 | for (v = vars; v; v = TREE_CHAIN (v)((contains_struct_check ((v), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4274, __FUNCTION__))->common.chain)) |
4275 | { |
4276 | tree var = TREE_VALUE (v)((tree_check ((v), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.c" , 4276, __FUNCTION__, (TREE_LIST)))->list.value); |
4277 | if (!var_finalized_p (var)) |
4278 | { |
4279 | import_export_decl (var); |
4280 | rest_of_decl_compilation (var, 1, 1); |
4281 | } |
4282 | } |
4283 | } |
4284 | |
4285 | /* Generate a static constructor (if CONSTRUCTOR_P) or destructor |
4286 | (otherwise) that will initialize all global objects with static |
4287 | storage duration having the indicated PRIORITY. */ |
4288 | |
4289 | static void |
4290 | generate_ctor_or_dtor_function (bool constructor_p, int priority, |
4291 | location_t *locus) |
4292 | { |
4293 | input_location = *locus; |
4294 | |
4295 | /* We use `I' to indicate initialization and `D' to indicate |
4296 | destruction. */ |
4297 | char function_key = constructor_p ? 'I' : 'D'; |
4298 | |
4299 | /* We emit the function lazily, to avoid generating empty |
4300 | global constructors and destructors. */ |
4301 | tree body = NULL_TREE(tree) __null; |
4302 | |
4303 | if (constructor_p && priority == DEFAULT_INIT_PRIORITY65535) |
4304 | { |
4305 | bool objc = c_dialect_objc ()((c_language & clk_objc) != 0) && objc_static_init_needed_p (); |
4306 | |
4307 | /* We may have module initialization to emit and/or insert |
4308 | before other intializations. */ |
4309 | if (module_initializer_kind () || objc) |
4310 | body = start_objects (function_key, priority); |
4311 | |
4312 | /* For Objective-C++, we may need to initialize metadata found |
4313 | in this module. This must be done _before_ any other static |
4314 | initializations. */ |
4315 | if (objc) |
4316 | objc_generate_static_init_call (NULL_TREE(tree) __null); |
4317 | } |
4318 | |
4319 | /* Call the static storage duration function with appropriate |
4320 | arguments. */ |
4321 | tree fndecl; |
4322 | size_t i; |
4323 | FOR_EACH_VEC_SAFE_ELT (ssdf_decls, i, fndecl)for (i = 0; vec_safe_iterate ((ssdf_decls), (i), &(fndecl )); ++(i)) |
4324 | { |
4325 | /* Calls to pure or const functions will expand to nothing. */ |
4326 | if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST(1 << 0) | ECF_PURE(1 << 1)))) |
4327 | { |
4328 | if (! body) |
4329 | body = start_objects (function_key, priority); |
4330 | |
4331 | tree call = cp_build_function_call_nary (fndecl, tf_warning_or_error, |
4332 | build_int_cst (NULL_TREE(tree) __null, |
4333 | constructor_p), |
4334 | build_int_cst (NULL_TREE(tree) __null, |
4335 | priority), |
4336 | NULL_TREE(tree) __null); |
4337 | finish_expr_stmt (call); |
4338 | } |
4339 | } |
4340 | |
4341 | /* Close out the function. */ |
4342 | if (body) |
4343 | finish_objects (function_key, priority, body); |
4344 | } |
4345 | |
4346 | /* Generate constructor and destructor functions for the priority |
4347 | indicated by N. */ |
4348 | |
4349 | static int |
4350 | generate_ctor_and_dtor_functions_for_priority (splay_tree_node n, void * data) |
4351 | { |
4352 | location_t *locus = (location_t *) data; |
4353 | int priority = (int) n->key; |
4354 | priority_info pi = (priority_info) n->value; |
4355 | |
4356 | /* Generate the functions themselves, but only if they are really |
4357 | needed. */ |
4358 | if (pi->initializations_p) |
4359 | generate_ctor_or_dtor_function (/*constructor_p=*/ |