File: | build/libcc1/libcp1plugin.cc |
Warning: | line 2977, column 3 Undefined or garbage value returned to caller |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Library interface to C++ front end. | |||
2 | Copyright (C) 2014-2023 Free Software Foundation, Inc. | |||
3 | ||||
4 | This file is part of GCC. As it interacts with GDB through libcc1, | |||
5 | they all become a single program as regards the GNU GPL's requirements. | |||
6 | ||||
7 | GCC is free software; you can redistribute it and/or modify it under | |||
8 | the terms of the GNU General Public License as published by the Free | |||
9 | Software Foundation; either version 3, or (at your option) any later | |||
10 | version. | |||
11 | ||||
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |||
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |||
15 | 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 | #include <cc1plugin-config.h> | |||
22 | ||||
23 | #undef PACKAGE_NAME | |||
24 | #undef PACKAGE_STRING | |||
25 | #undef PACKAGE_TARNAME | |||
26 | #undef PACKAGE_VERSION | |||
27 | ||||
28 | #include "../gcc/config.h" | |||
29 | ||||
30 | #undef PACKAGE_NAME | |||
31 | #undef PACKAGE_STRING | |||
32 | #undef PACKAGE_TARNAME | |||
33 | #undef PACKAGE_VERSION | |||
34 | ||||
35 | #define INCLUDE_MEMORY | |||
36 | #include "gcc-plugin.h" | |||
37 | #include "system.h" | |||
38 | #include "coretypes.h" | |||
39 | #include "stringpool.h" | |||
40 | ||||
41 | #include "gcc-interface.h" | |||
42 | #include "machmode.h" | |||
43 | #include "vec.h" | |||
44 | #include "double-int.h" | |||
45 | #include "input.h" | |||
46 | #include "alias.h" | |||
47 | #include "symtab.h" | |||
48 | #include "options.h" | |||
49 | #include "wide-int.h" | |||
50 | #include "inchash.h" | |||
51 | #include "tree.h" | |||
52 | #include "fold-const.h" | |||
53 | #include "stor-layout.h" | |||
54 | #include "cp-tree.h" | |||
55 | #include "toplev.h" | |||
56 | #include "timevar.h" | |||
57 | #include "hash-table.h" | |||
58 | #include "tm.h" | |||
59 | #include "c-family/c-pragma.h" | |||
60 | // #include "c-lang.h" | |||
61 | #include "diagnostic.h" | |||
62 | #include "langhooks.h" | |||
63 | #include "langhooks-def.h" | |||
64 | #include "decl.h" | |||
65 | #include "function.h" | |||
66 | #undef cfun // we want to assign to it, and function.h won't let us | |||
67 | ||||
68 | #include "callbacks.hh" | |||
69 | #include "connection.hh" | |||
70 | #include "marshall-cp.hh" | |||
71 | #include "rpc.hh" | |||
72 | #include "context.hh" | |||
73 | ||||
74 | #include <vector> | |||
75 | ||||
76 | using namespace cc1_plugin; | |||
77 | ||||
78 | ||||
79 | ||||
80 | static_assert (GCC_CP_SYMBOL_MASK >= GCC_CP_SYMBOL_END, | |||
81 | "GCC_CP_SYMBOL_MASK >= GCC_CP_SYMBOL_END"); | |||
82 | ||||
83 | ||||
84 | ||||
85 | static void | |||
86 | plugin_binding_oracle (enum cp_oracle_request kind, tree identifier) | |||
87 | { | |||
88 | enum gcc_cp_oracle_request request; | |||
89 | ||||
90 | gcc_assert (current_context != NULL)((void)(!(current_context != nullptr) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 90, __FUNCTION__), 0 : 0)); | |||
91 | ||||
92 | switch (kind) | |||
93 | { | |||
94 | case CP_ORACLE_IDENTIFIER: | |||
95 | request = GCC_CP_ORACLE_IDENTIFIER; | |||
96 | break; | |||
97 | default: | |||
98 | abort ()fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 98, __FUNCTION__); | |||
99 | } | |||
100 | ||||
101 | int ignore; | |||
102 | cc1_plugin::call (current_context, "binding_oracle", &ignore, | |||
103 | request, IDENTIFIER_POINTER (identifier)((const char *) (tree_check ((identifier), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 103, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); | |||
104 | } | |||
105 | ||||
106 | static int push_count; | |||
107 | ||||
108 | /* at_function_scope_p () tests cfun, indicating we're actually | |||
109 | compiling the function, but we don't even set it when pretending to | |||
110 | enter a function scope. We use this distinction to tell these two | |||
111 | cases apart: we don't want to define e.g. class names in the user | |||
112 | expression function's scope, when they're local to the original | |||
113 | function, because they'd get the wrong linkage name. */ | |||
114 | ||||
115 | static bool | |||
116 | at_fake_function_scope_p () | |||
117 | { | |||
118 | return (!cfun || cfun->decl != current_function_decl) | |||
119 | && current_scope () == current_function_decl; | |||
120 | } | |||
121 | ||||
122 | static void | |||
123 | push_fake_function (tree fndecl, scope_kind kind = sk_function_parms) | |||
124 | { | |||
125 | current_function_decl = fndecl; | |||
126 | begin_scope (kind, fndecl); | |||
127 | ++function_depth; | |||
128 | begin_scope (sk_block, NULLnullptr); | |||
129 | } | |||
130 | ||||
131 | static void | |||
132 | pop_scope () | |||
133 | { | |||
134 | if (toplevel_bindings_p () && current_namespacescope_chain->old_namespace == global_namespacecp_global_trees[CPTI_GLOBAL]) | |||
135 | pop_from_top_level (); | |||
136 | else if (at_namespace_scope_p ()) | |||
137 | pop_namespace (); | |||
138 | else if (at_class_scope_p ()) | |||
139 | popclass (); | |||
140 | else | |||
141 | { | |||
142 | gcc_assert (at_fake_function_scope_p ())((void)(!(at_fake_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 142, __FUNCTION__), 0 : 0)); | |||
143 | gcc_assert (!at_function_scope_p ())((void)(!(!at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 143, __FUNCTION__), 0 : 0)); | |||
144 | gcc_assert (current_binding_level->kind == sk_block((void)(!((*(cfun && (cfun->language) && ( cfun->language)->bindings ? &(cfun->language)-> bindings : &scope_chain->bindings))->kind == sk_block && (*(cfun && (cfun->language) && (cfun->language)->bindings ? &(cfun->language)-> bindings : &scope_chain->bindings))->this_entity == nullptr) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 145, __FUNCTION__), 0 : 0)) | |||
145 | && current_binding_level->this_entity == NULL)((void)(!((*(cfun && (cfun->language) && ( cfun->language)->bindings ? &(cfun->language)-> bindings : &scope_chain->bindings))->kind == sk_block && (*(cfun && (cfun->language) && (cfun->language)->bindings ? &(cfun->language)-> bindings : &scope_chain->bindings))->this_entity == nullptr) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 145, __FUNCTION__), 0 : 0)); | |||
146 | leave_scope (); | |||
147 | --function_depth; | |||
148 | gcc_assert (current_binding_level->this_entity((void)(!((*(cfun && (cfun->language) && ( cfun->language)->bindings ? &(cfun->language)-> bindings : &scope_chain->bindings))->this_entity == current_function_decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 149, __FUNCTION__), 0 : 0)) | |||
149 | == current_function_decl)((void)(!((*(cfun && (cfun->language) && ( cfun->language)->bindings ? &(cfun->language)-> bindings : &scope_chain->bindings))->this_entity == current_function_decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 149, __FUNCTION__), 0 : 0)); | |||
150 | leave_scope (); | |||
151 | current_function_decl = NULLnullptr; | |||
152 | for (cp_binding_level *scope = current_binding_level(*(cfun && (cfun->language) && (cfun->language )->bindings ? &(cfun->language)->bindings : & scope_chain->bindings)); | |||
153 | scope; scope = scope->level_chain) | |||
154 | if (scope->kind == sk_function_parms) | |||
155 | { | |||
156 | current_function_decl = scope->this_entity; | |||
157 | break; | |||
158 | } | |||
159 | } | |||
160 | } | |||
161 | ||||
162 | static void | |||
163 | supplement_binding (cxx_binding *binding, tree decl) | |||
164 | { | |||
165 | /* FIXME: this is pretty much a copy of supplement_binding_1 in | |||
166 | ../gcc/cp/name-lookup.c; the few replaced/removed bits are marked | |||
167 | with "// _1:". */ | |||
168 | tree bval = binding->value; | |||
169 | bool ok = true; | |||
170 | tree target_bval = strip_using_decl (bval); | |||
171 | tree target_decl = strip_using_decl (decl); | |||
172 | ||||
173 | if (TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) == TYPE_DECL && DECL_ARTIFICIAL (target_decl)((contains_struct_check ((target_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 173, __FUNCTION__))->decl_common.artificial_flag) | |||
174 | && target_decl != target_bval | |||
175 | && (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) != TYPE_DECL | |||
176 | /* We allow pushing an enum multiple times in a class | |||
177 | template in order to handle late matching of underlying | |||
178 | type on an opaque-enum-declaration followed by an | |||
179 | enum-specifier. */ | |||
180 | || (processing_template_declscope_chain->x_processing_template_decl | |||
181 | && TREE_CODE (TREE_TYPE (target_decl))((enum tree_code) (((contains_struct_check ((target_decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 181, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE | |||
182 | && TREE_CODE (TREE_TYPE (target_bval))((enum tree_code) (((contains_struct_check ((target_bval), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 182, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE | |||
183 | && (dependent_type_p (ENUM_UNDERLYING_TYPE((contains_struct_check (((tree_check ((((contains_struct_check ((target_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 184, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 184, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 184, __FUNCTION__))->typed.type) | |||
184 | (TREE_TYPE (target_decl))((contains_struct_check (((tree_check ((((contains_struct_check ((target_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 184, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 184, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 184, __FUNCTION__))->typed.type)) | |||
185 | || dependent_type_p (ENUM_UNDERLYING_TYPE((contains_struct_check (((tree_check ((((contains_struct_check ((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 186, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 186, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 186, __FUNCTION__))->typed.type) | |||
186 | (TREE_TYPE (target_bval))((contains_struct_check (((tree_check ((((contains_struct_check ((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 186, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 186, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 186, __FUNCTION__))->typed.type)))))) | |||
187 | /* The new name is the type name. */ | |||
188 | binding->type = decl; | |||
189 | else if (/* TARGET_BVAL is null when push_class_level_binding moves | |||
190 | an inherited type-binding out of the way to make room | |||
191 | for a new value binding. */ | |||
192 | !target_bval | |||
193 | /* TARGET_BVAL is error_mark_node when TARGET_DECL's name | |||
194 | has been used in a non-class scope prior declaration. | |||
195 | In that case, we should have already issued a | |||
196 | diagnostic; for graceful error recovery purpose, pretend | |||
197 | this was the intended declaration for that name. */ | |||
198 | || target_bval == error_mark_nodeglobal_trees[TI_ERROR_MARK] | |||
199 | /* If TARGET_BVAL is anticipated but has not yet been | |||
200 | declared, pretend it is not there at all. */ | |||
201 | || (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == FUNCTION_DECL | |||
202 | && DECL_IS_UNDECLARED_BUILTIN (target_bval)(((contains_struct_check ((target_bval), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 202, __FUNCTION__))->decl_minimal.locus) <= ((location_t ) 1)))) | |||
203 | binding->value = decl; | |||
204 | else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL | |||
205 | && DECL_ARTIFICIAL (target_bval)((contains_struct_check ((target_bval), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 205, __FUNCTION__))->decl_common.artificial_flag) | |||
206 | && target_decl != target_bval | |||
207 | && (TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) != TYPE_DECL | |||
208 | || same_type_p (TREE_TYPE (target_decl),comptypes ((((contains_struct_check ((target_decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 208, __FUNCTION__))->typed.type)), (((contains_struct_check ((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 209, __FUNCTION__))->typed.type)), 0) | |||
209 | TREE_TYPE (target_bval))comptypes ((((contains_struct_check ((target_decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 208, __FUNCTION__))->typed.type)), (((contains_struct_check ((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 209, __FUNCTION__))->typed.type)), 0))) | |||
210 | { | |||
211 | /* The old binding was a type name. It was placed in | |||
212 | VALUE field because it was thought, at the point it was | |||
213 | declared, to be the only entity with such a name. Move the | |||
214 | type name into the type slot; it is now hidden by the new | |||
215 | binding. */ | |||
216 | binding->type = bval; | |||
217 | binding->value = decl; | |||
218 | binding->value_is_inherited = false; | |||
219 | } | |||
220 | else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL | |||
221 | && TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) == TYPE_DECL | |||
222 | && DECL_NAME (target_decl)((contains_struct_check ((target_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 222, __FUNCTION__))->decl_minimal.name) == DECL_NAME (target_bval)((contains_struct_check ((target_bval), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 222, __FUNCTION__))->decl_minimal.name) | |||
223 | && binding->scope->kind != sk_class | |||
224 | && (same_type_p (TREE_TYPE (target_decl), TREE_TYPE (target_bval))comptypes ((((contains_struct_check ((target_decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 224, __FUNCTION__))->typed.type)), (((contains_struct_check ((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 224, __FUNCTION__))->typed.type)), 0) | |||
225 | /* If either type involves template parameters, we must | |||
226 | wait until instantiation. */ | |||
227 | || uses_template_parms (TREE_TYPE (target_decl)((contains_struct_check ((target_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 227, __FUNCTION__))->typed.type)) | |||
228 | || uses_template_parms (TREE_TYPE (target_bval)((contains_struct_check ((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 228, __FUNCTION__))->typed.type)))) | |||
229 | /* We have two typedef-names, both naming the same type to have | |||
230 | the same name. In general, this is OK because of: | |||
231 | ||||
232 | [dcl.typedef] | |||
233 | ||||
234 | In a given scope, a typedef specifier can be used to redefine | |||
235 | the name of any type declared in that scope to refer to the | |||
236 | type to which it already refers. | |||
237 | ||||
238 | However, in class scopes, this rule does not apply due to the | |||
239 | stricter language in [class.mem] prohibiting redeclarations of | |||
240 | members. */ | |||
241 | ok = false; | |||
242 | /* There can be two block-scope declarations of the same variable, | |||
243 | so long as they are `extern' declarations. However, there cannot | |||
244 | be two declarations of the same static data member: | |||
245 | ||||
246 | [class.mem] | |||
247 | ||||
248 | A member shall not be declared twice in the | |||
249 | member-specification. */ | |||
250 | else if (VAR_P (target_decl)(((enum tree_code) (target_decl)->base.code) == VAR_DECL) | |||
251 | && VAR_P (target_bval)(((enum tree_code) (target_bval)->base.code) == VAR_DECL) | |||
252 | && DECL_EXTERNAL (target_decl)((contains_struct_check ((target_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 252, __FUNCTION__))->decl_common.decl_flag_1) && DECL_EXTERNAL (target_bval)((contains_struct_check ((target_bval), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 252, __FUNCTION__))->decl_common.decl_flag_1) | |||
253 | && !DECL_CLASS_SCOPE_P (target_decl)(((contains_struct_check ((target_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 253, __FUNCTION__))->decl_minimal.context) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((target_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 253, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) | |||
254 | { | |||
255 | duplicate_decls (decl, binding->value); | |||
256 | ok = false; | |||
257 | } | |||
258 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL | |||
259 | && TREE_CODE (bval)((enum tree_code) (bval)->base.code) == NAMESPACE_DECL | |||
260 | && DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 260, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 260, __FUNCTION__))->decl_common.abstract_origin) | |||
261 | && DECL_NAMESPACE_ALIAS (bval)((contains_struct_check (((tree_check ((bval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 261, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 261, __FUNCTION__))->decl_common.abstract_origin) | |||
262 | && ORIGINAL_NAMESPACE (bval)(((contains_struct_check (((tree_check ((bval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check (((tree_check ((bval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__))->decl_common.abstract_origin) : (bval )) == ORIGINAL_NAMESPACE (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 262, __FUNCTION__))->decl_common.abstract_origin) : (decl ))) | |||
263 | /* [namespace.alias] | |||
264 | ||||
265 | In a declarative region, a namespace-alias-definition can be | |||
266 | used to redefine a namespace-alias declared in that declarative | |||
267 | region to refer only to the namespace to which it already | |||
268 | refers. */ | |||
269 | ok = false; | |||
270 | else | |||
271 | { | |||
272 | // _1: diagnose_name_conflict (decl, bval); | |||
273 | ok = false; | |||
274 | } | |||
275 | ||||
276 | gcc_assert (ok)((void)(!(ok) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 276, __FUNCTION__), 0 : 0)); // _1: return ok; | |||
277 | } | |||
278 | ||||
279 | static void | |||
280 | reactivate_decl (tree decl, cp_binding_level *b) | |||
281 | { | |||
282 | bool in_function_p = TREE_CODE (b->this_entity)((enum tree_code) (b->this_entity)->base.code) == FUNCTION_DECL; | |||
283 | gcc_assert (in_function_p((void)(!(in_function_p || (b == (*(cfun && (cfun-> language) && (cfun->language)->bindings ? & (cfun->language)->bindings : &scope_chain->bindings )) && !at_class_scope_p ())) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 285, __FUNCTION__), 0 : 0)) | |||
284 | || (b == current_binding_level((void)(!(in_function_p || (b == (*(cfun && (cfun-> language) && (cfun->language)->bindings ? & (cfun->language)->bindings : &scope_chain->bindings )) && !at_class_scope_p ())) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 285, __FUNCTION__), 0 : 0)) | |||
285 | && !at_class_scope_p ()))((void)(!(in_function_p || (b == (*(cfun && (cfun-> language) && (cfun->language)->bindings ? & (cfun->language)->bindings : &scope_chain->bindings )) && !at_class_scope_p ())) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 285, __FUNCTION__), 0 : 0)); | |||
286 | ||||
287 | tree id = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 287, __FUNCTION__))->decl_minimal.name); | |||
288 | tree type = NULL_TREE(tree) nullptr; | |||
289 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL) | |||
290 | type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 290, __FUNCTION__))->typed.type); | |||
291 | ||||
292 | if (type && TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 292, __FUNCTION__))->type_common.name) == decl | |||
293 | && (RECORD_OR_UNION_CODE_P (TREE_CODE (type))((((enum tree_code) (type)->base.code)) == RECORD_TYPE || ( ((enum tree_code) (type)->base.code)) == UNION_TYPE) | |||
294 | || TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE)) | |||
295 | { | |||
296 | gcc_assert (in_function_p && DECL_CONTEXT (decl) == b->this_entity)((void)(!(in_function_p && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 296, __FUNCTION__))->decl_minimal.context) == b->this_entity ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 296, __FUNCTION__), 0 : 0)); | |||
297 | type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 297, __FUNCTION__))->typed.type); | |||
298 | } | |||
299 | else | |||
300 | { | |||
301 | gcc_assert (DECL_CONTEXT (decl) == b->this_entity((void)(!(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 301, __FUNCTION__))->decl_minimal.context) == b->this_entity || ((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 302, __FUNCTION__))->decl_minimal.context) == cp_global_trees [CPTI_GLOBAL] || ((enum tree_code) (((contains_struct_check ( (decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 303, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 303, __FUNCTION__), 0 : 0)) | |||
302 | || DECL_CONTEXT (decl) == global_namespace((void)(!(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 301, __FUNCTION__))->decl_minimal.context) == b->this_entity || ((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 302, __FUNCTION__))->decl_minimal.context) == cp_global_trees [CPTI_GLOBAL] || ((enum tree_code) (((contains_struct_check ( (decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 303, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 303, __FUNCTION__), 0 : 0)) | |||
303 | || TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)((void)(!(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 301, __FUNCTION__))->decl_minimal.context) == b->this_entity || ((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 302, __FUNCTION__))->decl_minimal.context) == cp_global_trees [CPTI_GLOBAL] || ((enum tree_code) (((contains_struct_check ( (decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 303, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 303, __FUNCTION__), 0 : 0)); | |||
304 | type = NULL_TREE(tree) nullptr; | |||
305 | } | |||
306 | ||||
307 | /* Adjust IDENTIFIER_BINDING to what it would have been if we were | |||
308 | at binding level B. Save the binding chain up to that point in | |||
309 | [binding, *chainp), and take note of the outermost bindings found | |||
310 | before B. */ | |||
311 | cxx_binding *binding = IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 311, __FUNCTION__, (IDENTIFIER_NODE))))->bindings), **chainp = NULLnullptr; | |||
312 | tree *shadowing_type_p = NULLnullptr; | |||
313 | if (binding) | |||
314 | { | |||
315 | cp_binding_level *bc = current_binding_level(*(cfun && (cfun->language) && (cfun->language )->bindings ? &(cfun->language)->bindings : & scope_chain->bindings)); | |||
316 | for (cxx_binding *prev_binding = binding; | |||
317 | prev_binding; prev_binding = prev_binding->previous) | |||
318 | { | |||
319 | while (bc != b && bc != prev_binding->scope) | |||
320 | bc = bc->level_chain; | |||
321 | if (bc == b) | |||
322 | { | |||
323 | if (!chainp) | |||
324 | binding = NULLnullptr; | |||
325 | break; | |||
326 | } | |||
327 | chainp = &prev_binding->previous; | |||
328 | if (type) | |||
329 | for (tree tshadow = prev_binding->scope->type_shadowed; | |||
330 | tshadow; tshadow = TREE_CHAIN (tshadow)((contains_struct_check ((tshadow), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 330, __FUNCTION__))->common.chain)) | |||
331 | if (TREE_PURPOSE (tshadow)((tree_check ((tshadow), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 331, __FUNCTION__, (TREE_LIST)))->list.purpose) == id) | |||
332 | { | |||
333 | shadowing_type_p = &TREE_VALUE (tshadow)((tree_check ((tshadow), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 333, __FUNCTION__, (TREE_LIST)))->list.value); | |||
334 | break; | |||
335 | } | |||
336 | } | |||
337 | } | |||
338 | if (chainp) | |||
339 | { | |||
340 | IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 340, __FUNCTION__, (IDENTIFIER_NODE))))->bindings) = *chainp; | |||
341 | *chainp = NULLnullptr; | |||
342 | } | |||
343 | ||||
344 | /* Like push_local_binding, supplement or add a binding to the | |||
345 | desired level. */ | |||
346 | if (IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 346, __FUNCTION__, (IDENTIFIER_NODE))))->bindings) && IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 346, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)->scope == b) | |||
347 | supplement_binding (IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 347, __FUNCTION__, (IDENTIFIER_NODE))))->bindings), decl); | |||
348 | else | |||
349 | push_binding (id, decl, b); | |||
350 | ||||
351 | /* Now restore the binding chain we'd temporarily removed. */ | |||
352 | if (chainp) | |||
353 | { | |||
354 | *chainp = IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 354, __FUNCTION__, (IDENTIFIER_NODE))))->bindings); | |||
355 | IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 355, __FUNCTION__, (IDENTIFIER_NODE))))->bindings) = binding; | |||
356 | ||||
357 | if (type) | |||
358 | { | |||
359 | /* Insert the new type binding in the shadowing_type_p | |||
360 | TREE_VALUE chain. */ | |||
361 | tree shadowed_type = NULL_TREE(tree) nullptr; | |||
362 | if (shadowing_type_p) | |||
363 | { | |||
364 | shadowed_type = *shadowing_type_p; | |||
365 | *shadowing_type_p = type; | |||
366 | } | |||
367 | ||||
368 | b->type_shadowed = tree_cons (id, shadowed_type, b->type_shadowed); | |||
369 | TREE_TYPE (b->type_shadowed)((contains_struct_check ((b->type_shadowed), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 369, __FUNCTION__))->typed.type) = type; | |||
370 | } | |||
371 | } | |||
372 | else if (type) | |||
373 | { | |||
374 | /* Our new binding is the active one, so shadow the earlier | |||
375 | binding. */ | |||
376 | b->type_shadowed = tree_cons (id, REAL_IDENTIFIER_TYPE_VALUE (id)((contains_struct_check ((id), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 376, __FUNCTION__))->typed.type), | |||
377 | b->type_shadowed); | |||
378 | TREE_TYPE (b->type_shadowed)((contains_struct_check ((b->type_shadowed), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 378, __FUNCTION__))->typed.type) = type; | |||
379 | SET_IDENTIFIER_TYPE_VALUE (id, type)(((contains_struct_check ((id), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 379, __FUNCTION__))->typed.type) = (type)); | |||
380 | } | |||
381 | ||||
382 | /* Record that we have a binding for ID, like add_decl_to_level. */ | |||
383 | tree node = build_tree_list (NULL_TREE(tree) nullptr, decl); | |||
384 | TREE_CHAIN (node)((contains_struct_check ((node), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 384, __FUNCTION__))->common.chain) = b->names; | |||
385 | b->names = node; | |||
386 | } | |||
387 | ||||
388 | static void | |||
389 | plugin_pragma_push_user_expression (cpp_reader *) | |||
390 | { | |||
391 | if (push_count++) | |||
392 | return; | |||
393 | ||||
394 | gcc_assert (!current_class_ptr)((void)(!(!(*(cfun && (cfun->language) ? &(cfun ->language)->x_current_class_ptr : &scope_chain-> x_current_class_ptr))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 394, __FUNCTION__), 0 : 0)); | |||
395 | gcc_assert (!current_class_ref)((void)(!(!(*(cfun && (cfun->language) ? &(cfun ->language)->x_current_class_ref : &scope_chain-> x_current_class_ref))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 395, __FUNCTION__), 0 : 0)); | |||
396 | ||||
397 | gcc_assert (!cp_binding_oracle)((void)(!(!cp_binding_oracle) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 397, __FUNCTION__), 0 : 0)); | |||
398 | cp_binding_oracle = plugin_binding_oracle; | |||
399 | ||||
400 | /* Make the function containing the user expression a global | |||
401 | friend, so as to bypass access controls in it. */ | |||
402 | if (at_function_scope_p ()) | |||
403 | set_global_friend (current_function_decl); | |||
404 | ||||
405 | gcc_assert (at_function_scope_p ())((void)(!(at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 405, __FUNCTION__), 0 : 0)); | |||
406 | function *save_cfun = cfun; | |||
407 | cp_binding_level *orig_binding_level = current_binding_level(*(cfun && (cfun->language) && (cfun->language )->bindings ? &(cfun->language)->bindings : & scope_chain->bindings)); | |||
408 | { | |||
409 | int success; | |||
410 | cc1_plugin::call (current_context, "enter_scope", &success); | |||
411 | } | |||
412 | gcc_assert (at_fake_function_scope_p () || at_function_scope_p ())((void)(!(at_fake_function_scope_p () || at_function_scope_p ( )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 412, __FUNCTION__), 0 : 0)); | |||
413 | ||||
414 | function *unchanged_cfun = cfun; | |||
415 | tree changed_func_decl = current_function_decl; | |||
416 | ||||
417 | gcc_assert (current_class_type == DECL_CONTEXT (current_function_decl)((void)(!(scope_chain->class_type == ((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 417, __FUNCTION__))->decl_minimal.context) || !(((((enum tree_code) (((contains_struct_check ((current_function_decl) , (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__))->decl_minimal.context))->base.code )) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__))->decl_minimal.context))->base.code )) == UNION_TYPE))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__), 0 : 0)) | |||
418 | || !(RECORD_OR_UNION_CODE_P((void)(!(scope_chain->class_type == ((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 417, __FUNCTION__))->decl_minimal.context) || !(((((enum tree_code) (((contains_struct_check ((current_function_decl) , (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__))->decl_minimal.context))->base.code )) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__))->decl_minimal.context))->base.code )) == UNION_TYPE))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__), 0 : 0)) | |||
419 | (TREE_CODE (DECL_CONTEXT (current_function_decl)))))((void)(!(scope_chain->class_type == ((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 417, __FUNCTION__))->decl_minimal.context) || !(((((enum tree_code) (((contains_struct_check ((current_function_decl) , (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__))->decl_minimal.context))->base.code )) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__))->decl_minimal.context))->base.code )) == UNION_TYPE))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 419, __FUNCTION__), 0 : 0)); | |||
420 | push_fake_function (save_cfun->decl, sk_block); | |||
421 | current_class_typescope_chain->class_type = NULL_TREE(tree) nullptr; | |||
422 | if (unchanged_cfun) | |||
423 | { | |||
424 | /* If we get here, GDB did NOT change the context. */ | |||
425 | gcc_assert (cfun == save_cfun)((void)(!(cfun == save_cfun) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 425, __FUNCTION__), 0 : 0)); | |||
426 | gcc_assert (at_function_scope_p ())((void)(!(at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 426, __FUNCTION__), 0 : 0)); | |||
427 | gcc_assert (orig_binding_level((void)(!(orig_binding_level == (*(cfun && (cfun-> language) && (cfun->language)->bindings ? & (cfun->language)->bindings : &scope_chain->bindings ))->level_chain->level_chain) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 428, __FUNCTION__), 0 : 0)) | |||
428 | == current_binding_level->level_chain->level_chain)((void)(!(orig_binding_level == (*(cfun && (cfun-> language) && (cfun->language)->bindings ? & (cfun->language)->bindings : &scope_chain->bindings ))->level_chain->level_chain) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 428, __FUNCTION__), 0 : 0)); | |||
429 | } | |||
430 | else | |||
431 | { | |||
432 | cfun = save_cfun; | |||
433 | gcc_assert (at_function_scope_p ())((void)(!(at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 433, __FUNCTION__), 0 : 0)); | |||
434 | ||||
435 | cp_binding_level *b = current_binding_level(*(cfun && (cfun->language) && (cfun->language )->bindings ? &(cfun->language)->bindings : & scope_chain->bindings))->level_chain; | |||
436 | gcc_assert (b->this_entity == cfun->decl)((void)(!(b->this_entity == cfun->decl) ? fancy_abort ( "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 436, __FUNCTION__), 0 : 0)); | |||
437 | ||||
438 | /* Reactivate local names from the previous context. Use | |||
439 | IDENTIFIER_MARKED to avoid reactivating shadowed names. */ | |||
440 | for (cp_binding_level *level = orig_binding_level;;) | |||
441 | { | |||
442 | for (tree name = level->names; | |||
443 | name; name = TREE_CHAIN (name)((contains_struct_check ((name), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 443, __FUNCTION__))->common.chain)) | |||
444 | { | |||
445 | tree decl = name; | |||
446 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_LIST) | |||
447 | decl = TREE_VALUE (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 447, __FUNCTION__, (TREE_LIST)))->list.value); | |||
448 | if (IDENTIFIER_MARKED (DECL_NAME (decl))((tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 448, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 448, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 448, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) | |||
449 | continue; | |||
450 | IDENTIFIER_MARKED (DECL_NAME (decl))((tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 450, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 450, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 450, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) = 1; | |||
451 | reactivate_decl (decl, b); | |||
452 | } | |||
453 | if (level->kind == sk_function_parms | |||
454 | && level->this_entity == cfun->decl) | |||
455 | break; | |||
456 | gcc_assert (!level->this_entity)((void)(!(!level->this_entity) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 456, __FUNCTION__), 0 : 0)); | |||
457 | level = level->level_chain; | |||
458 | } | |||
459 | ||||
460 | /* Now, clear the markers. */ | |||
461 | for (tree name = b->names; name; name = TREE_CHAIN (name)((contains_struct_check ((name), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 461, __FUNCTION__))->common.chain)) | |||
462 | { | |||
463 | tree decl = name; | |||
464 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_LIST) | |||
465 | decl = TREE_VALUE (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 465, __FUNCTION__, (TREE_LIST)))->list.value); | |||
466 | gcc_assert (IDENTIFIER_MARKED (DECL_NAME (decl)))((void)(!(((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 466, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 466, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 466, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 466, __FUNCTION__), 0 : 0)); | |||
467 | IDENTIFIER_MARKED (DECL_NAME (decl))((tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 467, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 467, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 467, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) = 0; | |||
468 | } | |||
469 | } | |||
470 | ||||
471 | if (unchanged_cfun || DECL_NONSTATIC_MEMBER_FUNCTION_P (changed_func_decl)(((enum tree_code) (((contains_struct_check ((changed_func_decl ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 471, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) | |||
472 | { | |||
473 | /* Check whether the oracle supplies us with a "this", and if | |||
474 | so, arrange for data members and this itself to be | |||
475 | usable. */ | |||
476 | tree this_val = lookup_name (get_identifier ("this")(__builtin_constant_p ("this") ? get_identifier_with_length ( ("this"), strlen ("this")) : get_identifier ("this"))); | |||
477 | current_class_ref(*(cfun && (cfun->language) ? &(cfun->language )->x_current_class_ref : &scope_chain->x_current_class_ref )) = !this_val ? NULL_TREE(tree) nullptr | |||
478 | : cp_build_indirect_ref (input_location, this_val, RO_NULL, | |||
479 | tf_warning_or_error); | |||
480 | current_class_ptr(*(cfun && (cfun->language) ? &(cfun->language )->x_current_class_ptr : &scope_chain->x_current_class_ptr )) = this_val; | |||
481 | } | |||
482 | } | |||
483 | ||||
484 | static void | |||
485 | plugin_pragma_pop_user_expression (cpp_reader *) | |||
486 | { | |||
487 | if (--push_count) | |||
488 | return; | |||
489 | ||||
490 | gcc_assert (cp_binding_oracle)((void)(!(cp_binding_oracle) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 490, __FUNCTION__), 0 : 0)); | |||
491 | ||||
492 | gcc_assert (at_function_scope_p ())((void)(!(at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 492, __FUNCTION__), 0 : 0)); | |||
493 | function *save_cfun = cfun; | |||
494 | current_class_ptr(*(cfun && (cfun->language) ? &(cfun->language )->x_current_class_ptr : &scope_chain->x_current_class_ptr )) = NULL_TREE(tree) nullptr; | |||
495 | current_class_ref(*(cfun && (cfun->language) ? &(cfun->language )->x_current_class_ref : &scope_chain->x_current_class_ref )) = NULL_TREE(tree) nullptr; | |||
496 | ||||
497 | cfun = NULLnullptr; | |||
498 | pop_scope (); | |||
499 | if (RECORD_OR_UNION_CODE_P (TREE_CODE (DECL_CONTEXT (current_function_decl)))((((enum tree_code) (((contains_struct_check ((current_function_decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 499, __FUNCTION__))->decl_minimal.context))->base.code )) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 499, __FUNCTION__))->decl_minimal.context))->base.code )) == UNION_TYPE)) | |||
500 | current_class_typescope_chain->class_type = DECL_CONTEXT (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 500, __FUNCTION__))->decl_minimal.context); | |||
501 | { | |||
502 | int success; | |||
503 | cc1_plugin::call (current_context, "leave_scope", &success); | |||
504 | } | |||
505 | if (!cfun) | |||
506 | cfun = save_cfun; | |||
507 | else | |||
508 | gcc_assert (cfun == save_cfun)((void)(!(cfun == save_cfun) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 508, __FUNCTION__), 0 : 0)); | |||
509 | ||||
510 | cp_binding_oracle = NULLnullptr; | |||
511 | gcc_assert (at_function_scope_p ())((void)(!(at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 511, __FUNCTION__), 0 : 0)); | |||
512 | } | |||
513 | ||||
514 | static void | |||
515 | plugin_init_extra_pragmas (void *, void *) | |||
516 | { | |||
517 | c_register_pragma ("GCC", "push_user_expression", plugin_pragma_push_user_expression); | |||
518 | c_register_pragma ("GCC", "pop_user_expression", plugin_pragma_pop_user_expression); | |||
519 | /* FIXME: this one should go once we get GDB to use push and pop. */ | |||
520 | c_register_pragma ("GCC", "user_expression", plugin_pragma_push_user_expression); | |||
521 | } | |||
522 | ||||
523 | ||||
524 | ||||
525 | static decl_addr_value | |||
526 | build_decl_addr_value (tree decl, gcc_address address) | |||
527 | { | |||
528 | decl_addr_value value = { | |||
529 | decl, | |||
530 | build_int_cst_type (ptr_type_nodeglobal_trees[TI_PTR_TYPE], address) | |||
531 | }; | |||
532 | return value; | |||
533 | } | |||
534 | ||||
535 | static decl_addr_value * | |||
536 | record_decl_address (plugin_context *ctx, decl_addr_value value) | |||
537 | { | |||
538 | decl_addr_value **slot = ctx->address_map.find_slot (&value, INSERT); | |||
539 | gcc_assert (*slot == NULL)((void)(!(*slot == nullptr) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 539, __FUNCTION__), 0 : 0)); | |||
540 | *slot | |||
541 | = static_cast<decl_addr_value *> (xmalloc (sizeof (decl_addr_value))); | |||
542 | **slot = value; | |||
543 | /* We don't want GCC to warn about e.g. static functions | |||
544 | without a code definition. */ | |||
545 | suppress_warning (value.decl); | |||
546 | return *slot; | |||
547 | } | |||
548 | ||||
549 | // Maybe rewrite a decl to its address. | |||
550 | static tree | |||
551 | address_rewriter (tree *in, int *walk_subtrees, void *arg) | |||
552 | { | |||
553 | plugin_context *ctx = (plugin_context *) arg; | |||
554 | ||||
555 | if (!DECL_P (*in)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (*in)->base.code))] == tcc_declaration) | |||
556 | || TREE_CODE (*in)((enum tree_code) (*in)->base.code) == NAMESPACE_DECL | |||
557 | || DECL_NAME (*in)((contains_struct_check ((*in), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 557, __FUNCTION__))->decl_minimal.name) == NULL_TREE(tree) nullptr) | |||
558 | return NULL_TREE(tree) nullptr; | |||
559 | ||||
560 | decl_addr_value value; | |||
561 | value.decl = *in; | |||
562 | decl_addr_value *found_value = ctx->address_map.find (&value); | |||
563 | if (found_value != NULLnullptr) | |||
564 | ; | |||
565 | else if (HAS_DECL_ASSEMBLER_NAME_P (*in)((tree_contains_struct[(((enum tree_code) (*in)->base.code ))][(TS_DECL_WITH_VIS)]))) | |||
566 | { | |||
567 | gcc_address address; | |||
568 | ||||
569 | if (!cc1_plugin::call (ctx, "address_oracle", &address, | |||
570 | IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (*in))((const char *) (tree_check ((decl_assembler_name (*in)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 570, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ))) | |||
571 | return NULL_TREE(tree) nullptr; | |||
572 | if (address == 0) | |||
573 | return NULL_TREE(tree) nullptr; | |||
574 | ||||
575 | // Insert the decl into the address map in case it is referenced | |||
576 | // again. | |||
577 | value = build_decl_addr_value (value.decl, address); | |||
578 | found_value = record_decl_address (ctx, value); | |||
579 | } | |||
580 | else | |||
581 | return NULL_TREE(tree) nullptr; | |||
582 | ||||
583 | if (found_value->address != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | |||
584 | { | |||
585 | // We have an address for the decl, so rewrite the tree. | |||
586 | tree ptr_type = build_pointer_type (TREE_TYPE (*in)((contains_struct_check ((*in), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 586, __FUNCTION__))->typed.type)); | |||
587 | *in = fold_build1 (INDIRECT_REF, TREE_TYPE (*in),fold_build1_loc (((location_t) 0), INDIRECT_REF, ((contains_struct_check ((*in), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 587, __FUNCTION__))->typed.type), fold_build1_loc (((location_t ) 0), CONVERT_EXPR, ptr_type, found_value->address ) ) | |||
588 | fold_build1 (CONVERT_EXPR, ptr_type,fold_build1_loc (((location_t) 0), INDIRECT_REF, ((contains_struct_check ((*in), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 587, __FUNCTION__))->typed.type), fold_build1_loc (((location_t ) 0), CONVERT_EXPR, ptr_type, found_value->address ) ) | |||
589 | found_value->address))fold_build1_loc (((location_t) 0), INDIRECT_REF, ((contains_struct_check ((*in), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 587, __FUNCTION__))->typed.type), fold_build1_loc (((location_t ) 0), CONVERT_EXPR, ptr_type, found_value->address ) ); | |||
590 | } | |||
591 | ||||
592 | *walk_subtrees = 0; | |||
593 | ||||
594 | return NULL_TREE(tree) nullptr; | |||
595 | } | |||
596 | ||||
597 | // When generating code for gdb, we want to be able to use absolute | |||
598 | // addresses to refer to otherwise external objects that gdb knows | |||
599 | // about. gdb passes in these addresses when building decls, and then | |||
600 | // before gimplification we go through the trees, rewriting uses to | |||
601 | // the equivalent of "*(TYPE *) ADDR". | |||
602 | static void | |||
603 | rewrite_decls_to_addresses (void *function_in, void *) | |||
604 | { | |||
605 | tree function = (tree) function_in; | |||
606 | ||||
607 | // Do nothing if we're not in gdb. | |||
608 | if (current_context == NULLnullptr) | |||
609 | return; | |||
610 | ||||
611 | walk_tree (&DECL_SAVED_TREE (function), address_rewriter, current_context,walk_tree_1 (&((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 611, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree ), address_rewriter, current_context, nullptr, nullptr) | |||
612 | NULL)walk_tree_1 (&((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 611, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree ), address_rewriter, current_context, nullptr, nullptr); | |||
613 | } | |||
614 | ||||
615 | ||||
616 | ||||
617 | static inline tree | |||
618 | safe_push_template_decl (tree decl) | |||
619 | { | |||
620 | void (*save_oracle) (enum cp_oracle_request, tree identifier); | |||
621 | ||||
622 | save_oracle = cp_binding_oracle; | |||
623 | cp_binding_oracle = NULLnullptr; | |||
624 | ||||
625 | tree ret = push_template_decl (decl); | |||
626 | ||||
627 | cp_binding_oracle = save_oracle; | |||
628 | ||||
629 | return ret; | |||
630 | } | |||
631 | ||||
632 | static inline tree | |||
633 | safe_pushtag (tree name, tree type) | |||
634 | { | |||
635 | void (*save_oracle) (enum cp_oracle_request, tree identifier); | |||
636 | ||||
637 | save_oracle = cp_binding_oracle; | |||
638 | cp_binding_oracle = NULLnullptr; | |||
639 | ||||
640 | tree ret = pushtag (name, type); | |||
641 | ||||
642 | cp_binding_oracle = save_oracle; | |||
643 | ||||
644 | return ret; | |||
645 | } | |||
646 | ||||
647 | static inline tree | |||
648 | safe_pushdecl (tree decl) | |||
649 | { | |||
650 | void (*save_oracle) (enum cp_oracle_request, tree identifier); | |||
651 | ||||
652 | save_oracle = cp_binding_oracle; | |||
653 | cp_binding_oracle = NULLnullptr; | |||
654 | ||||
655 | tree ret = pushdecl (decl); | |||
656 | ||||
657 | cp_binding_oracle = save_oracle; | |||
658 | ||||
659 | return ret; | |||
660 | } | |||
661 | ||||
662 | ||||
663 | ||||
664 | int | |||
665 | plugin_push_namespace (cc1_plugin::connection *, | |||
666 | const char *name) | |||
667 | { | |||
668 | if (name && !*name) | |||
669 | push_to_top_level (); | |||
670 | else | |||
671 | push_namespace (name ? get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name ), strlen (name)) : get_identifier (name)) : NULLnullptr); | |||
672 | ||||
673 | return 1; | |||
674 | } | |||
675 | ||||
676 | int | |||
677 | plugin_push_class (cc1_plugin::connection *, | |||
678 | gcc_type type_in) | |||
679 | { | |||
680 | tree type = convert_in (type_in); | |||
681 | gcc_assert (RECORD_OR_UNION_CODE_P (TREE_CODE (type)))((void)(!(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 681, __FUNCTION__), 0 : 0)); | |||
682 | gcc_assert (TYPE_CONTEXT (type) == FROB_CONTEXT (current_scope ()))((void)(!(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 682, __FUNCTION__))->type_common.context) == ((current_scope ()) == cp_global_trees[CPTI_GLOBAL] ? ((contains_struct_check ((current_scope ()), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 682, __FUNCTION__))->decl_minimal.context) : (current_scope ()))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 682, __FUNCTION__), 0 : 0)); | |||
683 | ||||
684 | pushclass (type); | |||
685 | ||||
686 | return 1; | |||
687 | } | |||
688 | ||||
689 | int | |||
690 | plugin_push_function (cc1_plugin::connection *, | |||
691 | gcc_decl function_decl_in) | |||
692 | { | |||
693 | tree fndecl = convert_in (function_decl_in); | |||
694 | gcc_assert (TREE_CODE (fndecl) == FUNCTION_DECL)((void)(!(((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 694, __FUNCTION__), 0 : 0)); | |||
695 | gcc_assert (DECL_CONTEXT (fndecl) == FROB_CONTEXT (current_scope ()))((void)(!(((contains_struct_check ((fndecl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 695, __FUNCTION__))->decl_minimal.context) == ((current_scope ()) == cp_global_trees[CPTI_GLOBAL] ? ((contains_struct_check ((current_scope ()), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 695, __FUNCTION__))->decl_minimal.context) : (current_scope ()))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 695, __FUNCTION__), 0 : 0)); | |||
696 | ||||
697 | push_fake_function (fndecl); | |||
698 | ||||
699 | return 1; | |||
700 | } | |||
701 | ||||
702 | int | |||
703 | plugin_pop_binding_level (cc1_plugin::connection *) | |||
704 | { | |||
705 | pop_scope (); | |||
706 | return 1; | |||
707 | } | |||
708 | ||||
709 | int | |||
710 | plugin_reactivate_decl (cc1_plugin::connection *, | |||
711 | gcc_decl decl_in, | |||
712 | gcc_decl scope_in) | |||
713 | { | |||
714 | tree decl = convert_in (decl_in); | |||
715 | tree scope = convert_in (scope_in); | |||
716 | gcc_assert (TREE_CODE (decl) == VAR_DECL((void)(!(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 718, __FUNCTION__), 0 : 0)) | |||
717 | || TREE_CODE (decl) == FUNCTION_DECL((void)(!(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 718, __FUNCTION__), 0 : 0)) | |||
718 | || TREE_CODE (decl) == TYPE_DECL)((void)(!(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 718, __FUNCTION__), 0 : 0)); | |||
719 | cp_binding_level *b; | |||
720 | if (scope) | |||
721 | { | |||
722 | gcc_assert (TREE_CODE (scope) == FUNCTION_DECL)((void)(!(((enum tree_code) (scope)->base.code) == FUNCTION_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 722, __FUNCTION__), 0 : 0)); | |||
723 | for (b = current_binding_level(*(cfun && (cfun->language) && (cfun->language )->bindings ? &(cfun->language)->bindings : & scope_chain->bindings)); | |||
724 | b->this_entity != scope; | |||
725 | b = b->level_chain) | |||
726 | gcc_assert (b->this_entity != global_namespace)((void)(!(b->this_entity != cp_global_trees[CPTI_GLOBAL]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 726, __FUNCTION__), 0 : 0)); | |||
727 | } | |||
728 | else | |||
729 | { | |||
730 | gcc_assert (!at_class_scope_p ())((void)(!(!at_class_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 730, __FUNCTION__), 0 : 0)); | |||
731 | b = current_binding_level(*(cfun && (cfun->language) && (cfun->language )->bindings ? &(cfun->language)->bindings : & scope_chain->bindings)); | |||
732 | } | |||
733 | ||||
734 | reactivate_decl (decl, b); | |||
735 | return 1; | |||
736 | } | |||
737 | ||||
738 | static tree | |||
739 | get_current_scope () | |||
740 | { | |||
741 | tree decl; | |||
742 | ||||
743 | if (at_namespace_scope_p ()) | |||
744 | decl = current_namespacescope_chain->old_namespace; | |||
745 | else if (at_class_scope_p ()) | |||
746 | decl = TYPE_NAME (current_class_type)((tree_class_check ((scope_chain->class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 746, __FUNCTION__))->type_common.name); | |||
747 | else if (at_fake_function_scope_p () || at_function_scope_p ()) | |||
748 | decl = current_function_decl; | |||
749 | else | |||
750 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 750, __FUNCTION__)); | |||
751 | ||||
752 | return decl; | |||
753 | } | |||
754 | ||||
755 | gcc_decl | |||
756 | plugin_get_current_binding_level_decl (cc1_plugin::connection *) | |||
757 | { | |||
758 | tree decl = get_current_scope (); | |||
759 | ||||
760 | return convert_out (decl); | |||
761 | } | |||
762 | ||||
763 | int | |||
764 | plugin_make_namespace_inline (cc1_plugin::connection *) | |||
765 | { | |||
766 | tree inline_ns = current_namespacescope_chain->old_namespace; | |||
767 | ||||
768 | gcc_assert (toplevel_bindings_p ())((void)(!(toplevel_bindings_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 768, __FUNCTION__), 0 : 0)); | |||
769 | gcc_assert (inline_ns != global_namespace)((void)(!(inline_ns != cp_global_trees[CPTI_GLOBAL]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 769, __FUNCTION__), 0 : 0)); | |||
770 | ||||
771 | tree parent_ns = CP_DECL_CONTEXT (inline_ns)(!(! (((contains_struct_check ((inline_ns), (TS_DECL_MINIMAL) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 771, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((inline_ns), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 771, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((inline_ns ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 771, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]); | |||
772 | ||||
773 | if (DECL_NAMESPACE_INLINE_P (inline_ns)((tree_not_check2 (((tree_check ((inline_ns), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 773, __FUNCTION__, (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 773, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) | |||
774 | return 0; | |||
775 | ||||
776 | DECL_NAMESPACE_INLINE_P (inline_ns)((tree_not_check2 (((tree_check ((inline_ns), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 776, __FUNCTION__, (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 776, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = true; | |||
777 | vec_safe_push (DECL_NAMESPACE_INLINEES (parent_ns)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((parent_ns), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 777, __FUNCTION__))->decl_common.lang_specific); if (((enum tree_code) (parent_ns)->base.code) != NAMESPACE_DECL || lt ->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 777, __FUNCTION__); <->u.ns; })->inlinees), inline_ns); | |||
778 | ||||
779 | return 1; | |||
780 | } | |||
781 | ||||
782 | int | |||
783 | plugin_add_using_namespace (cc1_plugin::connection *, | |||
784 | gcc_decl used_ns_in) | |||
785 | { | |||
786 | tree used_ns = convert_in (used_ns_in); | |||
787 | ||||
788 | gcc_assert (TREE_CODE (used_ns) == NAMESPACE_DECL)((void)(!(((enum tree_code) (used_ns)->base.code) == NAMESPACE_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 788, __FUNCTION__), 0 : 0)); | |||
789 | ||||
790 | finish_using_directive (used_ns, NULL_TREE(tree) nullptr); | |||
791 | ||||
792 | return 1; | |||
793 | } | |||
794 | ||||
795 | int | |||
796 | plugin_add_namespace_alias (cc1_plugin::connection *, | |||
797 | const char *id, | |||
798 | gcc_decl target_in) | |||
799 | { | |||
800 | tree name = get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id) , strlen (id)) : get_identifier (id)); | |||
801 | tree target = convert_in (target_in); | |||
802 | ||||
803 | do_namespace_alias (name, target); | |||
804 | ||||
805 | return 1; | |||
806 | } | |||
807 | ||||
808 | static inline void | |||
809 | set_access_flags (tree decl, enum gcc_cp_symbol_kind flags) | |||
810 | { | |||
811 | gcc_assert (!(flags & GCC_CP_ACCESS_MASK) == !DECL_CLASS_SCOPE_P (decl))((void)(!(!(flags & GCC_CP_ACCESS_MASK) == !(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 811, __FUNCTION__))->decl_minimal.context) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 811, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 811, __FUNCTION__), 0 : 0)); | |||
812 | ||||
813 | switch (flags & GCC_CP_ACCESS_MASK) | |||
814 | { | |||
815 | case GCC_CP_ACCESS_PRIVATE: | |||
816 | TREE_PRIVATE (decl)((decl)->base.private_flag) = true; | |||
817 | current_access_specifierscope_chain->access_specifier = access_private_nodeglobal_trees[TI_PRIVATE]; | |||
818 | break; | |||
819 | ||||
820 | case GCC_CP_ACCESS_PROTECTED: | |||
821 | TREE_PROTECTED (decl)((decl)->base.protected_flag) = true; | |||
822 | current_access_specifierscope_chain->access_specifier = access_protected_nodeglobal_trees[TI_PROTECTED]; | |||
823 | break; | |||
824 | ||||
825 | case GCC_CP_ACCESS_PUBLIC: | |||
826 | current_access_specifierscope_chain->access_specifier = access_public_nodeglobal_trees[TI_PUBLIC]; | |||
827 | break; | |||
828 | ||||
829 | default: | |||
830 | break; | |||
831 | } | |||
832 | } | |||
833 | ||||
834 | int | |||
835 | plugin_add_using_decl (cc1_plugin::connection *, | |||
836 | enum gcc_cp_symbol_kind flags, | |||
837 | gcc_decl target_in) | |||
838 | { | |||
839 | tree target = convert_in (target_in); | |||
840 | gcc_assert ((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_USING)((void)(!((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_USING ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 840, __FUNCTION__), 0 : 0)); | |||
841 | gcc_assert (!(flags & GCC_CP_FLAG_MASK))((void)(!(!(flags & GCC_CP_FLAG_MASK)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 841, __FUNCTION__), 0 : 0)); | |||
842 | enum gcc_cp_symbol_kind acc_flags; | |||
843 | acc_flags = (enum gcc_cp_symbol_kind) (flags & GCC_CP_ACCESS_MASK); | |||
844 | ||||
845 | gcc_assert (!template_parm_scope_p ())((void)(!(!template_parm_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 845, __FUNCTION__), 0 : 0)); | |||
846 | ||||
847 | bool class_member_p = at_class_scope_p (); | |||
848 | gcc_assert (!(acc_flags & GCC_CP_ACCESS_MASK) == !class_member_p)((void)(!(!(acc_flags & GCC_CP_ACCESS_MASK) == !class_member_p ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 848, __FUNCTION__), 0 : 0)); | |||
849 | ||||
850 | tree identifier = DECL_NAME (target)((contains_struct_check ((target), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 850, __FUNCTION__))->decl_minimal.name); | |||
851 | tree tcontext = DECL_CONTEXT (target)((contains_struct_check ((target), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 851, __FUNCTION__))->decl_minimal.context); | |||
852 | ||||
853 | if (UNSCOPED_ENUM_P (tcontext)(((enum tree_code) (tcontext)->base.code) == ENUMERAL_TYPE && !((tree_check ((tcontext), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 853, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))) | |||
854 | tcontext = CP_TYPE_CONTEXT (tcontext)(!(! (((tree_class_check ((tcontext), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 854, __FUNCTION__))->type_common.context)) || ((enum tree_code ) (((tree_class_check ((tcontext), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 854, __FUNCTION__))->type_common.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((tcontext), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 854, __FUNCTION__))->type_common.context) : cp_global_trees [CPTI_GLOBAL]); | |||
855 | ||||
856 | if (class_member_p) | |||
857 | { | |||
858 | tree decl = do_class_using_decl (tcontext, identifier); | |||
859 | ||||
860 | set_access_flags (decl, flags); | |||
861 | ||||
862 | finish_member_declaration (decl); | |||
863 | } | |||
864 | else | |||
865 | { | |||
866 | /* We can't be at local scope. */ | |||
867 | gcc_assert (at_namespace_scope_p ())((void)(!(at_namespace_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 867, __FUNCTION__), 0 : 0)); | |||
868 | finish_nonmember_using_decl (tcontext, identifier); | |||
869 | } | |||
870 | ||||
871 | return 1; | |||
872 | } | |||
873 | ||||
874 | static tree | |||
875 | build_named_class_type (enum tree_code code, | |||
876 | tree id, | |||
877 | location_t loc) | |||
878 | { | |||
879 | /* See at_fake_function_scope_p. */ | |||
880 | gcc_assert (!at_function_scope_p ())((void)(!(!at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 880, __FUNCTION__), 0 : 0)); | |||
881 | tree type = make_class_type (code); | |||
882 | tree type_decl = build_decl (loc, TYPE_DECL, id, type); | |||
883 | TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 883, __FUNCTION__))->type_common.name) = type_decl; | |||
884 | TYPE_STUB_DECL (type)(((contains_struct_check (((tree_class_check ((type), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 884, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 884, __FUNCTION__))->common.chain)) = type_decl; | |||
885 | DECL_CONTEXT (type_decl)((contains_struct_check ((type_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 885, __FUNCTION__))->decl_minimal.context) = TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 885, __FUNCTION__))->type_common.context); | |||
886 | ||||
887 | return type_decl; | |||
888 | } | |||
889 | ||||
890 | /* Abuse an unused field of the dummy template parms entry to hold the | |||
891 | parm list. */ | |||
892 | #define TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 892, __FUNCTION__))->typed.type) TREE_TYPE (current_template_parms)((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 892, __FUNCTION__))->typed.type) | |||
893 | ||||
894 | gcc_decl | |||
895 | plugin_build_decl (cc1_plugin::connection *self, | |||
896 | const char *name, | |||
897 | enum gcc_cp_symbol_kind sym_kind, | |||
898 | gcc_type sym_type_in, | |||
899 | const char *substitution_name, | |||
900 | gcc_address address, | |||
901 | const char *filename, | |||
902 | unsigned int line_number) | |||
903 | { | |||
904 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
905 | gcc_assert (!name || !strchr (name, ':'))((void)(!(!name || !strchr (name, ':')) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 905, __FUNCTION__), 0 : 0)); // FIXME: this can go eventually. | |||
906 | ||||
907 | enum tree_code code; | |||
908 | tree decl; | |||
909 | tree sym_type = convert_in (sym_type_in); | |||
910 | enum gcc_cp_symbol_kind sym_flags; | |||
911 | sym_flags = (enum gcc_cp_symbol_kind) (sym_kind & GCC_CP_FLAG_MASK); | |||
912 | enum gcc_cp_symbol_kind acc_flags; | |||
913 | acc_flags = (enum gcc_cp_symbol_kind) (sym_kind & GCC_CP_ACCESS_MASK); | |||
914 | sym_kind = (enum gcc_cp_symbol_kind) (sym_kind & GCC_CP_SYMBOL_MASK); | |||
915 | ||||
916 | switch (sym_kind) | |||
917 | { | |||
918 | case GCC_CP_SYMBOL_FUNCTION: | |||
919 | code = FUNCTION_DECL; | |||
920 | gcc_assert (!(sym_flags & ~GCC_CP_FLAG_MASK_FUNCTION))((void)(!(!(sym_flags & ~GCC_CP_FLAG_MASK_FUNCTION)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 920, __FUNCTION__), 0 : 0)); | |||
921 | break; | |||
922 | ||||
923 | case GCC_CP_SYMBOL_VARIABLE: | |||
924 | code = VAR_DECL; | |||
925 | gcc_assert (!(sym_flags & ~GCC_CP_FLAG_MASK_VARIABLE))((void)(!(!(sym_flags & ~GCC_CP_FLAG_MASK_VARIABLE)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 925, __FUNCTION__), 0 : 0)); | |||
926 | break; | |||
927 | ||||
928 | case GCC_CP_SYMBOL_TYPEDEF: | |||
929 | code = TYPE_DECL; | |||
930 | gcc_assert (!sym_flags)((void)(!(!sym_flags) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 930, __FUNCTION__), 0 : 0)); | |||
931 | break; | |||
932 | ||||
933 | case GCC_CP_SYMBOL_CLASS: | |||
934 | code = RECORD_TYPE; | |||
935 | gcc_assert (!(sym_flags & ~GCC_CP_FLAG_MASK_CLASS))((void)(!(!(sym_flags & ~GCC_CP_FLAG_MASK_CLASS)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 935, __FUNCTION__), 0 : 0)); | |||
936 | gcc_assert (!sym_type)((void)(!(!sym_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 936, __FUNCTION__), 0 : 0)); | |||
937 | break; | |||
938 | ||||
939 | case GCC_CP_SYMBOL_UNION: | |||
940 | code = UNION_TYPE; | |||
941 | gcc_assert (!sym_flags)((void)(!(!sym_flags) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 941, __FUNCTION__), 0 : 0)); | |||
942 | gcc_assert (!sym_type)((void)(!(!sym_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 942, __FUNCTION__), 0 : 0)); | |||
943 | break; | |||
944 | ||||
945 | default: | |||
946 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 946, __FUNCTION__)); | |||
947 | } | |||
948 | ||||
949 | bool template_decl_p = template_parm_scope_p (); | |||
950 | ||||
951 | if (template_decl_p) | |||
952 | { | |||
953 | gcc_assert (code == FUNCTION_DECL || code == RECORD_TYPE((void)(!(code == FUNCTION_DECL || code == RECORD_TYPE || code == TYPE_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 954, __FUNCTION__), 0 : 0)) | |||
954 | || code == TYPE_DECL)((void)(!(code == FUNCTION_DECL || code == RECORD_TYPE || code == TYPE_DECL) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 954, __FUNCTION__), 0 : 0)); | |||
955 | ||||
956 | /* Finish the template parm list that started this template parm. */ | |||
957 | end_template_parm_list (TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 957, __FUNCTION__))->typed.type)); | |||
958 | ||||
959 | gcc_assert (!address)((void)(!(!address) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 959, __FUNCTION__), 0 : 0)); | |||
960 | gcc_assert (!substitution_name)((void)(!(!substitution_name) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 960, __FUNCTION__), 0 : 0)); | |||
961 | } | |||
962 | ||||
963 | location_t loc = ctx->get_location_t (filename, line_number); | |||
964 | bool class_member_p = at_class_scope_p (); | |||
965 | bool ctor = false, dtor = false, assop = false; | |||
966 | tree_code opcode = ERROR_MARK; | |||
967 | ||||
968 | gcc_assert (!(acc_flags & GCC_CP_ACCESS_MASK) == !class_member_p)((void)(!(!(acc_flags & GCC_CP_ACCESS_MASK) == !class_member_p ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 968, __FUNCTION__), 0 : 0)); | |||
969 | ||||
970 | tree identifier; | |||
971 | if (code != FUNCTION_DECL | |||
972 | || !(sym_flags & GCC_CP_FLAG_SPECIAL_FUNCTION)) | |||
973 | { | |||
974 | if (name) | |||
975 | identifier = get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name ), strlen (name)) : get_identifier (name)); | |||
976 | else | |||
977 | { | |||
978 | gcc_assert (RECORD_OR_UNION_CODE_P (code))((void)(!(((code) == RECORD_TYPE || (code) == UNION_TYPE)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 978, __FUNCTION__), 0 : 0)); | |||
979 | identifier = make_anon_name (); | |||
980 | } | |||
981 | } | |||
982 | ||||
983 | if (code == FUNCTION_DECL) | |||
984 | { | |||
985 | if (sym_flags & GCC_CP_FLAG_SPECIAL_FUNCTION) | |||
986 | { | |||
987 | #define CHARS2(f,s)(((unsigned char)f << 8) | (unsigned char)s) (((unsigned char)f << CHAR_BIT8) | (unsigned char)s) | |||
988 | switch (CHARS2 (name[0], name[1])(((unsigned char)name[0] << 8) | (unsigned char)name[1] )) | |||
989 | { | |||
990 | case CHARS2 ('C', 0x0)(((unsigned char)'C' << 8) | (unsigned char)0x0): // ctor base declaration | |||
991 | case CHARS2 ('C', ' ')(((unsigned char)'C' << 8) | (unsigned char)' '): | |||
992 | case CHARS2 ('C', '1')(((unsigned char)'C' << 8) | (unsigned char)'1'): | |||
993 | case CHARS2 ('C', '2')(((unsigned char)'C' << 8) | (unsigned char)'2'): | |||
994 | case CHARS2 ('C', '4')(((unsigned char)'C' << 8) | (unsigned char)'4'): | |||
995 | ctor = true; | |||
996 | cdtor: | |||
997 | gcc_assert (!address)((void)(!(!address) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 997, __FUNCTION__), 0 : 0)); | |||
998 | gcc_assert (!substitution_name)((void)(!(!substitution_name) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 998, __FUNCTION__), 0 : 0)); | |||
999 | identifier = DECL_NAME (TYPE_NAME (current_class_type))((contains_struct_check ((((tree_class_check ((scope_chain-> class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 999, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 999, __FUNCTION__))->decl_minimal.name); | |||
1000 | break; | |||
1001 | case CHARS2 ('D', 0x0)(((unsigned char)'D' << 8) | (unsigned char)0x0): // dtor base declaration | |||
1002 | case CHARS2 ('D', ' ')(((unsigned char)'D' << 8) | (unsigned char)' '): | |||
1003 | case CHARS2 ('D', '0')(((unsigned char)'D' << 8) | (unsigned char)'0'): | |||
1004 | case CHARS2 ('D', '1')(((unsigned char)'D' << 8) | (unsigned char)'1'): | |||
1005 | case CHARS2 ('D', '2')(((unsigned char)'D' << 8) | (unsigned char)'2'): | |||
1006 | case CHARS2 ('D', '4')(((unsigned char)'D' << 8) | (unsigned char)'4'): | |||
1007 | gcc_assert (!template_decl_p)((void)(!(!template_decl_p) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1007, __FUNCTION__), 0 : 0)); | |||
1008 | dtor = true; | |||
1009 | goto cdtor; | |||
1010 | case CHARS2 ('n', 'w')(((unsigned char)'n' << 8) | (unsigned char)'w'): // operator new | |||
1011 | opcode = NEW_EXPR; | |||
1012 | break; | |||
1013 | case CHARS2 ('n', 'a')(((unsigned char)'n' << 8) | (unsigned char)'a'): // operator new[] | |||
1014 | opcode = VEC_NEW_EXPR; | |||
1015 | break; | |||
1016 | case CHARS2 ('d', 'l')(((unsigned char)'d' << 8) | (unsigned char)'l'): // operator delete | |||
1017 | opcode = DELETE_EXPR; | |||
1018 | break; | |||
1019 | case CHARS2 ('d', 'a')(((unsigned char)'d' << 8) | (unsigned char)'a'): // operator delete[] | |||
1020 | opcode = VEC_DELETE_EXPR; | |||
1021 | break; | |||
1022 | case CHARS2 ('p', 's')(((unsigned char)'p' << 8) | (unsigned char)'s'): // operator + (unary) | |||
1023 | opcode = PLUS_EXPR; | |||
1024 | break; | |||
1025 | case CHARS2 ('n', 'g')(((unsigned char)'n' << 8) | (unsigned char)'g'): // operator - (unary) | |||
1026 | opcode = MINUS_EXPR; | |||
1027 | break; | |||
1028 | case CHARS2 ('a', 'd')(((unsigned char)'a' << 8) | (unsigned char)'d'): // operator & (unary) | |||
1029 | opcode = BIT_AND_EXPR; | |||
1030 | break; | |||
1031 | case CHARS2 ('d', 'e')(((unsigned char)'d' << 8) | (unsigned char)'e'): // operator * (unary) | |||
1032 | opcode = MULT_EXPR; | |||
1033 | break; | |||
1034 | case CHARS2 ('c', 'o')(((unsigned char)'c' << 8) | (unsigned char)'o'): // operator ~ | |||
1035 | opcode = BIT_NOT_EXPR; | |||
1036 | break; | |||
1037 | case CHARS2 ('p', 'l')(((unsigned char)'p' << 8) | (unsigned char)'l'): // operator + | |||
1038 | opcode = PLUS_EXPR; | |||
1039 | break; | |||
1040 | case CHARS2 ('m', 'i')(((unsigned char)'m' << 8) | (unsigned char)'i'): // operator - | |||
1041 | opcode = MINUS_EXPR; | |||
1042 | break; | |||
1043 | case CHARS2 ('m', 'l')(((unsigned char)'m' << 8) | (unsigned char)'l'): // operator * | |||
1044 | opcode = MULT_EXPR; | |||
1045 | break; | |||
1046 | case CHARS2 ('d', 'v')(((unsigned char)'d' << 8) | (unsigned char)'v'): // operator / | |||
1047 | opcode = TRUNC_DIV_EXPR; | |||
1048 | break; | |||
1049 | case CHARS2 ('r', 'm')(((unsigned char)'r' << 8) | (unsigned char)'m'): // operator % | |||
1050 | opcode = TRUNC_MOD_EXPR; | |||
1051 | break; | |||
1052 | case CHARS2 ('a', 'n')(((unsigned char)'a' << 8) | (unsigned char)'n'): // operator & | |||
1053 | opcode = BIT_AND_EXPR; | |||
1054 | break; | |||
1055 | case CHARS2 ('o', 'r')(((unsigned char)'o' << 8) | (unsigned char)'r'): // operator | | |||
1056 | opcode = BIT_IOR_EXPR; | |||
1057 | break; | |||
1058 | case CHARS2 ('e', 'o')(((unsigned char)'e' << 8) | (unsigned char)'o'): // operator ^ | |||
1059 | opcode = BIT_XOR_EXPR; | |||
1060 | break; | |||
1061 | case CHARS2 ('a', 'S')(((unsigned char)'a' << 8) | (unsigned char)'S'): // operator = | |||
1062 | opcode = NOP_EXPR; | |||
1063 | assop = true; | |||
1064 | break; | |||
1065 | case CHARS2 ('p', 'L')(((unsigned char)'p' << 8) | (unsigned char)'L'): // operator += | |||
1066 | opcode = PLUS_EXPR; | |||
1067 | assop = true; | |||
1068 | break; | |||
1069 | case CHARS2 ('m', 'I')(((unsigned char)'m' << 8) | (unsigned char)'I'): // operator -= | |||
1070 | opcode = MINUS_EXPR; | |||
1071 | assop = true; | |||
1072 | break; | |||
1073 | case CHARS2 ('m', 'L')(((unsigned char)'m' << 8) | (unsigned char)'L'): // operator *= | |||
1074 | opcode = MULT_EXPR; | |||
1075 | assop = true; | |||
1076 | break; | |||
1077 | case CHARS2 ('d', 'V')(((unsigned char)'d' << 8) | (unsigned char)'V'): // operator /= | |||
1078 | opcode = TRUNC_DIV_EXPR; | |||
1079 | assop = true; | |||
1080 | break; | |||
1081 | case CHARS2 ('r', 'M')(((unsigned char)'r' << 8) | (unsigned char)'M'): // operator %= | |||
1082 | opcode = TRUNC_MOD_EXPR; | |||
1083 | assop = true; | |||
1084 | break; | |||
1085 | case CHARS2 ('a', 'N')(((unsigned char)'a' << 8) | (unsigned char)'N'): // operator &= | |||
1086 | opcode = BIT_AND_EXPR; | |||
1087 | assop = true; | |||
1088 | break; | |||
1089 | case CHARS2 ('o', 'R')(((unsigned char)'o' << 8) | (unsigned char)'R'): // operator |= | |||
1090 | opcode = BIT_IOR_EXPR; | |||
1091 | assop = true; | |||
1092 | break; | |||
1093 | case CHARS2 ('e', 'O')(((unsigned char)'e' << 8) | (unsigned char)'O'): // operator ^= | |||
1094 | opcode = BIT_XOR_EXPR; | |||
1095 | assop = true; | |||
1096 | break; | |||
1097 | case CHARS2 ('l', 's')(((unsigned char)'l' << 8) | (unsigned char)'s'): // operator << | |||
1098 | opcode = LSHIFT_EXPR; | |||
1099 | break; | |||
1100 | case CHARS2 ('r', 's')(((unsigned char)'r' << 8) | (unsigned char)'s'): // operator >> | |||
1101 | opcode = RSHIFT_EXPR; | |||
1102 | break; | |||
1103 | case CHARS2 ('l', 'S')(((unsigned char)'l' << 8) | (unsigned char)'S'): // operator <<= | |||
1104 | opcode = LSHIFT_EXPR; | |||
1105 | assop = true; | |||
1106 | break; | |||
1107 | case CHARS2 ('r', 'S')(((unsigned char)'r' << 8) | (unsigned char)'S'): // operator >>= | |||
1108 | opcode = RSHIFT_EXPR; | |||
1109 | assop = true; | |||
1110 | break; | |||
1111 | case CHARS2 ('e', 'q')(((unsigned char)'e' << 8) | (unsigned char)'q'): // operator == | |||
1112 | opcode = EQ_EXPR; | |||
1113 | break; | |||
1114 | case CHARS2 ('n', 'e')(((unsigned char)'n' << 8) | (unsigned char)'e'): // operator != | |||
1115 | opcode = NE_EXPR; | |||
1116 | break; | |||
1117 | case CHARS2 ('l', 't')(((unsigned char)'l' << 8) | (unsigned char)'t'): // operator < | |||
1118 | opcode = LT_EXPR; | |||
1119 | break; | |||
1120 | case CHARS2 ('g', 't')(((unsigned char)'g' << 8) | (unsigned char)'t'): // operator > | |||
1121 | opcode = GT_EXPR; | |||
1122 | break; | |||
1123 | case CHARS2 ('l', 'e')(((unsigned char)'l' << 8) | (unsigned char)'e'): // operator <= | |||
1124 | opcode = LE_EXPR; | |||
1125 | break; | |||
1126 | case CHARS2 ('g', 'e')(((unsigned char)'g' << 8) | (unsigned char)'e'): // operator >= | |||
1127 | opcode = GE_EXPR; | |||
1128 | break; | |||
1129 | case CHARS2 ('n', 't')(((unsigned char)'n' << 8) | (unsigned char)'t'): // operator ! | |||
1130 | opcode = TRUTH_NOT_EXPR; | |||
1131 | break; | |||
1132 | case CHARS2 ('a', 'a')(((unsigned char)'a' << 8) | (unsigned char)'a'): // operator && | |||
1133 | opcode = TRUTH_ANDIF_EXPR; | |||
1134 | break; | |||
1135 | case CHARS2 ('o', 'o')(((unsigned char)'o' << 8) | (unsigned char)'o'): // operator || | |||
1136 | opcode = TRUTH_ORIF_EXPR; | |||
1137 | break; | |||
1138 | case CHARS2 ('p', 'p')(((unsigned char)'p' << 8) | (unsigned char)'p'): // operator ++ | |||
1139 | opcode = POSTINCREMENT_EXPR; | |||
1140 | break; | |||
1141 | case CHARS2 ('m', 'm')(((unsigned char)'m' << 8) | (unsigned char)'m'): // operator -- | |||
1142 | /* This stands for either one as an operator name, and | |||
1143 | "pp" and "mm" stand for POST??CREMENT, but for some | |||
1144 | reason the parser uses this opcode name for | |||
1145 | operator--; let's follow their practice. */ | |||
1146 | opcode = PREDECREMENT_EXPR; | |||
1147 | break; | |||
1148 | case CHARS2 ('c', 'm')(((unsigned char)'c' << 8) | (unsigned char)'m'): // operator , | |||
1149 | opcode = COMPOUND_EXPR; | |||
1150 | break; | |||
1151 | case CHARS2 ('p', 'm')(((unsigned char)'p' << 8) | (unsigned char)'m'): // operator ->* | |||
1152 | opcode = MEMBER_REF; | |||
1153 | break; | |||
1154 | case CHARS2 ('p', 't')(((unsigned char)'p' << 8) | (unsigned char)'t'): // operator -> | |||
1155 | opcode = COMPONENT_REF; | |||
1156 | break; | |||
1157 | case CHARS2 ('c', 'l')(((unsigned char)'c' << 8) | (unsigned char)'l'): // operator () | |||
1158 | opcode = CALL_EXPR; | |||
1159 | break; | |||
1160 | case CHARS2 ('i', 'x')(((unsigned char)'i' << 8) | (unsigned char)'x'): // operator [] | |||
1161 | opcode = ARRAY_REF; | |||
1162 | break; | |||
1163 | case CHARS2 ('c', 'v')(((unsigned char)'c' << 8) | (unsigned char)'v'): // operator <T> (conversion operator) | |||
1164 | identifier = make_conv_op_name (TREE_TYPE (sym_type)((contains_struct_check ((sym_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1164, __FUNCTION__))->typed.type)); | |||
1165 | break; | |||
1166 | // C++11-only: | |||
1167 | case CHARS2 ('l', 'i')(((unsigned char)'l' << 8) | (unsigned char)'i'): // operator "" <id> | |||
1168 | { | |||
1169 | char *id = (char *)name + 2; | |||
1170 | bool freeid = false; | |||
1171 | if (*id >= '0' && *id <= '9') | |||
1172 | { | |||
1173 | unsigned len = 0; | |||
1174 | do | |||
1175 | { | |||
1176 | len *= 10; | |||
1177 | len += id[0] - '0'; | |||
1178 | id++; | |||
1179 | } | |||
1180 | while (*id && *id >= '0' && *id <= '9'); | |||
1181 | id = xstrndup (id, len); | |||
1182 | freeid = true; | |||
1183 | } | |||
1184 | identifier = cp_literal_operator_id (id); | |||
1185 | if (freeid) | |||
1186 | free (id); | |||
1187 | } | |||
1188 | break; | |||
1189 | case CHARS2 ('q', 'u')(((unsigned char)'q' << 8) | (unsigned char)'u'): // ternary operator, not overloadable. | |||
1190 | default: | |||
1191 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1191, __FUNCTION__)); | |||
1192 | } | |||
1193 | ||||
1194 | if (opcode != ERROR_MARK) | |||
1195 | identifier = ovl_op_identifier (assop, opcode); | |||
1196 | } | |||
1197 | decl = build_lang_decl_loc (loc, code, identifier, sym_type); | |||
1198 | /* FIXME: current_lang_name is lang_name_c while compiling an | |||
1199 | extern "C" function, and we haven't switched to a global | |||
1200 | context at this point, and this breaks function | |||
1201 | overloading. */ | |||
1202 | SET_DECL_LANGUAGE (decl, lang_cplusplus)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1202, __FUNCTION__))->decl_common.lang_specific)->u.base .language = (lang_cplusplus)); | |||
1203 | if (TREE_CODE (sym_type)((enum tree_code) (sym_type)->base.code) == METHOD_TYPE) | |||
1204 | DECL_ARGUMENTS (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1204, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = build_this_parm (decl, current_class_typescope_chain->class_type, | |||
1205 | cp_type_quals (sym_type)); | |||
1206 | for (tree arg = TREE_CODE (sym_type)((enum tree_code) (sym_type)->base.code) == METHOD_TYPE | |||
1207 | ? TREE_CHAIN (TYPE_ARG_TYPES (sym_type))((contains_struct_check ((((tree_check2 ((sym_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1207, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1207, __FUNCTION__))->common.chain) | |||
1208 | : TYPE_ARG_TYPES (sym_type)((tree_check2 ((sym_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1208, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); | |||
1209 | arg && arg != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; | |||
1210 | arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1210, __FUNCTION__))->common.chain)) | |||
1211 | { | |||
1212 | tree parm = cp_build_parm_decl (decl, NULL_TREE(tree) nullptr, TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1212, __FUNCTION__, (TREE_LIST)))->list.value)); | |||
1213 | DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1213, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1213, __FUNCTION__))->common.chain)) = DECL_ARGUMENTS (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1213, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); | |||
1214 | DECL_ARGUMENTS (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1214, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = parm; | |||
1215 | } | |||
1216 | DECL_ARGUMENTS (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1216, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = nreverse (DECL_ARGUMENTS (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1216, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )); | |||
1217 | if (class_member_p) | |||
1218 | { | |||
1219 | if (TREE_CODE (sym_type)((enum tree_code) (sym_type)->base.code) == FUNCTION_TYPE) | |||
1220 | DECL_STATIC_FUNCTION_P (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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1220, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1220, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1220, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) nullptr && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1220, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1220, __FUNCTION__); <->u.fn; })->static_function ) = 1; | |||
1221 | if (sym_flags & GCC_CP_FLAG_VIRTUAL_FUNCTION) | |||
1222 | { | |||
1223 | DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1223, __FUNCTION__))->decl_common.virtual_flag) = 1; | |||
1224 | if (sym_flags & GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION) | |||
1225 | DECL_PURE_VIRTUAL_P (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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1225, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1225, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1225, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) nullptr && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1225, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1225, __FUNCTION__); <->u.fn; })->pure_virtual) = 1; | |||
1226 | if (sym_flags & GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION) | |||
1227 | DECL_FINAL_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1227, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.final ) = 1; | |||
1228 | } | |||
1229 | else | |||
1230 | gcc_assert (!(sym_flags & (GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION((void)(!(!(sym_flags & (GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION | GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1231, __FUNCTION__), 0 : 0)) | |||
1231 | | GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION)))((void)(!(!(sym_flags & (GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION | GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1231, __FUNCTION__), 0 : 0)); | |||
1232 | } | |||
1233 | else | |||
1234 | { | |||
1235 | gcc_assert (!(sym_flags & (GCC_CP_FLAG_VIRTUAL_FUNCTION((void)(!(!(sym_flags & (GCC_CP_FLAG_VIRTUAL_FUNCTION | GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION | GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1237, __FUNCTION__), 0 : 0)) | |||
1236 | | GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION((void)(!(!(sym_flags & (GCC_CP_FLAG_VIRTUAL_FUNCTION | GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION | GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1237, __FUNCTION__), 0 : 0)) | |||
1237 | | GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION)))((void)(!(!(sym_flags & (GCC_CP_FLAG_VIRTUAL_FUNCTION | GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION | GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1237, __FUNCTION__), 0 : 0)); | |||
1238 | gcc_assert (!ctor && !dtor && !assop)((void)(!(!ctor && !dtor && !assop) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1238, __FUNCTION__), 0 : 0)); | |||
1239 | } | |||
1240 | if (sym_flags & GCC_CP_FLAG_EXPLICIT_FUNCTION) | |||
1241 | DECL_NONCONVERTING_P (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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1241, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1241, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1241, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) nullptr && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1241, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1241, __FUNCTION__); <->u.fn; })->nonconverting ) = 1; | |||
1242 | if (sym_flags & GCC_CP_FLAG_DEFAULTED_FUNCTION) | |||
1243 | { | |||
1244 | DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1244, __FUNCTION__))->decl_common.initial) = ridpointers[(int)RID_DEFAULT]; | |||
1245 | 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1245, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1245, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1245, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) nullptr && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1245, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1245, __FUNCTION__); <->u.fn; })->defaulted_p) = 1; | |||
1246 | } | |||
1247 | if (sym_flags & GCC_CP_FLAG_DELETED_FUNCTION) | |||
1248 | { | |||
1249 | // DECL_INITIAL (decl) = ridpointers[(int)RID_DELETE]; | |||
1250 | DECL_DELETED_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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1250, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1250, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1250, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) nullptr && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1250, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1250, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = 1; | |||
1251 | DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1251, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) = 1; | |||
1252 | DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1252, __FUNCTION__))->decl_common.initial) = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | |||
1253 | } | |||
1254 | ||||
1255 | if (ctor) | |||
1256 | DECL_CXX_CONSTRUCTOR_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1256, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) = 1; | |||
1257 | else if (dtor) | |||
1258 | DECL_CXX_DESTRUCTOR_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1258, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) = 1; | |||
1259 | else if ((sym_flags & GCC_CP_FLAG_SPECIAL_FUNCTION) | |||
1260 | && opcode != ERROR_MARK) | |||
1261 | DECL_OVERLOADED_OPERATOR_CODE_RAW (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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1261, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1261, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1261, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) nullptr && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1261, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1261, __FUNCTION__); <->u.fn; })->ovl_op_code) = ovl_op_mapping[opcode]; | |||
1262 | } | |||
1263 | else if (RECORD_OR_UNION_CODE_P (code)((code) == RECORD_TYPE || (code) == UNION_TYPE)) | |||
1264 | { | |||
1265 | decl = build_named_class_type (code, identifier, loc); | |||
1266 | tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1266, __FUNCTION__))->typed.type); | |||
1267 | ||||
1268 | if (code == RECORD_TYPE | |||
1269 | && !(sym_flags & GCC_CP_FLAG_CLASS_IS_STRUCT)) | |||
1270 | CLASSTYPE_DECLARED_CLASS (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1270, __FUNCTION__))->type_with_lang_specific.lang_specific ))->declared_class) = true; | |||
1271 | } | |||
1272 | else if (class_member_p) | |||
1273 | { | |||
1274 | decl = build_lang_decl_loc (loc, code, identifier, sym_type); | |||
1275 | ||||
1276 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == VAR_DECL) | |||
1277 | { | |||
1278 | DECL_THIS_STATIC (decl)((contains_struct_check (((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1278, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL )))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1278, __FUNCTION__))->decl_common.lang_flag_6) = 1; | |||
1279 | // The remainder of this block does the same as: | |||
1280 | // set_linkage_for_static_data_member (decl); | |||
1281 | TREE_PUBLIC (decl)((decl)->base.public_flag) = 1; | |||
1282 | TREE_STATIC (decl)((decl)->base.static_flag) = 1; | |||
1283 | DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1283, __FUNCTION__))->decl_common.lang_flag_5) = 1; | |||
1284 | ||||
1285 | // FIXME: sym_flags & GCC_CP_FLAG_THREAD_LOCAL_VARIABLE | |||
1286 | gcc_assert (!(sym_flags & GCC_CP_FLAG_THREAD_LOCAL_VARIABLE))((void)(!(!(sym_flags & GCC_CP_FLAG_THREAD_LOCAL_VARIABLE )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1286, __FUNCTION__), 0 : 0)); | |||
1287 | ||||
1288 | if (sym_flags & GCC_CP_FLAG_CONSTEXPR_VARIABLE) | |||
1289 | DECL_DECLARED_CONSTEXPR_P (decl)((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 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1289, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1289, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1289, __FUNCTION__))->decl_common.lang_flag_8) = true; | |||
1290 | } | |||
1291 | } | |||
1292 | else | |||
1293 | { | |||
1294 | decl = build_decl (loc, code, identifier, sym_type); | |||
1295 | ||||
1296 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == VAR_DECL) | |||
1297 | { | |||
1298 | // FIXME: sym_flags & GCC_CP_FLAG_THREAD_LOCAL_VARIABLE | |||
1299 | gcc_assert (!(sym_flags & GCC_CP_FLAG_THREAD_LOCAL_VARIABLE))((void)(!(!(sym_flags & GCC_CP_FLAG_THREAD_LOCAL_VARIABLE )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1299, __FUNCTION__), 0 : 0)); | |||
1300 | ||||
1301 | if (sym_flags & GCC_CP_FLAG_CONSTEXPR_VARIABLE) | |||
1302 | DECL_DECLARED_CONSTEXPR_P (decl)((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 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1302, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1302, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1302, __FUNCTION__))->decl_common.lang_flag_8) = true; | |||
1303 | } | |||
1304 | } | |||
1305 | TREE_USED (decl)((decl)->base.used_flag) = 1; | |||
1306 | TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1; | |||
1307 | ||||
1308 | if (class_member_p) | |||
1309 | DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1309, __FUNCTION__))->decl_minimal.context) = FROB_CONTEXT (current_class_type)((scope_chain->class_type) == cp_global_trees[CPTI_GLOBAL] ? ((contains_struct_check ((scope_chain->class_type), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1309, __FUNCTION__))->decl_minimal.context) : (scope_chain ->class_type)); | |||
1310 | else if (at_namespace_scope_p ()) | |||
1311 | DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1311, __FUNCTION__))->decl_minimal.context) = FROB_CONTEXT (current_decl_namespace ())((current_decl_namespace ()) == cp_global_trees[CPTI_GLOBAL] ? ((contains_struct_check ((current_decl_namespace ()), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1311, __FUNCTION__))->decl_minimal.context) : (current_decl_namespace ())); | |||
1312 | ||||
1313 | set_access_flags (decl, acc_flags); | |||
1314 | ||||
1315 | /* If this is the typedef that names an otherwise anonymous type, | |||
1316 | propagate the typedef name to the type. In normal compilation, | |||
1317 | this is done in grokdeclarator. */ | |||
1318 | if (sym_kind == GCC_CP_SYMBOL_TYPEDEF | |||
1319 | && !template_decl_p | |||
1320 | && DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1320, __FUNCTION__))->decl_minimal.context) == TYPE_CONTEXT (sym_type)((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1320, __FUNCTION__))->type_common.context) | |||
1321 | && TYPE_UNNAMED_P (sym_type)((((((tree_class_check ((((tree_class_check ((sym_type), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((sym_type), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag )) && !((tree_check ((((((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((sym_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1321, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag ))) | |||
1322 | name_unnamed_type (sym_type, decl); | |||
1323 | ||||
1324 | if (sym_kind != GCC_CP_SYMBOL_TYPEDEF | |||
1325 | && sym_kind != GCC_CP_SYMBOL_CLASS | |||
1326 | && sym_kind != GCC_CP_SYMBOL_UNION | |||
1327 | && !template_decl_p && !ctor && !dtor) | |||
1328 | { | |||
1329 | decl_addr_value value; | |||
1330 | ||||
1331 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1331, __FUNCTION__))->decl_common.decl_flag_1) = 1; | |||
1332 | value.decl = decl; | |||
1333 | if (substitution_name != NULLnullptr) | |||
1334 | { | |||
1335 | // If the translator gave us a name without a binding, | |||
1336 | // we can just substitute error_mark_node, since we know the | |||
1337 | // translator will be reporting an error anyhow. | |||
1338 | value.address | |||
1339 | = lookup_name (get_identifier (substitution_name)(__builtin_constant_p (substitution_name) ? get_identifier_with_length ((substitution_name), strlen (substitution_name)) : get_identifier (substitution_name))); | |||
1340 | if (value.address == NULL_TREE(tree) nullptr) | |||
1341 | value.address = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | |||
1342 | } | |||
1343 | else if (address) | |||
1344 | value.address = build_int_cst_type (ptr_type_nodeglobal_trees[TI_PTR_TYPE], address); | |||
1345 | else | |||
1346 | value.address = NULLnullptr; | |||
1347 | if (value.address) | |||
1348 | record_decl_address (ctx, value); | |||
1349 | } | |||
1350 | ||||
1351 | if (class_member_p && code == FUNCTION_DECL) | |||
1352 | { | |||
1353 | if (ctor || dtor) | |||
1354 | maybe_retrofit_in_chrg (decl); | |||
1355 | ||||
1356 | grok_special_member_properties (decl); | |||
1357 | } | |||
1358 | ||||
1359 | if (template_decl_p) | |||
1360 | { | |||
1361 | if (RECORD_OR_UNION_CODE_P (code)((code) == RECORD_TYPE || (code) == UNION_TYPE)) | |||
1362 | safe_pushtag (identifier, TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1362, __FUNCTION__))->typed.type)); | |||
1363 | else | |||
1364 | decl = safe_push_template_decl (decl); | |||
1365 | ||||
1366 | tree tdecl = NULL_TREE(tree) nullptr; | |||
1367 | if (class_member_p) | |||
1368 | tdecl = finish_member_template_decl (decl); | |||
1369 | ||||
1370 | end_template_decl (); | |||
1371 | ||||
1372 | /* We only support one level of templates, because we only | |||
1373 | support declaring generics; actual definitions are only of | |||
1374 | specializations. */ | |||
1375 | gcc_assert (!template_parm_scope_p ())((void)(!(!template_parm_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1375, __FUNCTION__), 0 : 0)); | |||
1376 | ||||
1377 | if (class_member_p) | |||
1378 | finish_member_declaration (tdecl); | |||
1379 | } | |||
1380 | else if (RECORD_OR_UNION_CODE_P (code)((code) == RECORD_TYPE || (code) == UNION_TYPE)) | |||
1381 | safe_pushtag (identifier, TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1381, __FUNCTION__))->typed.type)); | |||
1382 | else if (class_member_p) | |||
1383 | finish_member_declaration (decl); | |||
1384 | else | |||
1385 | decl = safe_pushdecl (decl); | |||
1386 | ||||
1387 | if ((ctor || dtor) | |||
1388 | /* Don't crash after a duplicate declaration of a cdtor. */ | |||
1389 | && TYPE_FIELDS (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1389, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == decl) | |||
1390 | { | |||
1391 | /* ctors and dtors clones are chained after DECL. | |||
1392 | However, we create the clones before TYPE_METHODS is | |||
1393 | reversed. We test for cloned methods after reversal, | |||
1394 | however, and the test requires the clones to follow | |||
1395 | DECL. So, we reverse the chain of clones now, so | |||
1396 | that it will come out in the right order after | |||
1397 | reversal. */ | |||
1398 | tree save = DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1398, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1398, __FUNCTION__))->common.chain)); | |||
1399 | DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1399, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1399, __FUNCTION__))->common.chain)) = NULL_TREE(tree) nullptr; | |||
1400 | clone_cdtor (decl, /*update_methods=*/true); | |||
1401 | gcc_assert (TYPE_FIELDS (current_class_type) == decl)((void)(!(((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1401, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1401, __FUNCTION__), 0 : 0)); | |||
1402 | TYPE_FIELDS (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1402, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) | |||
1403 | = nreverse (TYPE_FIELDS (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1403, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)); | |||
1404 | DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1404, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1404, __FUNCTION__))->common.chain)) = save; | |||
1405 | } | |||
1406 | ||||
1407 | rest_of_decl_compilation (decl, toplevel_bindings_p (), 0); | |||
1408 | ||||
1409 | return convert_out (ctx->preserve (decl)); | |||
1410 | } | |||
1411 | ||||
1412 | gcc_decl | |||
1413 | plugin_define_cdtor_clone (cc1_plugin::connection *self, | |||
1414 | const char *name, | |||
1415 | gcc_decl cdtor_in, | |||
1416 | gcc_address address) | |||
1417 | { | |||
1418 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1419 | tree decl = convert_in (cdtor_in); | |||
1420 | bool ctor = false; | |||
1421 | bool dtor = false; | |||
1422 | tree identifier; | |||
1423 | ||||
1424 | switch (CHARS2 (name[0], name[1])(((unsigned char)name[0] << 8) | (unsigned char)name[1] )) | |||
1425 | { | |||
1426 | case CHARS2 ('C', '1')(((unsigned char)'C' << 8) | (unsigned char)'1'): // in-charge constructor | |||
1427 | identifier = complete_ctor_identifiercp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER]; | |||
1428 | ctor = true; | |||
1429 | break; | |||
1430 | case CHARS2 ('C', '2')(((unsigned char)'C' << 8) | (unsigned char)'2'): // not-in-charge constructor | |||
1431 | identifier = base_ctor_identifiercp_global_trees[CPTI_BASE_CTOR_IDENTIFIER]; | |||
1432 | ctor = true; | |||
1433 | break; | |||
1434 | case CHARS2 ('C', '4')(((unsigned char)'C' << 8) | (unsigned char)'4'): | |||
1435 | identifier = ctor_identifiercp_global_trees[CPTI_CTOR_IDENTIFIER]; // unified constructor | |||
1436 | ctor = true; | |||
1437 | break; | |||
1438 | case CHARS2 ('D', '0')(((unsigned char)'D' << 8) | (unsigned char)'0'): // deleting destructor | |||
1439 | identifier = deleting_dtor_identifiercp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER]; | |||
1440 | dtor = true; | |||
1441 | break; | |||
1442 | case CHARS2 ('D', '1')(((unsigned char)'D' << 8) | (unsigned char)'1'): // in-charge destructor | |||
1443 | identifier = complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER]; | |||
1444 | dtor = true; | |||
1445 | break; | |||
1446 | case CHARS2 ('D', '2')(((unsigned char)'D' << 8) | (unsigned char)'2'): // not-in-charge destructor | |||
1447 | identifier = base_dtor_identifiercp_global_trees[CPTI_BASE_DTOR_IDENTIFIER]; | |||
1448 | dtor = true; | |||
1449 | break; | |||
1450 | case CHARS2 ('D', '4')(((unsigned char)'D' << 8) | (unsigned char)'4'): | |||
1451 | identifier = dtor_identifiercp_global_trees[CPTI_DTOR_IDENTIFIER]; // unified destructor | |||
1452 | dtor = true; | |||
1453 | break; | |||
1454 | ||||
1455 | default: | |||
1456 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1456, __FUNCTION__)); | |||
1457 | } | |||
1458 | ||||
1459 | gcc_assert (!ctor != !dtor)((void)(!(!ctor != !dtor) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1459, __FUNCTION__), 0 : 0)); | |||
1460 | gcc_assert (ctor((void)(!(ctor ? ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1461, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1462, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) : ((((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1463, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__), 0 : 0)) | |||
1461 | ? (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl)((void)(!(ctor ? ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1461, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1462, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) : ((((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1463, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__), 0 : 0)) | |||
1462 | && DECL_NAME (decl) == ctor_identifier)((void)(!(ctor ? ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1461, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1462, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) : ((((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1463, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__), 0 : 0)) | |||
1463 | : (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)((void)(!(ctor ? ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1461, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1462, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) : ((((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1463, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__), 0 : 0)) | |||
1464 | && DECL_NAME (decl) == dtor_identifier))((void)(!(ctor ? ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1461, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1462, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) : ((((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1463, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]) && ((contains_struct_check (( decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1464, __FUNCTION__), 0 : 0)); | |||
1465 | ||||
1466 | while (decl && DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1466, __FUNCTION__))->decl_minimal.name) != identifier) | |||
1467 | { | |||
1468 | decl = DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1468, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1468, __FUNCTION__))->common.chain)); | |||
1469 | if (decl && !DECL_CLONED_FUNCTION_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1469, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) | |||
1470 | decl = NULL_TREE(tree) nullptr; | |||
1471 | } | |||
1472 | gcc_assert (decl)((void)(!(decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1472, __FUNCTION__), 0 : 0)); | |||
1473 | ||||
1474 | record_decl_address (ctx, build_decl_addr_value (decl, address)); | |||
1475 | ||||
1476 | return convert_out (decl); | |||
1477 | } | |||
1478 | ||||
1479 | int | |||
1480 | plugin_add_friend (cc1_plugin::connection * /* self */, | |||
1481 | gcc_decl decl_in, | |||
1482 | gcc_type type_in) | |||
1483 | { | |||
1484 | tree decl = convert_in (decl_in); | |||
1485 | tree type = convert_in (type_in); | |||
1486 | ||||
1487 | gcc_assert (type || at_class_scope_p ())((void)(!(type || at_class_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1487, __FUNCTION__), 0 : 0)); | |||
1488 | ||||
1489 | if (!type) | |||
1490 | type = current_class_typescope_chain->class_type; | |||
1491 | else | |||
1492 | gcc_assert (TREE_CODE (type) == RECORD_TYPE)((void)(!(((enum tree_code) (type)->base.code) == RECORD_TYPE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1492, __FUNCTION__), 0 : 0)); | |||
1493 | ||||
1494 | if (TYPE_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (decl)->base.code))] == tcc_type)) | |||
1495 | make_friend_class (type, TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1495, __FUNCTION__))->typed.type), true); | |||
1496 | else | |||
1497 | { | |||
1498 | DECL_UNIQUE_FRIEND_P (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1498, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1498, __FUNCTION__))->decl_common.lang_specific) ->u. base.friend_or_tls) = true; | |||
1499 | add_friend (type, decl, true); | |||
1500 | } | |||
1501 | ||||
1502 | return 1; | |||
1503 | } | |||
1504 | ||||
1505 | gcc_type | |||
1506 | plugin_build_pointer_type (cc1_plugin::connection *, | |||
1507 | gcc_type base_type) | |||
1508 | { | |||
1509 | // No need to preserve a pointer type as the base type is preserved. | |||
1510 | return convert_out (build_pointer_type (convert_in (base_type))); | |||
1511 | } | |||
1512 | ||||
1513 | gcc_type | |||
1514 | plugin_build_reference_type (cc1_plugin::connection *, | |||
1515 | gcc_type base_type_in, | |||
1516 | enum gcc_cp_ref_qualifiers rquals) | |||
1517 | { | |||
1518 | bool rval; | |||
1519 | ||||
1520 | switch (rquals) | |||
1521 | { | |||
1522 | case GCC_CP_REF_QUAL_LVALUE: | |||
1523 | rval = false; | |||
1524 | break; | |||
1525 | case GCC_CP_REF_QUAL_RVALUE: | |||
1526 | rval = true; | |||
1527 | break; | |||
1528 | case GCC_CP_REF_QUAL_NONE: | |||
1529 | default: | |||
1530 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1530, __FUNCTION__)); | |||
1531 | } | |||
1532 | ||||
1533 | tree rtype = cp_build_reference_type (convert_in (base_type_in), rval); | |||
1534 | ||||
1535 | return convert_out (rtype); | |||
1536 | } | |||
1537 | ||||
1538 | static tree | |||
1539 | start_class_def (tree type, | |||
1540 | const gcc_vbase_array *base_classes) | |||
1541 | { | |||
1542 | tree bases = NULLnullptr; | |||
1543 | if (base_classes) | |||
1544 | { | |||
1545 | for (int i = 0; i < base_classes->n_elements; i++) | |||
1546 | { | |||
1547 | tree access; | |||
1548 | ||||
1549 | gcc_assert ((base_classes->flags[i] & GCC_CP_SYMBOL_MASK)((void)(!((base_classes->flags[i] & GCC_CP_SYMBOL_MASK ) == GCC_CP_SYMBOL_BASECLASS) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1550, __FUNCTION__), 0 : 0)) | |||
1550 | == GCC_CP_SYMBOL_BASECLASS)((void)(!((base_classes->flags[i] & GCC_CP_SYMBOL_MASK ) == GCC_CP_SYMBOL_BASECLASS) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1550, __FUNCTION__), 0 : 0)); | |||
1551 | ||||
1552 | switch (base_classes->flags[i] & GCC_CP_ACCESS_MASK) | |||
1553 | { | |||
1554 | case GCC_CP_ACCESS_PRIVATE: | |||
1555 | access = ridpointers[(int)RID_PRIVATE]; | |||
1556 | break; | |||
1557 | ||||
1558 | case GCC_CP_ACCESS_PROTECTED: | |||
1559 | access = ridpointers[(int)RID_PROTECTED]; | |||
1560 | break; | |||
1561 | ||||
1562 | case GCC_CP_ACCESS_PUBLIC: | |||
1563 | access = ridpointers[(int)RID_PUBLIC]; | |||
1564 | break; | |||
1565 | ||||
1566 | default: | |||
1567 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1567, __FUNCTION__)); | |||
1568 | } | |||
1569 | ||||
1570 | tree base = finish_base_specifier | |||
1571 | (convert_in (base_classes->elements[i]), access, | |||
1572 | (base_classes->flags[i] & GCC_CP_FLAG_BASECLASS_VIRTUAL) != 0); | |||
1573 | TREE_CHAIN (base)((contains_struct_check ((base), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1573, __FUNCTION__))->common.chain) = bases; | |||
1574 | bases = base; | |||
1575 | } | |||
1576 | bases = nreverse (bases); | |||
1577 | } | |||
1578 | xref_basetypes (type, bases); | |||
1579 | begin_class_definition (type); | |||
1580 | return type; | |||
1581 | } | |||
1582 | ||||
1583 | gcc_type | |||
1584 | plugin_start_class_type (cc1_plugin::connection *self, | |||
1585 | gcc_decl typedecl_in, | |||
1586 | const gcc_vbase_array *base_classes, | |||
1587 | const char *filename, | |||
1588 | unsigned int line_number) | |||
1589 | { | |||
1590 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1591 | location_t loc = ctx->get_location_t (filename, line_number); | |||
1592 | tree typedecl = convert_in (typedecl_in); | |||
1593 | tree type = TREE_TYPE (typedecl)((contains_struct_check ((typedecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1593, __FUNCTION__))->typed.type); | |||
1594 | ||||
1595 | gcc_assert (RECORD_OR_UNION_CODE_P (TREE_CODE (type)))((void)(!(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1595, __FUNCTION__), 0 : 0)); | |||
1596 | gcc_assert (!COMPLETE_TYPE_P (type))((void)(!(!(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1596, __FUNCTION__))->type_common.size) != (tree) nullptr )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1596, __FUNCTION__), 0 : 0)); | |||
1597 | ||||
1598 | DECL_SOURCE_LOCATION (typedecl)((contains_struct_check ((typedecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1598, __FUNCTION__))->decl_minimal.locus) = loc; | |||
1599 | ||||
1600 | tree result = start_class_def (type, base_classes); | |||
1601 | ||||
1602 | return convert_out (ctx->preserve (result)); | |||
1603 | } | |||
1604 | ||||
1605 | gcc_type | |||
1606 | plugin_start_closure_class_type (cc1_plugin::connection *self, | |||
1607 | int discriminator, | |||
1608 | gcc_decl extra_scope_in, | |||
1609 | enum gcc_cp_symbol_kind flags, | |||
1610 | const char *filename, | |||
1611 | unsigned int line_number) | |||
1612 | { | |||
1613 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1614 | tree extra_scope = convert_in (extra_scope_in); | |||
1615 | ||||
1616 | gcc_assert ((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_LAMBDA_CLOSURE)((void)(!((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_LAMBDA_CLOSURE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1616, __FUNCTION__), 0 : 0)); | |||
1617 | gcc_assert ((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK))) == 0)((void)(!((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK ))) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1617, __FUNCTION__), 0 : 0)); | |||
1618 | ||||
1619 | gcc_assert (!(flags & GCC_CP_ACCESS_MASK) == !at_class_scope_p ())((void)(!(!(flags & GCC_CP_ACCESS_MASK) == !at_class_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1619, __FUNCTION__), 0 : 0)); | |||
1620 | ||||
1621 | /* See at_fake_function_scope_p. */ | |||
1622 | gcc_assert (!at_function_scope_p ())((void)(!(!at_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1622, __FUNCTION__), 0 : 0)); | |||
1623 | ||||
1624 | if (extra_scope) | |||
1625 | { | |||
1626 | if (TREE_CODE (extra_scope)((enum tree_code) (extra_scope)->base.code) == PARM_DECL) | |||
1627 | { | |||
1628 | gcc_assert (at_fake_function_scope_p ())((void)(!(at_fake_function_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1628, __FUNCTION__), 0 : 0)); | |||
1629 | /* Check that the given extra_scope is one of the parameters of | |||
1630 | the current function. */ | |||
1631 | for (tree parm = DECL_ARGUMENTS (current_function_decl)((tree_check ((current_function_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1631, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); | |||
1632 | ; parm = DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1632, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1632, __FUNCTION__))->common.chain))) | |||
1633 | { | |||
1634 | gcc_assert (parm)((void)(!(parm) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1634, __FUNCTION__), 0 : 0)); | |||
1635 | if (parm == extra_scope) | |||
1636 | break; | |||
1637 | } | |||
1638 | } | |||
1639 | else if (TREE_CODE (extra_scope)((enum tree_code) (extra_scope)->base.code) == FIELD_DECL) | |||
1640 | { | |||
1641 | gcc_assert (at_class_scope_p ())((void)(!(at_class_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1641, __FUNCTION__), 0 : 0)); | |||
1642 | gcc_assert (DECL_CONTEXT (extra_scope) == current_class_type)((void)(!(((contains_struct_check ((extra_scope), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1642, __FUNCTION__))->decl_minimal.context) == scope_chain ->class_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1642, __FUNCTION__), 0 : 0)); | |||
1643 | } | |||
1644 | else | |||
1645 | /* FIXME: does this ever really occur? */ | |||
1646 | gcc_assert (TREE_CODE (extra_scope) == VAR_DECL)((void)(!(((enum tree_code) (extra_scope)->base.code) == VAR_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1646, __FUNCTION__), 0 : 0)); | |||
1647 | } | |||
1648 | ||||
1649 | tree lambda_expr = build_lambda_expr (); | |||
1650 | ||||
1651 | LAMBDA_EXPR_LOCATION (lambda_expr)(((struct tree_lambda_expr *)(tree_check ((lambda_expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1651, __FUNCTION__, (LAMBDA_EXPR))))->locus) = ctx->get_location_t (filename, | |||
1652 | line_number); | |||
1653 | ||||
1654 | tree type = begin_lambda_type (lambda_expr); | |||
1655 | ||||
1656 | /* Instead of calling record_lambda_scope, do this: */ | |||
1657 | LAMBDA_EXPR_EXTRA_SCOPE (lambda_expr)(((struct tree_lambda_expr *)(tree_check ((lambda_expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1657, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope) = extra_scope; | |||
1658 | LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR (lambda_expr)(((struct tree_lambda_expr *)(tree_check ((lambda_expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1658, __FUNCTION__, (LAMBDA_EXPR))))->discriminator_scope ) = discriminator; | |||
1659 | LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR (lambda_expr)(((struct tree_lambda_expr *)(tree_check ((lambda_expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1659, __FUNCTION__, (LAMBDA_EXPR))))->discriminator_sig) = discriminator; | |||
1660 | ||||
1661 | tree decl = TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1661, __FUNCTION__))->type_common.name); | |||
1662 | determine_visibility (decl); | |||
1663 | set_access_flags (decl, flags); | |||
1664 | ||||
1665 | return convert_out (ctx->preserve (type)); | |||
1666 | } | |||
1667 | ||||
1668 | gcc_expr | |||
1669 | plugin_build_lambda_expr (cc1_plugin::connection *self, | |||
1670 | gcc_type closure_type_in) | |||
1671 | { | |||
1672 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1673 | tree closure_type = convert_in (closure_type_in); | |||
1674 | ||||
1675 | gcc_assert (LAMBDA_TYPE_P (closure_type))((void)(!((((enum tree_code) (closure_type)->base.code) == RECORD_TYPE && ((((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag ))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1675, __FUNCTION__), 0 : 0)); | |||
1676 | ||||
1677 | tree lambda_expr = CLASSTYPE_LAMBDA_EXPR (closure_type)((((tree_class_check ((closure_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1677, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr); | |||
1678 | ||||
1679 | tree lambda_object = build_lambda_object (lambda_expr); | |||
1680 | ||||
1681 | return convert_out (ctx->preserve (lambda_object)); | |||
1682 | } | |||
1683 | ||||
1684 | gcc_decl | |||
1685 | plugin_build_field (cc1_plugin::connection *, | |||
1686 | const char *field_name, | |||
1687 | gcc_type field_type_in, | |||
1688 | enum gcc_cp_symbol_kind flags, | |||
1689 | unsigned long bitsize, | |||
1690 | unsigned long bitpos) | |||
1691 | { | |||
1692 | tree record_or_union_type = current_class_typescope_chain->class_type; | |||
1693 | tree field_type = convert_in (field_type_in); | |||
1694 | ||||
1695 | gcc_assert (at_class_scope_p ())((void)(!(at_class_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1695, __FUNCTION__), 0 : 0)); | |||
1696 | gcc_assert (RECORD_OR_UNION_CODE_P (TREE_CODE (record_or_union_type)))((void)(!(((((enum tree_code) (record_or_union_type)->base .code)) == RECORD_TYPE || (((enum tree_code) (record_or_union_type )->base.code)) == UNION_TYPE)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1696, __FUNCTION__), 0 : 0)); | |||
1697 | gcc_assert ((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_FIELD)((void)(!((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_FIELD ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1697, __FUNCTION__), 0 : 0)); | |||
1698 | gcc_assert ((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK((void)(!((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK | GCC_CP_FLAG_MASK_FIELD))) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1699, __FUNCTION__), 0 : 0)) | |||
1699 | | GCC_CP_FLAG_MASK_FIELD))) == 0)((void)(!((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK | GCC_CP_FLAG_MASK_FIELD))) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1699, __FUNCTION__), 0 : 0)); | |||
1700 | gcc_assert ((flags & GCC_CP_ACCESS_MASK))((void)(!((flags & GCC_CP_ACCESS_MASK)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1700, __FUNCTION__), 0 : 0)); | |||
1701 | ||||
1702 | /* Note that gdb does not preserve the location of field decls, so | |||
1703 | we can't provide a decent location here. */ | |||
1704 | tree decl = build_decl (BUILTINS_LOCATION((location_t) 1), FIELD_DECL, | |||
1705 | get_identifier (field_name)(__builtin_constant_p (field_name) ? get_identifier_with_length ((field_name), strlen (field_name)) : get_identifier (field_name )), field_type); | |||
1706 | DECL_FIELD_CONTEXT (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1706, __FUNCTION__, (FIELD_DECL)))->decl_minimal.context ) = record_or_union_type; | |||
1707 | ||||
1708 | set_access_flags (decl, flags); | |||
1709 | ||||
1710 | if ((flags & GCC_CP_FLAG_FIELD_MUTABLE) != 0) | |||
1711 | DECL_MUTABLE_P (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1711, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1711, __FUNCTION__))->decl_common.lang_flag_0)) = 1; | |||
1712 | ||||
1713 | if (TREE_CODE (field_type)((enum tree_code) (field_type)->base.code) == INTEGER_TYPE | |||
1714 | && TYPE_PRECISION (field_type)((tree_class_check ((field_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1714, __FUNCTION__))->type_common.precision) != bitsize) | |||
1715 | { | |||
1716 | DECL_BIT_FIELD_TYPE (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1716, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type ) = field_type; | |||
1717 | TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1717, __FUNCTION__))->typed.type) | |||
1718 | = c_build_bitfield_integer_type (bitsize, TYPE_UNSIGNED (field_type)((tree_class_check ((field_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1718, __FUNCTION__))->base.u.bits.unsigned_flag)); | |||
1719 | } | |||
1720 | ||||
1721 | SET_DECL_MODE (decl, TYPE_MODE (TREE_TYPE (decl)))((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1721, __FUNCTION__))->decl_common.mode = (((((enum tree_code ) ((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1721, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1721, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1721, __FUNCTION__))->typed.type)) : (((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1721, __FUNCTION__))->typed.type))->type_common.mode) )); | |||
1722 | ||||
1723 | // There's no way to recover this from DWARF. | |||
1724 | SET_DECL_OFFSET_ALIGN (decl, TYPE_PRECISION (pointer_sized_int_node))((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1724, __FUNCTION__, (FIELD_DECL)))->decl_common.off_align = ffs_hwi (((tree_class_check ((global_trees[TI_POINTER_SIZED_TYPE ]), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1724, __FUNCTION__))->type_common.precision)) - 1); | |||
1725 | ||||
1726 | tree pos = bitsize_int (bitpos)size_int_kind (bitpos, stk_bitsizetype); | |||
1727 | pos_from_bit (&DECL_FIELD_OFFSET (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1727, __FUNCTION__, (FIELD_DECL)))->field_decl.offset), &DECL_FIELD_BIT_OFFSET (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1727, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset ), | |||
1728 | DECL_OFFSET_ALIGN (decl)(((unsigned long)1) << (tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1728, __FUNCTION__, (FIELD_DECL)))->decl_common.off_align ), pos); | |||
1729 | ||||
1730 | DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1730, __FUNCTION__))->decl_common.size) = bitsize_int (bitsize)size_int_kind (bitsize, stk_bitsizetype); | |||
1731 | DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1731, __FUNCTION__))->decl_common.size_unit) = size_int ((bitsize + BITS_PER_UNIT - 1)size_int_kind ((bitsize + (8) - 1) / (8), stk_sizetype) | |||
1732 | / BITS_PER_UNIT)size_int_kind ((bitsize + (8) - 1) / (8), stk_sizetype); | |||
1733 | ||||
1734 | DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1734, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1734, __FUNCTION__))->common.chain)) = TYPE_FIELDS (record_or_union_type)((tree_check3 ((record_or_union_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1734, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | |||
1735 | TYPE_FIELDS (record_or_union_type)((tree_check3 ((record_or_union_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1735, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = decl; | |||
1736 | ||||
1737 | return convert_out (decl); | |||
1738 | } | |||
1739 | ||||
1740 | int | |||
1741 | plugin_finish_class_type (cc1_plugin::connection *, | |||
1742 | unsigned long size_in_bytes) | |||
1743 | { | |||
1744 | tree record_or_union_type = current_class_typescope_chain->class_type; | |||
1745 | ||||
1746 | gcc_assert (RECORD_OR_UNION_CODE_P (TREE_CODE (record_or_union_type)))((void)(!(((((enum tree_code) (record_or_union_type)->base .code)) == RECORD_TYPE || (((enum tree_code) (record_or_union_type )->base.code)) == UNION_TYPE)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1746, __FUNCTION__), 0 : 0)); | |||
1747 | ||||
1748 | finish_struct (record_or_union_type, NULLnullptr); | |||
1749 | ||||
1750 | gcc_assert (compare_tree_int (TYPE_SIZE_UNIT (record_or_union_type),((void)(!(compare_tree_int (((tree_class_check ((record_or_union_type ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1750, __FUNCTION__))->type_common.size_unit), size_in_bytes ) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1751, __FUNCTION__), 0 : 0)) | |||
1751 | size_in_bytes) == 0)((void)(!(compare_tree_int (((tree_class_check ((record_or_union_type ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1750, __FUNCTION__))->type_common.size_unit), size_in_bytes ) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1751, __FUNCTION__), 0 : 0)); | |||
1752 | ||||
1753 | return 1; | |||
1754 | } | |||
1755 | ||||
1756 | gcc_type | |||
1757 | plugin_start_enum_type (cc1_plugin::connection *self, | |||
1758 | const char *name, | |||
1759 | gcc_type underlying_int_type_in, | |||
1760 | enum gcc_cp_symbol_kind flags, | |||
1761 | const char *filename, | |||
1762 | unsigned int line_number) | |||
1763 | { | |||
1764 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1765 | tree underlying_int_type = convert_in (underlying_int_type_in); | |||
1766 | ||||
1767 | gcc_assert ((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_ENUM)((void)(!((flags & GCC_CP_SYMBOL_MASK) == GCC_CP_SYMBOL_ENUM ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1767, __FUNCTION__), 0 : 0)); | |||
1768 | gcc_assert ((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK((void)(!((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK | GCC_CP_FLAG_MASK_ENUM))) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1769, __FUNCTION__), 0 : 0)) | |||
1769 | | GCC_CP_FLAG_MASK_ENUM))) == 0)((void)(!((flags & (~(GCC_CP_SYMBOL_MASK | GCC_CP_ACCESS_MASK | GCC_CP_FLAG_MASK_ENUM))) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1769, __FUNCTION__), 0 : 0)); | |||
1770 | gcc_assert (!(flags & GCC_CP_ACCESS_MASK) == !at_class_scope_p ())((void)(!(!(flags & GCC_CP_ACCESS_MASK) == !at_class_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1770, __FUNCTION__), 0 : 0)); | |||
1771 | ||||
1772 | if (underlying_int_type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | |||
1773 | return convert_out (error_mark_nodeglobal_trees[TI_ERROR_MARK]); | |||
1774 | ||||
1775 | bool is_new_type = false; | |||
1776 | ||||
1777 | tree id = name ? get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name ), strlen (name)) : get_identifier (name)) : make_anon_name (); | |||
1778 | ||||
1779 | tree type = start_enum (id, NULL_TREE(tree) nullptr, | |||
1780 | underlying_int_type, | |||
1781 | /* attributes = */ NULL_TREE(tree) nullptr, | |||
1782 | !!(flags & GCC_CP_FLAG_ENUM_SCOPED), &is_new_type); | |||
1783 | ||||
1784 | gcc_assert (is_new_type)((void)(!(is_new_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1784, __FUNCTION__), 0 : 0)); | |||
1785 | ||||
1786 | location_t loc = ctx->get_location_t (filename, line_number); | |||
1787 | tree type_decl = TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1787, __FUNCTION__))->type_common.name); | |||
1788 | DECL_SOURCE_LOCATION (type_decl)((contains_struct_check ((type_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1788, __FUNCTION__))->decl_minimal.locus) = loc; | |||
1789 | SET_OPAQUE_ENUM_P (type, false)(((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1789, __FUNCTION__, (ENUMERAL_TYPE)))->base.private_flag ) = (false)); | |||
1790 | ||||
1791 | set_access_flags (type_decl, flags); | |||
1792 | ||||
1793 | return convert_out (ctx->preserve (type)); | |||
1794 | } | |||
1795 | ||||
1796 | gcc_decl | |||
1797 | plugin_build_enum_constant (cc1_plugin::connection *, | |||
1798 | gcc_type enum_type_in, | |||
1799 | const char *name, | |||
1800 | unsigned long value) | |||
1801 | { | |||
1802 | tree enum_type = convert_in (enum_type_in); | |||
1803 | ||||
1804 | gcc_assert (TREE_CODE (enum_type) == ENUMERAL_TYPE)((void)(!(((enum tree_code) (enum_type)->base.code) == ENUMERAL_TYPE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1804, __FUNCTION__), 0 : 0)); | |||
1805 | ||||
1806 | build_enumerator (get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name ), strlen (name)) : get_identifier (name)), build_int_cst (enum_type, value), | |||
1807 | enum_type, NULL_TREE(tree) nullptr, BUILTINS_LOCATION((location_t) 1)); | |||
1808 | ||||
1809 | return convert_out (TREE_VALUE (TYPE_VALUES (enum_type))((tree_check ((((tree_check ((enum_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1809, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1809, __FUNCTION__, (TREE_LIST)))->list.value)); | |||
1810 | } | |||
1811 | ||||
1812 | int | |||
1813 | plugin_finish_enum_type (cc1_plugin::connection *, | |||
1814 | gcc_type enum_type_in) | |||
1815 | { | |||
1816 | tree enum_type = convert_in (enum_type_in); | |||
1817 | ||||
1818 | finish_enum_value_list (enum_type); | |||
1819 | finish_enum (enum_type); | |||
1820 | ||||
1821 | return 1; | |||
1822 | } | |||
1823 | ||||
1824 | gcc_type | |||
1825 | plugin_build_function_type (cc1_plugin::connection *self, | |||
1826 | gcc_type return_type_in, | |||
1827 | const struct gcc_type_array *argument_types_in, | |||
1828 | int is_varargs) | |||
1829 | { | |||
1830 | tree return_type = convert_in (return_type_in); | |||
1831 | tree result; | |||
1832 | ||||
1833 | std::vector<tree> argument_types (argument_types_in->n_elements); | |||
1834 | for (int i = 0; i < argument_types_in->n_elements; ++i) | |||
1835 | argument_types[i] = convert_in (argument_types_in->elements[i]); | |||
1836 | ||||
1837 | if (is_varargs) | |||
1838 | result = build_varargs_function_type_array (return_type, | |||
1839 | argument_types_in->n_elements, | |||
1840 | argument_types.data ()); | |||
1841 | else | |||
1842 | result = build_function_type_array (return_type, | |||
1843 | argument_types_in->n_elements, | |||
1844 | argument_types.data ()); | |||
1845 | ||||
1846 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1847 | return convert_out (ctx->preserve (result)); | |||
1848 | } | |||
1849 | ||||
1850 | #if 0 | |||
1851 | ||||
1852 | gcc_type | |||
1853 | plugin_add_function_default_args (cc1_plugin::connection *self, | |||
1854 | gcc_type function_type_in, | |||
1855 | const struct gcc_cp_function_args *defaults) | |||
1856 | { | |||
1857 | tree function_type = convert_in (function_type_in); | |||
1858 | ||||
1859 | gcc_assert (TREE_CODE (function_type) == FUNCTION_TYPE)((void)(!(((enum tree_code) (function_type)->base.code) == FUNCTION_TYPE) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1859, __FUNCTION__), 0 : 0)); | |||
1860 | ||||
1861 | if (!defaults || !defaults->n_elements) | |||
1862 | return function_type_in; | |||
1863 | ||||
1864 | tree pargs = TYPE_ARG_TYPES (function_type)((tree_check2 ((function_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1864, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); | |||
1865 | tree nargs = NULL_TREE(tree) nullptr; | |||
1866 | ||||
1867 | /* Build a reversed copy of the list of default-less arguments in | |||
1868 | NARGS. At the end of the loop, PARGS will point to the end of | |||
1869 | the argument list, or to the first argument that had a default | |||
1870 | value. */ | |||
1871 | while (pargs && TREE_VALUE (pargs)((tree_check ((pargs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1871, __FUNCTION__, (TREE_LIST)))->list.value) != void_list_nodeglobal_trees[TI_VOID_LIST_NODE] | |||
1872 | && !TREE_PURPOSE (pargs)((tree_check ((pargs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1872, __FUNCTION__, (TREE_LIST)))->list.purpose)) | |||
1873 | { | |||
1874 | nargs = tree_cons (NULL_TREE(tree) nullptr, TREE_VALUE (pargs)((tree_check ((pargs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1874, __FUNCTION__, (TREE_LIST)))->list.value), nargs); | |||
1875 | pargs = TREE_CHAIN (pargs)((contains_struct_check ((pargs), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1875, __FUNCTION__))->common.chain); | |||
1876 | } | |||
1877 | ||||
1878 | /* Set the defaults in the now-leading NARGS, taking into account | |||
1879 | that NARGS is reversed but DEFAULTS->elements isn't. */ | |||
1880 | tree ndargs = nargs; | |||
1881 | int i = defaults->n_elements; | |||
1882 | while (i--) | |||
1883 | { | |||
1884 | gcc_assert (ndargs)((void)(!(ndargs) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1884, __FUNCTION__), 0 : 0)); | |||
1885 | tree deflt = convert_in (defaults->elements[i]); | |||
1886 | if (!deflt) | |||
1887 | deflt = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | |||
1888 | TREE_PURPOSE (ndargs)((tree_check ((ndargs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1888, __FUNCTION__, (TREE_LIST)))->list.purpose) = deflt; | |||
1889 | ndargs = TREE_CHAIN (ndargs)((contains_struct_check ((ndargs), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1889, __FUNCTION__))->common.chain); | |||
1890 | } | |||
1891 | ||||
1892 | /* Finally, reverse NARGS, and append the remaining PARGS that | |||
1893 | already had defaults. */ | |||
1894 | nargs = nreverse (nargs); | |||
1895 | nargs = chainon (nargs, pargs); | |||
1896 | ||||
1897 | tree result = build_function_type (TREE_TYPE (function_type)((contains_struct_check ((function_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1897, __FUNCTION__))->typed.type), nargs); | |||
1898 | ||||
1899 | /* Copy exceptions, attributes and whatnot. */ | |||
1900 | result = build_exception_variant (result, | |||
1901 | TYPE_RAISES_EXCEPTIONS (function_type)((tree_class_check (((tree_check2 ((function_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1901, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1901, __FUNCTION__))->type_non_common.lang_1)); | |||
1902 | result = cp_build_type_attribute_variant (result, | |||
1903 | TYPE_ATTRIBUTES (function_type)((tree_class_check ((function_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1903, __FUNCTION__))->type_common.attributes)); | |||
1904 | ||||
1905 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1906 | return convert_out (ctx->preserve (result)); | |||
1907 | } | |||
1908 | ||||
1909 | int | |||
1910 | plugin_set_deferred_function_default_args (cc1_plugin::connection *, | |||
1911 | gcc_decl function_in, | |||
1912 | const struct gcc_cp_function_args | |||
1913 | *defaults) | |||
1914 | { | |||
1915 | tree function = convert_in (function_in); | |||
1916 | ||||
1917 | gcc_assert (TREE_CODE (function) == FUNCTION_DECL)((void)(!(((enum tree_code) (function)->base.code) == FUNCTION_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1917, __FUNCTION__), 0 : 0)); | |||
1918 | ||||
1919 | if (!defaults || !defaults->n_elements) | |||
1920 | return 1; | |||
1921 | ||||
1922 | tree arg = FUNCTION_FIRST_USER_PARMTYPE (function)skip_artificial_parms_for ((function), ((tree_check2 ((((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1922, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1922, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | |||
1923 | ||||
1924 | for (int i = 0; i < defaults->n_elements; i++) | |||
1925 | { | |||
1926 | while (arg && TREE_PURPOSE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1926, __FUNCTION__, (TREE_LIST)))->list.purpose) != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | |||
1927 | arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1927, __FUNCTION__))->common.chain); | |||
1928 | ||||
1929 | if (!arg) | |||
1930 | return 0; | |||
1931 | ||||
1932 | TREE_PURPOSE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1932, __FUNCTION__, (TREE_LIST)))->list.purpose) = convert_in (defaults->elements[i]); | |||
1933 | arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1933, __FUNCTION__))->common.chain); | |||
1934 | } | |||
1935 | ||||
1936 | return 1; | |||
1937 | } | |||
1938 | ||||
1939 | #endif | |||
1940 | ||||
1941 | gcc_decl | |||
1942 | plugin_get_function_parameter_decl (cc1_plugin::connection *, | |||
1943 | gcc_decl function_in, | |||
1944 | int index) | |||
1945 | { | |||
1946 | tree function = convert_in (function_in); | |||
1947 | ||||
1948 | gcc_assert (TREE_CODE (function) == FUNCTION_DECL)((void)(!(((enum tree_code) (function)->base.code) == FUNCTION_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1948, __FUNCTION__), 0 : 0)); | |||
1949 | ||||
1950 | if (index == -1) | |||
1951 | { | |||
1952 | gcc_assert (TREE_CODE (TREE_TYPE (function)) == METHOD_TYPE)((void)(!(((enum tree_code) (((contains_struct_check ((function ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1952, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1952, __FUNCTION__), 0 : 0)); | |||
1953 | ||||
1954 | return convert_out (DECL_ARGUMENTS (function)((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1954, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )); | |||
1955 | } | |||
1956 | ||||
1957 | gcc_assert (index >= 0)((void)(!(index >= 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1957, __FUNCTION__), 0 : 0)); | |||
1958 | ||||
1959 | tree args = FUNCTION_FIRST_USER_PARM (function)skip_artificial_parms_for ((function), ((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1959, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )); | |||
1960 | ||||
1961 | for (int i = 0; args && i < index; i++) | |||
1962 | args = DECL_CHAIN (args)(((contains_struct_check (((contains_struct_check ((args), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1962, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 1962, __FUNCTION__))->common.chain)); | |||
1963 | ||||
1964 | return convert_out (args); | |||
1965 | } | |||
1966 | ||||
1967 | gcc_type | |||
1968 | plugin_build_exception_spec_variant (cc1_plugin::connection *self, | |||
1969 | gcc_type function_type_in, | |||
1970 | const struct gcc_type_array *except_types_in) | |||
1971 | { | |||
1972 | tree function_type = convert_in (function_type_in); | |||
1973 | tree except_types = NULL_TREE(tree) nullptr; | |||
1974 | ||||
1975 | if (!except_types_in) | |||
1976 | except_types = noexcept_false_speccp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC]; | |||
1977 | else if (!except_types_in->n_elements) | |||
1978 | except_types = empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]; | |||
1979 | else | |||
1980 | for (int i = 0; i < except_types_in->n_elements; i++) | |||
1981 | except_types = add_exception_specifier (except_types, | |||
1982 | convert_in | |||
1983 | (except_types_in->elements[i]), | |||
1984 | 0); | |||
1985 | ||||
1986 | function_type = build_exception_variant (function_type, | |||
1987 | except_types); | |||
1988 | ||||
1989 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
1990 | return convert_out (ctx->preserve (function_type)); | |||
1991 | } | |||
1992 | ||||
1993 | gcc_type | |||
1994 | plugin_build_method_type (cc1_plugin::connection *self, | |||
1995 | gcc_type class_type_in, | |||
1996 | gcc_type func_type_in, | |||
1997 | enum gcc_cp_qualifiers quals_in, | |||
1998 | enum gcc_cp_ref_qualifiers rquals_in) | |||
1999 | { | |||
2000 | tree class_type = convert_in (class_type_in); | |||
2001 | tree func_type = convert_in (func_type_in); | |||
2002 | cp_cv_quals quals = 0; | |||
2003 | cp_ref_qualifier rquals; | |||
2004 | ||||
2005 | if ((quals_in & GCC_CP_QUALIFIER_CONST) != 0) | |||
2006 | quals |= TYPE_QUAL_CONST; | |||
2007 | if ((quals_in & GCC_CP_QUALIFIER_VOLATILE) != 0) | |||
2008 | quals |= TYPE_QUAL_VOLATILE; | |||
2009 | gcc_assert ((quals_in & GCC_CP_QUALIFIER_RESTRICT) == 0)((void)(!((quals_in & GCC_CP_QUALIFIER_RESTRICT) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2009, __FUNCTION__), 0 : 0)); | |||
2010 | ||||
2011 | switch (rquals_in) | |||
2012 | { | |||
2013 | case GCC_CP_REF_QUAL_NONE: | |||
2014 | rquals = REF_QUAL_NONE; | |||
2015 | break; | |||
2016 | case GCC_CP_REF_QUAL_LVALUE: | |||
2017 | rquals = REF_QUAL_LVALUE; | |||
2018 | break; | |||
2019 | case GCC_CP_REF_QUAL_RVALUE: | |||
2020 | rquals = REF_QUAL_RVALUE; | |||
2021 | break; | |||
2022 | default: | |||
2023 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2023, __FUNCTION__)); | |||
2024 | } | |||
2025 | ||||
2026 | tree method_type = class_type | |||
2027 | ? build_memfn_type (func_type, class_type, quals, rquals) | |||
2028 | : apply_memfn_quals (func_type, quals, rquals); | |||
2029 | ||||
2030 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2031 | return convert_out (ctx->preserve (method_type)); | |||
2032 | } | |||
2033 | ||||
2034 | gcc_type | |||
2035 | plugin_build_pointer_to_member_type (cc1_plugin::connection *self, | |||
2036 | gcc_type class_type_in, | |||
2037 | gcc_type member_type_in) | |||
2038 | { | |||
2039 | tree class_type = convert_in (class_type_in); | |||
2040 | tree member_type = convert_in (member_type_in); | |||
2041 | ||||
2042 | tree memptr_type = build_ptrmem_type (class_type, member_type); | |||
2043 | ||||
2044 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2045 | return convert_out (ctx->preserve (memptr_type)); | |||
2046 | } | |||
2047 | ||||
2048 | int | |||
2049 | plugin_start_template_decl (cc1_plugin::connection *) | |||
2050 | { | |||
2051 | begin_template_parm_list (); | |||
2052 | ||||
2053 | TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2053, __FUNCTION__))->typed.type) = NULL_TREE(tree) nullptr; | |||
2054 | ||||
2055 | return 1; | |||
2056 | } | |||
2057 | ||||
2058 | gcc_decl | |||
2059 | plugin_get_type_decl (cc1_plugin::connection *, | |||
2060 | gcc_type type_in) | |||
2061 | { | |||
2062 | tree type = convert_in (type_in); | |||
2063 | ||||
2064 | tree name = TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2064, __FUNCTION__))->type_common.name); | |||
2065 | gcc_assert (name)((void)(!(name) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2065, __FUNCTION__), 0 : 0)); | |||
2066 | ||||
2067 | return convert_out (name); | |||
2068 | } | |||
2069 | ||||
2070 | gcc_type | |||
2071 | plugin_get_decl_type (cc1_plugin::connection *, | |||
2072 | gcc_decl decl_in) | |||
2073 | { | |||
2074 | tree decl = convert_in (decl_in); | |||
2075 | ||||
2076 | tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2076, __FUNCTION__))->typed.type); | |||
2077 | gcc_assert (type)((void)(!(type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2077, __FUNCTION__), 0 : 0)); | |||
2078 | ||||
2079 | return convert_out (type); | |||
2080 | } | |||
2081 | ||||
2082 | gcc_type | |||
2083 | plugin_build_type_template_parameter (cc1_plugin::connection *self, | |||
2084 | const char *id, | |||
2085 | int /* bool */ pack_p, | |||
2086 | gcc_type default_type, | |||
2087 | const char *filename, | |||
2088 | unsigned int line_number) | |||
2089 | { | |||
2090 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2091 | location_t loc = ctx->get_location_t (filename, line_number); | |||
2092 | ||||
2093 | gcc_assert (template_parm_scope_p ())((void)(!(template_parm_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2093, __FUNCTION__), 0 : 0)); | |||
2094 | ||||
2095 | tree parm = finish_template_type_parm (class_type_nodecp_global_trees[CPTI_CLASS_TYPE], get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id) , strlen (id)) : get_identifier (id))); | |||
2096 | parm = build_tree_list (convert_in (default_type), parm); | |||
2097 | ||||
2098 | gcc_assert (!(pack_p && default_type))((void)(!(!(pack_p && default_type)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2098, __FUNCTION__), 0 : 0)); | |||
2099 | ||||
2100 | /* Create a type and a decl for the type parm, and add the decl to | |||
2101 | TP_PARM_LIST. */ | |||
2102 | TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2102, __FUNCTION__))->typed.type) = process_template_parm (TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2102, __FUNCTION__))->typed.type), loc, parm, | |||
2103 | /* is_non_type = */ false, pack_p); | |||
2104 | ||||
2105 | /* Locate the decl of the newly-added, processed template parm. */ | |||
2106 | parm = TREE_VALUE (tree_last (TP_PARM_LIST))((tree_check ((tree_last (((contains_struct_check ((scope_chain ->template_parms), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2106, __FUNCTION__))->typed.type))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2106, __FUNCTION__, (TREE_LIST)))->list.value); | |||
2107 | ||||
2108 | /* Return its type. */ | |||
2109 | return convert_out (ctx->preserve (TREE_TYPE (parm)((contains_struct_check ((parm), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2109, __FUNCTION__))->typed.type))); | |||
2110 | } | |||
2111 | ||||
2112 | gcc_utempl | |||
2113 | plugin_build_template_template_parameter (cc1_plugin::connection *self, | |||
2114 | const char *id, | |||
2115 | int /* bool */ pack_p, | |||
2116 | gcc_utempl default_templ, | |||
2117 | const char *filename, | |||
2118 | unsigned int line_number) | |||
2119 | { | |||
2120 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2121 | location_t loc = ctx->get_location_t (filename, line_number); | |||
2122 | ||||
2123 | gcc_assert (template_parm_scope_p ())((void)(!(template_parm_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2123, __FUNCTION__), 0 : 0)); | |||
2124 | ||||
2125 | /* Finish the template parm list that started this template parm. */ | |||
2126 | end_template_parm_list (TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2126, __FUNCTION__))->typed.type)); | |||
2127 | ||||
2128 | gcc_assert (template_parm_scope_p ())((void)(!(template_parm_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2128, __FUNCTION__), 0 : 0)); | |||
2129 | ||||
2130 | tree parm = finish_template_template_parm (class_type_nodecp_global_trees[CPTI_CLASS_TYPE], | |||
2131 | get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id) , strlen (id)) : get_identifier (id))); | |||
2132 | parm = build_tree_list (convert_in (default_templ), parm); | |||
2133 | ||||
2134 | gcc_assert (!(pack_p && default_templ))((void)(!(!(pack_p && default_templ)) ? fancy_abort ( "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2134, __FUNCTION__), 0 : 0)); | |||
2135 | ||||
2136 | /* Create a type and a decl for the template parm, and add the decl | |||
2137 | to TP_PARM_LIST. */ | |||
2138 | TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2138, __FUNCTION__))->typed.type) = process_template_parm (TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2138, __FUNCTION__))->typed.type), loc, parm, | |||
2139 | /* is_non_type = */ false, pack_p); | |||
2140 | ||||
2141 | /* Locate the decl of the newly-added, processed template parm. */ | |||
2142 | parm = TREE_VALUE (tree_last (TP_PARM_LIST))((tree_check ((tree_last (((contains_struct_check ((scope_chain ->template_parms), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2142, __FUNCTION__))->typed.type))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2142, __FUNCTION__, (TREE_LIST)))->list.value); | |||
2143 | ||||
2144 | return convert_out (ctx->preserve (parm)); | |||
2145 | } | |||
2146 | ||||
2147 | gcc_decl | |||
2148 | plugin_build_value_template_parameter (cc1_plugin::connection *self, | |||
2149 | gcc_type type, | |||
2150 | const char *id, | |||
2151 | gcc_expr default_value, | |||
2152 | const char *filename, | |||
2153 | unsigned int line_number) | |||
2154 | { | |||
2155 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2156 | location_t loc = ctx->get_location_t (filename, line_number); | |||
2157 | ||||
2158 | gcc_assert (template_parm_scope_p ())((void)(!(template_parm_scope_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2158, __FUNCTION__), 0 : 0)); | |||
2159 | ||||
2160 | cp_declarator declarator; | |||
2161 | memset (&declarator, 0, sizeof (declarator)); | |||
2162 | // &declarator = make_id_declarator (NULL, get_identifier (id), sfk_none): | |||
2163 | declarator.kind = cdk_id; | |||
2164 | declarator.u.id.qualifying_scope = NULLnullptr; | |||
2165 | declarator.u.id.unqualified_name = get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id) , strlen (id)) : get_identifier (id)); | |||
2166 | declarator.u.id.sfk = sfk_none; | |||
2167 | ||||
2168 | cp_decl_specifier_seq declspec; | |||
2169 | memset (&declspec, 0, sizeof (declspec)); | |||
2170 | // cp_parser_set_decl_spec_type (&declspec, convert_in (type), -token-, false): | |||
2171 | declspec.any_specifiers_p = declspec.any_type_specifiers_p = true; | |||
2172 | declspec.type = convert_in (type); | |||
2173 | declspec.locations[ds_type_spec] = loc; | |||
2174 | ||||
2175 | tree parm = grokdeclarator (&declarator, &declspec, TPARM, 0, 0); | |||
2176 | parm = build_tree_list (convert_in (default_value), parm); | |||
2177 | ||||
2178 | /* Create a type and a decl for the template parm, and add the decl | |||
2179 | to TP_PARM_LIST. */ | |||
2180 | TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2180, __FUNCTION__))->typed.type) = process_template_parm (TP_PARM_LIST((contains_struct_check ((scope_chain->template_parms), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2180, __FUNCTION__))->typed.type), loc, parm, | |||
2181 | /* is_non_type = */ true, false); | |||
2182 | ||||
2183 | /* Locate the decl of the newly-added, processed template parm. */ | |||
2184 | parm = TREE_VALUE (tree_last (TP_PARM_LIST))((tree_check ((tree_last (((contains_struct_check ((scope_chain ->template_parms), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2184, __FUNCTION__))->typed.type))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2184, __FUNCTION__, (TREE_LIST)))->list.value); | |||
2185 | ||||
2186 | return convert_out (ctx->preserve (parm)); | |||
2187 | } | |||
2188 | ||||
2189 | static tree | |||
2190 | targlist (const gcc_cp_template_args *targs) | |||
2191 | { | |||
2192 | int n = targs->n_elements; | |||
2193 | tree vec = make_tree_vec (n); | |||
2194 | while (n--) | |||
2195 | { | |||
2196 | switch (targs->kinds[n]) | |||
2197 | { | |||
2198 | case GCC_CP_TPARG_VALUE: | |||
2199 | TREE_VEC_ELT (vec, n)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2199, __FUNCTION__))))) = convert_in (targs->elements[n].value); | |||
2200 | break; | |||
2201 | case GCC_CP_TPARG_CLASS: | |||
2202 | TREE_VEC_ELT (vec, n)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2202, __FUNCTION__))))) = convert_in (targs->elements[n].type); | |||
2203 | break; | |||
2204 | case GCC_CP_TPARG_TEMPL: | |||
2205 | TREE_VEC_ELT (vec, n)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2205, __FUNCTION__))))) = convert_in (targs->elements[n].templ); | |||
2206 | break; | |||
2207 | case GCC_CP_TPARG_PACK: | |||
2208 | TREE_VEC_ELT (vec, n)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2208, __FUNCTION__))))) = convert_in (targs->elements[n].pack); | |||
2209 | break; | |||
2210 | default: | |||
2211 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2211, __FUNCTION__)); | |||
2212 | } | |||
2213 | } | |||
2214 | return vec; | |||
2215 | } | |||
2216 | ||||
2217 | gcc_type | |||
2218 | plugin_build_dependent_typename (cc1_plugin::connection *self, | |||
2219 | gcc_type enclosing_type, | |||
2220 | const char *id, | |||
2221 | const gcc_cp_template_args *targs) | |||
2222 | { | |||
2223 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2224 | tree type = convert_in (enclosing_type); | |||
2225 | tree name = get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id) , strlen (id)) : get_identifier (id)); | |||
2226 | if (targs) | |||
2227 | name = build_min_nt_loc (/*loc=*/0, TEMPLATE_ID_EXPR, | |||
2228 | name, targlist (targs)); | |||
2229 | tree res = make_typename_type (type, name, typename_type, | |||
2230 | /*complain=*/tf_error); | |||
2231 | return convert_out (ctx->preserve (res)); | |||
2232 | } | |||
2233 | ||||
2234 | gcc_utempl | |||
2235 | plugin_build_dependent_class_template (cc1_plugin::connection *self, | |||
2236 | gcc_type enclosing_type, | |||
2237 | const char *id) | |||
2238 | { | |||
2239 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2240 | tree type = convert_in (enclosing_type); | |||
2241 | tree name = get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id) , strlen (id)) : get_identifier (id)); | |||
2242 | tree res = make_unbound_class_template (type, name, NULL_TREE(tree) nullptr, | |||
2243 | /*complain=*/tf_error); | |||
2244 | return convert_out (ctx->preserve (res)); | |||
2245 | } | |||
2246 | ||||
2247 | gcc_type | |||
2248 | plugin_build_dependent_type_template_id (cc1_plugin::connection *self, | |||
2249 | gcc_utempl template_decl, | |||
2250 | const gcc_cp_template_args *targs) | |||
2251 | { | |||
2252 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2253 | tree type = convert_in (template_decl); | |||
2254 | tree decl = finish_template_type (type, targlist (targs), | |||
2255 | /*entering_scope=*/false); | |||
2256 | return convert_out (ctx->preserve (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2256, __FUNCTION__))->typed.type))); | |||
2257 | } | |||
2258 | ||||
2259 | gcc_expr | |||
2260 | plugin_build_dependent_expr (cc1_plugin::connection *self, | |||
2261 | gcc_decl enclosing_scope, | |||
2262 | enum gcc_cp_symbol_kind flags, | |||
2263 | const char *name, | |||
2264 | gcc_type conv_type_in, | |||
2265 | const gcc_cp_template_args *targs) | |||
2266 | { | |||
2267 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2268 | tree scope = convert_in (enclosing_scope); | |||
2269 | tree conv_type = convert_in (conv_type_in); | |||
2270 | tree identifier; | |||
2271 | ||||
2272 | if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) != NAMESPACE_DECL) | |||
2273 | { | |||
2274 | tree type = TREE_TYPE (scope)((contains_struct_check ((scope), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2274, __FUNCTION__))->typed.type); | |||
2275 | gcc_assert (TYPE_NAME (type) == scope)((void)(!(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2275, __FUNCTION__))->type_common.name) == scope) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2275, __FUNCTION__), 0 : 0)); | |||
2276 | scope = type; | |||
2277 | } | |||
2278 | ||||
2279 | if (flags == (GCC_CP_SYMBOL_FUNCTION | GCC_CP_FLAG_SPECIAL_FUNCTION)) | |||
2280 | { | |||
2281 | bool assop = false, convop = false; | |||
2282 | tree_code opcode = ERROR_MARK; | |||
2283 | ||||
2284 | switch (CHARS2 (name[0], name[1])(((unsigned char)name[0] << 8) | (unsigned char)name[1] )) | |||
2285 | { | |||
2286 | case CHARS2 ('C', 0x0)(((unsigned char)'C' << 8) | (unsigned char)0x0): // ctor base declaration | |||
2287 | case CHARS2 ('C', ' ')(((unsigned char)'C' << 8) | (unsigned char)' '): | |||
2288 | case CHARS2 ('C', '1')(((unsigned char)'C' << 8) | (unsigned char)'1'): | |||
2289 | case CHARS2 ('C', '2')(((unsigned char)'C' << 8) | (unsigned char)'2'): | |||
2290 | case CHARS2 ('C', '4')(((unsigned char)'C' << 8) | (unsigned char)'4'): | |||
2291 | identifier = ctor_identifiercp_global_trees[CPTI_CTOR_IDENTIFIER]; | |||
2292 | break; | |||
2293 | case CHARS2 ('D', 0x0)(((unsigned char)'D' << 8) | (unsigned char)0x0): // dtor base declaration | |||
2294 | case CHARS2 ('D', ' ')(((unsigned char)'D' << 8) | (unsigned char)' '): | |||
2295 | case CHARS2 ('D', '0')(((unsigned char)'D' << 8) | (unsigned char)'0'): | |||
2296 | case CHARS2 ('D', '1')(((unsigned char)'D' << 8) | (unsigned char)'1'): | |||
2297 | case CHARS2 ('D', '2')(((unsigned char)'D' << 8) | (unsigned char)'2'): | |||
2298 | case CHARS2 ('D', '4')(((unsigned char)'D' << 8) | (unsigned char)'4'): | |||
2299 | gcc_assert (!targs)((void)(!(!targs) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2299, __FUNCTION__), 0 : 0)); | |||
2300 | identifier = dtor_identifiercp_global_trees[CPTI_DTOR_IDENTIFIER]; | |||
2301 | break; | |||
2302 | case CHARS2 ('n', 'w')(((unsigned char)'n' << 8) | (unsigned char)'w'): // operator new | |||
2303 | opcode = NEW_EXPR; | |||
2304 | break; | |||
2305 | case CHARS2 ('n', 'a')(((unsigned char)'n' << 8) | (unsigned char)'a'): // operator new[] | |||
2306 | opcode = VEC_NEW_EXPR; | |||
2307 | break; | |||
2308 | case CHARS2 ('d', 'l')(((unsigned char)'d' << 8) | (unsigned char)'l'): // operator delete | |||
2309 | opcode = DELETE_EXPR; | |||
2310 | break; | |||
2311 | case CHARS2 ('d', 'a')(((unsigned char)'d' << 8) | (unsigned char)'a'): // operator delete[] | |||
2312 | opcode = VEC_DELETE_EXPR; | |||
2313 | break; | |||
2314 | case CHARS2 ('p', 's')(((unsigned char)'p' << 8) | (unsigned char)'s'): // operator + (unary) | |||
2315 | opcode = PLUS_EXPR; | |||
2316 | break; | |||
2317 | case CHARS2 ('n', 'g')(((unsigned char)'n' << 8) | (unsigned char)'g'): // operator - (unary) | |||
2318 | opcode = MINUS_EXPR; | |||
2319 | break; | |||
2320 | case CHARS2 ('a', 'd')(((unsigned char)'a' << 8) | (unsigned char)'d'): // operator & (unary) | |||
2321 | opcode = BIT_AND_EXPR; | |||
2322 | break; | |||
2323 | case CHARS2 ('d', 'e')(((unsigned char)'d' << 8) | (unsigned char)'e'): // operator * (unary) | |||
2324 | opcode = MULT_EXPR; | |||
2325 | break; | |||
2326 | case CHARS2 ('c', 'o')(((unsigned char)'c' << 8) | (unsigned char)'o'): // operator ~ | |||
2327 | opcode = BIT_NOT_EXPR; | |||
2328 | break; | |||
2329 | case CHARS2 ('p', 'l')(((unsigned char)'p' << 8) | (unsigned char)'l'): // operator + | |||
2330 | opcode = PLUS_EXPR; | |||
2331 | break; | |||
2332 | case CHARS2 ('m', 'i')(((unsigned char)'m' << 8) | (unsigned char)'i'): // operator - | |||
2333 | opcode = MINUS_EXPR; | |||
2334 | break; | |||
2335 | case CHARS2 ('m', 'l')(((unsigned char)'m' << 8) | (unsigned char)'l'): // operator * | |||
2336 | opcode = MULT_EXPR; | |||
2337 | break; | |||
2338 | case CHARS2 ('d', 'v')(((unsigned char)'d' << 8) | (unsigned char)'v'): // operator / | |||
2339 | opcode = TRUNC_DIV_EXPR; | |||
2340 | break; | |||
2341 | case CHARS2 ('r', 'm')(((unsigned char)'r' << 8) | (unsigned char)'m'): // operator % | |||
2342 | opcode = TRUNC_MOD_EXPR; | |||
2343 | break; | |||
2344 | case CHARS2 ('a', 'n')(((unsigned char)'a' << 8) | (unsigned char)'n'): // operator & | |||
2345 | opcode = BIT_AND_EXPR; | |||
2346 | break; | |||
2347 | case CHARS2 ('o', 'r')(((unsigned char)'o' << 8) | (unsigned char)'r'): // operator | | |||
2348 | opcode = BIT_IOR_EXPR; | |||
2349 | break; | |||
2350 | case CHARS2 ('e', 'o')(((unsigned char)'e' << 8) | (unsigned char)'o'): // operator ^ | |||
2351 | opcode = BIT_XOR_EXPR; | |||
2352 | break; | |||
2353 | case CHARS2 ('a', 'S')(((unsigned char)'a' << 8) | (unsigned char)'S'): // operator = | |||
2354 | opcode = NOP_EXPR; | |||
2355 | assop = true; | |||
2356 | break; | |||
2357 | case CHARS2 ('p', 'L')(((unsigned char)'p' << 8) | (unsigned char)'L'): // operator += | |||
2358 | opcode = PLUS_EXPR; | |||
2359 | assop = true; | |||
2360 | break; | |||
2361 | case CHARS2 ('m', 'I')(((unsigned char)'m' << 8) | (unsigned char)'I'): // operator -= | |||
2362 | opcode = MINUS_EXPR; | |||
2363 | assop = true; | |||
2364 | break; | |||
2365 | case CHARS2 ('m', 'L')(((unsigned char)'m' << 8) | (unsigned char)'L'): // operator *= | |||
2366 | opcode = MULT_EXPR; | |||
2367 | assop = true; | |||
2368 | break; | |||
2369 | case CHARS2 ('d', 'V')(((unsigned char)'d' << 8) | (unsigned char)'V'): // operator /= | |||
2370 | opcode = TRUNC_DIV_EXPR; | |||
2371 | assop = true; | |||
2372 | break; | |||
2373 | case CHARS2 ('r', 'M')(((unsigned char)'r' << 8) | (unsigned char)'M'): // operator %= | |||
2374 | opcode = TRUNC_MOD_EXPR; | |||
2375 | assop = true; | |||
2376 | break; | |||
2377 | case CHARS2 ('a', 'N')(((unsigned char)'a' << 8) | (unsigned char)'N'): // operator &= | |||
2378 | opcode = BIT_AND_EXPR; | |||
2379 | assop = true; | |||
2380 | break; | |||
2381 | case CHARS2 ('o', 'R')(((unsigned char)'o' << 8) | (unsigned char)'R'): // operator |= | |||
2382 | opcode = BIT_IOR_EXPR; | |||
2383 | assop = true; | |||
2384 | break; | |||
2385 | case CHARS2 ('e', 'O')(((unsigned char)'e' << 8) | (unsigned char)'O'): // operator ^= | |||
2386 | opcode = BIT_XOR_EXPR; | |||
2387 | assop = true; | |||
2388 | break; | |||
2389 | case CHARS2 ('l', 's')(((unsigned char)'l' << 8) | (unsigned char)'s'): // operator << | |||
2390 | opcode = LSHIFT_EXPR; | |||
2391 | break; | |||
2392 | case CHARS2 ('r', 's')(((unsigned char)'r' << 8) | (unsigned char)'s'): // operator >> | |||
2393 | opcode = RSHIFT_EXPR; | |||
2394 | break; | |||
2395 | case CHARS2 ('l', 'S')(((unsigned char)'l' << 8) | (unsigned char)'S'): // operator <<= | |||
2396 | opcode = LSHIFT_EXPR; | |||
2397 | assop = true; | |||
2398 | break; | |||
2399 | case CHARS2 ('r', 'S')(((unsigned char)'r' << 8) | (unsigned char)'S'): // operator >>= | |||
2400 | opcode = RSHIFT_EXPR; | |||
2401 | assop = true; | |||
2402 | break; | |||
2403 | case CHARS2 ('e', 'q')(((unsigned char)'e' << 8) | (unsigned char)'q'): // operator == | |||
2404 | opcode = EQ_EXPR; | |||
2405 | break; | |||
2406 | case CHARS2 ('n', 'e')(((unsigned char)'n' << 8) | (unsigned char)'e'): // operator != | |||
2407 | opcode = NE_EXPR; | |||
2408 | break; | |||
2409 | case CHARS2 ('l', 't')(((unsigned char)'l' << 8) | (unsigned char)'t'): // operator < | |||
2410 | opcode = LT_EXPR; | |||
2411 | break; | |||
2412 | case CHARS2 ('g', 't')(((unsigned char)'g' << 8) | (unsigned char)'t'): // operator > | |||
2413 | opcode = GT_EXPR; | |||
2414 | break; | |||
2415 | case CHARS2 ('l', 'e')(((unsigned char)'l' << 8) | (unsigned char)'e'): // operator <= | |||
2416 | opcode = LE_EXPR; | |||
2417 | break; | |||
2418 | case CHARS2 ('g', 'e')(((unsigned char)'g' << 8) | (unsigned char)'e'): // operator >= | |||
2419 | opcode = GE_EXPR; | |||
2420 | break; | |||
2421 | case CHARS2 ('n', 't')(((unsigned char)'n' << 8) | (unsigned char)'t'): // operator ! | |||
2422 | opcode = TRUTH_NOT_EXPR; | |||
2423 | break; | |||
2424 | case CHARS2 ('a', 'a')(((unsigned char)'a' << 8) | (unsigned char)'a'): // operator && | |||
2425 | opcode = TRUTH_ANDIF_EXPR; | |||
2426 | break; | |||
2427 | case CHARS2 ('o', 'o')(((unsigned char)'o' << 8) | (unsigned char)'o'): // operator || | |||
2428 | opcode = TRUTH_ORIF_EXPR; | |||
2429 | break; | |||
2430 | case CHARS2 ('p', 'p')(((unsigned char)'p' << 8) | (unsigned char)'p'): // operator ++ | |||
2431 | opcode = POSTINCREMENT_EXPR; | |||
2432 | break; | |||
2433 | case CHARS2 ('m', 'm')(((unsigned char)'m' << 8) | (unsigned char)'m'): // operator -- | |||
2434 | opcode = PREDECREMENT_EXPR; | |||
2435 | break; | |||
2436 | case CHARS2 ('c', 'm')(((unsigned char)'c' << 8) | (unsigned char)'m'): // operator , | |||
2437 | opcode = COMPOUND_EXPR; | |||
2438 | break; | |||
2439 | case CHARS2 ('p', 'm')(((unsigned char)'p' << 8) | (unsigned char)'m'): // operator ->* | |||
2440 | opcode = MEMBER_REF; | |||
2441 | break; | |||
2442 | case CHARS2 ('p', 't')(((unsigned char)'p' << 8) | (unsigned char)'t'): // operator -> | |||
2443 | opcode = COMPONENT_REF; | |||
2444 | break; | |||
2445 | case CHARS2 ('c', 'l')(((unsigned char)'c' << 8) | (unsigned char)'l'): // operator () | |||
2446 | opcode = CALL_EXPR; | |||
2447 | break; | |||
2448 | case CHARS2 ('i', 'x')(((unsigned char)'i' << 8) | (unsigned char)'x'): // operator [] | |||
2449 | opcode = ARRAY_REF; | |||
2450 | break; | |||
2451 | case CHARS2 ('c', 'v')(((unsigned char)'c' << 8) | (unsigned char)'v'): // operator <T> (conversion operator) | |||
2452 | convop = true; | |||
2453 | identifier = make_conv_op_name (conv_type); | |||
2454 | break; | |||
2455 | // C++11-only: | |||
2456 | case CHARS2 ('l', 'i')(((unsigned char)'l' << 8) | (unsigned char)'i'): // operator "" <id> | |||
2457 | { | |||
2458 | char *id = (char *)name + 2; | |||
2459 | bool freeid = false; | |||
2460 | if (*id >= '0' && *id <= '9') | |||
2461 | { | |||
2462 | unsigned len = 0; | |||
2463 | do | |||
2464 | { | |||
2465 | len *= 10; | |||
2466 | len += id[0] - '0'; | |||
2467 | id++; | |||
2468 | } | |||
2469 | while (*id && *id >= '0' && *id <= '9'); | |||
2470 | id = xstrndup (id, len); | |||
2471 | freeid = true; | |||
2472 | } | |||
2473 | identifier = cp_literal_operator_id (id); | |||
2474 | if (freeid) | |||
2475 | free (id); | |||
2476 | } | |||
2477 | break; | |||
2478 | case CHARS2 ('q', 'u')(((unsigned char)'q' << 8) | (unsigned char)'u'): // ternary operator, not overloadable. | |||
2479 | default: | |||
2480 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2480, __FUNCTION__)); | |||
2481 | } | |||
2482 | ||||
2483 | gcc_assert (convop || !conv_type)((void)(!(convop || !conv_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2483, __FUNCTION__), 0 : 0)); | |||
2484 | ||||
2485 | if (opcode != ERROR_MARK) | |||
2486 | identifier = ovl_op_identifier (assop, opcode); | |||
2487 | ||||
2488 | gcc_assert (identifier)((void)(!(identifier) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2488, __FUNCTION__), 0 : 0)); | |||
2489 | } | |||
2490 | else | |||
2491 | { | |||
2492 | gcc_assert (flags == GCC_CP_SYMBOL_MASK)((void)(!(flags == GCC_CP_SYMBOL_MASK) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2492, __FUNCTION__), 0 : 0)); | |||
2493 | gcc_assert (!conv_type)((void)(!(!conv_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2493, __FUNCTION__), 0 : 0)); | |||
2494 | identifier = get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name ), strlen (name)) : get_identifier (name)); | |||
2495 | } | |||
2496 | tree res = identifier; | |||
2497 | if (!scope) | |||
2498 | res = lookup_name (res, LOOK_where::BLOCK_NAMESPACE); | |||
2499 | else if (!TYPE_P (scope)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (scope)->base.code))] == tcc_type) || !dependent_scope_p (scope)) | |||
2500 | { | |||
2501 | res = lookup_qualified_name (scope, res, LOOK_want::NORMAL, true); | |||
2502 | /* We've already resolved the name in the scope, so skip the | |||
2503 | build_qualified_name call below. */ | |||
2504 | scope = NULLnullptr; | |||
2505 | } | |||
2506 | if (targs) | |||
2507 | res = lookup_template_function (res, targlist (targs)); | |||
2508 | if (scope) | |||
2509 | res = build_qualified_name (NULL_TREE(tree) nullptr, scope, res, !!targs); | |||
2510 | return convert_out (ctx->preserve (res)); | |||
2511 | } | |||
2512 | ||||
2513 | gcc_expr | |||
2514 | plugin_build_literal_expr (cc1_plugin::connection *self, | |||
2515 | gcc_type type, unsigned long value) | |||
2516 | { | |||
2517 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2518 | tree t = convert_in (type); | |||
2519 | tree val = build_int_cst_type (t, (unsigned HOST_WIDE_INTlong) value); | |||
2520 | return convert_out (ctx->preserve (val)); | |||
2521 | } | |||
2522 | ||||
2523 | gcc_expr | |||
2524 | plugin_build_decl_expr (cc1_plugin::connection *self, | |||
2525 | gcc_decl decl_in, | |||
2526 | int qualified_p) | |||
2527 | { | |||
2528 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2529 | tree decl = convert_in (decl_in); | |||
2530 | gcc_assert (DECL_P (decl))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int ) (((enum tree_code) (decl)->base.code))] == tcc_declaration )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2530, __FUNCTION__), 0 : 0)); | |||
2531 | tree result = decl; | |||
2532 | if (qualified_p) | |||
2533 | { | |||
2534 | gcc_assert (DECL_CLASS_SCOPE_P (decl))((void)(!((((contains_struct_check ((decl), (TS_DECL_MINIMAL) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2534, __FUNCTION__))->decl_minimal.context) && ( tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2534, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2534, __FUNCTION__), 0 : 0)); | |||
2535 | result = build_offset_ref (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2535, __FUNCTION__))->decl_minimal.context), decl, | |||
2536 | /*address_p=*/true, tf_error); | |||
2537 | } | |||
2538 | return convert_out (ctx->preserve (result)); | |||
2539 | } | |||
2540 | ||||
2541 | gcc_expr | |||
2542 | plugin_build_unary_expr (cc1_plugin::connection *self, | |||
2543 | const char *unary_op, | |||
2544 | gcc_expr operand) | |||
2545 | { | |||
2546 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2547 | tree op0 = convert_in (operand); | |||
2548 | tree_code opcode = ERROR_MARK; | |||
2549 | bool global_scope_p = false; | |||
2550 | ||||
2551 | once_more: | |||
2552 | switch (CHARS2 (unary_op[0], unary_op[1])(((unsigned char)unary_op[0] << 8) | (unsigned char)unary_op [1])) | |||
2553 | { | |||
2554 | case CHARS2 ('p', 's')(((unsigned char)'p' << 8) | (unsigned char)'s'): // operator + (unary) | |||
2555 | opcode = UNARY_PLUS_EXPR; | |||
2556 | break; | |||
2557 | case CHARS2 ('n', 'g')(((unsigned char)'n' << 8) | (unsigned char)'g'): // operator - (unary) | |||
2558 | opcode = NEGATE_EXPR; | |||
2559 | break; | |||
2560 | case CHARS2 ('a', 'd')(((unsigned char)'a' << 8) | (unsigned char)'d'): // operator & (unary) | |||
2561 | opcode = ADDR_EXPR; | |||
2562 | break; | |||
2563 | case CHARS2 ('d', 'e')(((unsigned char)'d' << 8) | (unsigned char)'e'): // operator * (unary) | |||
2564 | opcode = INDIRECT_REF; | |||
2565 | break; | |||
2566 | case CHARS2 ('c', 'o')(((unsigned char)'c' << 8) | (unsigned char)'o'): // operator ~ | |||
2567 | opcode = BIT_NOT_EXPR; | |||
2568 | break; | |||
2569 | case CHARS2 ('n', 't')(((unsigned char)'n' << 8) | (unsigned char)'t'): // operator ! | |||
2570 | opcode = TRUTH_NOT_EXPR; | |||
2571 | break; | |||
2572 | case CHARS2 ('p', 'p')(((unsigned char)'p' << 8) | (unsigned char)'p'): // operator ++ | |||
2573 | opcode = unary_op[2] == '_' ? PREINCREMENT_EXPR : POSTINCREMENT_EXPR; | |||
2574 | break; | |||
2575 | case CHARS2 ('m', 'm')(((unsigned char)'m' << 8) | (unsigned char)'m'): // operator -- | |||
2576 | opcode = unary_op[2] == '_' ? PREDECREMENT_EXPR : POSTDECREMENT_EXPR; | |||
2577 | break; | |||
2578 | case CHARS2 ('n', 'x')(((unsigned char)'n' << 8) | (unsigned char)'x'): // noexcept | |||
2579 | opcode = NOEXCEPT_EXPR; | |||
2580 | break; | |||
2581 | case CHARS2 ('t', 'w')(((unsigned char)'t' << 8) | (unsigned char)'w'): // throw | |||
2582 | gcc_assert (op0)((void)(!(op0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2582, __FUNCTION__), 0 : 0)); | |||
2583 | opcode = THROW_EXPR; | |||
2584 | break; | |||
2585 | case CHARS2 ('t', 'r')(((unsigned char)'t' << 8) | (unsigned char)'r'): // rethrow | |||
2586 | gcc_assert (!op0)((void)(!(!op0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2586, __FUNCTION__), 0 : 0)); | |||
2587 | opcode = THROW_EXPR; | |||
2588 | break; | |||
2589 | case CHARS2 ('t', 'e')(((unsigned char)'t' << 8) | (unsigned char)'e'): // typeid (value) | |||
2590 | opcode = TYPEID_EXPR; | |||
2591 | break; | |||
2592 | case CHARS2 ('s', 'z')(((unsigned char)'s' << 8) | (unsigned char)'z'): // sizeof (value) | |||
2593 | opcode = SIZEOF_EXPR; | |||
2594 | break; | |||
2595 | case CHARS2 ('a', 'z')(((unsigned char)'a' << 8) | (unsigned char)'z'): // alignof (value) | |||
2596 | opcode = ALIGNOF_EXPR; | |||
2597 | break; | |||
2598 | case CHARS2 ('g', 's')(((unsigned char)'g' << 8) | (unsigned char)'s'): // global scope (for delete, delete[]) | |||
2599 | gcc_assert (!global_scope_p)((void)(!(!global_scope_p) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2599, __FUNCTION__), 0 : 0)); | |||
2600 | global_scope_p = true; | |||
2601 | unary_op += 2; | |||
2602 | goto once_more; | |||
2603 | case CHARS2 ('d', 'l')(((unsigned char)'d' << 8) | (unsigned char)'l'): // delete | |||
2604 | opcode = DELETE_EXPR; | |||
2605 | break; | |||
2606 | case CHARS2 ('d', 'a')(((unsigned char)'d' << 8) | (unsigned char)'a'): // delete[] | |||
2607 | opcode = VEC_DELETE_EXPR; | |||
2608 | break; | |||
2609 | case CHARS2 ('s', 'p')(((unsigned char)'s' << 8) | (unsigned char)'p'): // pack... | |||
2610 | opcode = EXPR_PACK_EXPANSION; | |||
2611 | break; | |||
2612 | case CHARS2 ('s', 'Z')(((unsigned char)'s' << 8) | (unsigned char)'Z'): // sizeof...(pack) | |||
2613 | opcode = TYPE_PACK_EXPANSION; // Not really, but let's use its code. | |||
2614 | break; | |||
2615 | ||||
2616 | /* FIXME: __real__, __imag__? */ | |||
2617 | ||||
2618 | default: | |||
2619 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2619, __FUNCTION__)); | |||
2620 | } | |||
2621 | ||||
2622 | gcc_assert (!global_scope_p((void)(!(!global_scope_p || opcode == DELETE_EXPR || opcode == VEC_DELETE_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2623, __FUNCTION__), 0 : 0)) | |||
2623 | || opcode == DELETE_EXPR || opcode == VEC_DELETE_EXPR)((void)(!(!global_scope_p || opcode == DELETE_EXPR || opcode == VEC_DELETE_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2623, __FUNCTION__), 0 : 0)); | |||
2624 | ||||
2625 | processing_template_declscope_chain->x_processing_template_decl++; | |||
2626 | bool template_dependent_p = op0 | |||
2627 | && (type_dependent_expression_p (op0) | |||
2628 | || value_dependent_expression_p (op0)); | |||
2629 | if (!template_dependent_p) | |||
2630 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2631 | ||||
2632 | tree result; | |||
2633 | ||||
2634 | gcc_assert (op0 || opcode == THROW_EXPR)((void)(!(op0 || opcode == THROW_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2634, __FUNCTION__), 0 : 0)); | |||
2635 | ||||
2636 | switch (opcode) | |||
2637 | { | |||
2638 | case NOEXCEPT_EXPR: | |||
2639 | result = finish_noexcept_expr (op0, tf_error); | |||
2640 | break; | |||
2641 | ||||
2642 | case THROW_EXPR: | |||
2643 | result = build_throw (input_location, op0); | |||
2644 | break; | |||
2645 | ||||
2646 | case TYPEID_EXPR: | |||
2647 | result = build_typeid (op0, tf_error); | |||
2648 | break; | |||
2649 | ||||
2650 | case SIZEOF_EXPR: | |||
2651 | case ALIGNOF_EXPR: | |||
2652 | result = cxx_sizeof_or_alignof_expr (input_location, | |||
2653 | op0, opcode, true, true); | |||
2654 | break; | |||
2655 | ||||
2656 | case DELETE_EXPR: | |||
2657 | case VEC_DELETE_EXPR: | |||
2658 | result = delete_sanity (input_location, op0, NULL_TREE(tree) nullptr, | |||
2659 | opcode == VEC_DELETE_EXPR, | |||
2660 | global_scope_p, tf_error); | |||
2661 | break; | |||
2662 | ||||
2663 | case EXPR_PACK_EXPANSION: | |||
2664 | result = make_pack_expansion (op0); | |||
2665 | break; | |||
2666 | ||||
2667 | // We're using this for sizeof...(pack). */ | |||
2668 | case TYPE_PACK_EXPANSION: | |||
2669 | result = make_pack_expansion (op0); | |||
2670 | PACK_EXPANSION_SIZEOF_P (result)((tree_not_check2 (((tree_check2 ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2670, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION )))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2670, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) = true; | |||
2671 | break; | |||
2672 | ||||
2673 | default: | |||
2674 | result = build_x_unary_op (/*loc=*/0, opcode, op0, NULL_TREE(tree) nullptr, tf_error); | |||
2675 | break; | |||
2676 | } | |||
2677 | ||||
2678 | if (template_dependent_p) | |||
2679 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2680 | ||||
2681 | return convert_out (ctx->preserve (result)); | |||
2682 | } | |||
2683 | ||||
2684 | gcc_expr | |||
2685 | plugin_build_binary_expr (cc1_plugin::connection *self, | |||
2686 | const char *binary_op, | |||
2687 | gcc_expr operand1, | |||
2688 | gcc_expr operand2) | |||
2689 | { | |||
2690 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2691 | tree op0 = convert_in (operand1); | |||
2692 | tree op1 = convert_in (operand2); | |||
2693 | tree_code opcode = ERROR_MARK; | |||
2694 | ||||
2695 | switch (CHARS2 (binary_op[0], binary_op[1])(((unsigned char)binary_op[0] << 8) | (unsigned char)binary_op [1])) | |||
2696 | { | |||
2697 | case CHARS2 ('p', 'l')(((unsigned char)'p' << 8) | (unsigned char)'l'): // operator + | |||
2698 | opcode = PLUS_EXPR; | |||
2699 | break; | |||
2700 | case CHARS2 ('m', 'i')(((unsigned char)'m' << 8) | (unsigned char)'i'): // operator - | |||
2701 | opcode = MINUS_EXPR; | |||
2702 | break; | |||
2703 | case CHARS2 ('m', 'l')(((unsigned char)'m' << 8) | (unsigned char)'l'): // operator * | |||
2704 | opcode = MULT_EXPR; | |||
2705 | break; | |||
2706 | case CHARS2 ('d', 'v')(((unsigned char)'d' << 8) | (unsigned char)'v'): // operator / | |||
2707 | opcode = TRUNC_DIV_EXPR; | |||
2708 | break; | |||
2709 | case CHARS2 ('r', 'm')(((unsigned char)'r' << 8) | (unsigned char)'m'): // operator % | |||
2710 | opcode = TRUNC_MOD_EXPR; | |||
2711 | break; | |||
2712 | case CHARS2 ('a', 'n')(((unsigned char)'a' << 8) | (unsigned char)'n'): // operator & | |||
2713 | opcode = BIT_AND_EXPR; | |||
2714 | break; | |||
2715 | case CHARS2 ('o', 'r')(((unsigned char)'o' << 8) | (unsigned char)'r'): // operator | | |||
2716 | opcode = BIT_IOR_EXPR; | |||
2717 | break; | |||
2718 | case CHARS2 ('e', 'o')(((unsigned char)'e' << 8) | (unsigned char)'o'): // operator ^ | |||
2719 | opcode = BIT_XOR_EXPR; | |||
2720 | break; | |||
2721 | case CHARS2 ('l', 's')(((unsigned char)'l' << 8) | (unsigned char)'s'): // operator << | |||
2722 | opcode = LSHIFT_EXPR; | |||
2723 | break; | |||
2724 | case CHARS2 ('r', 's')(((unsigned char)'r' << 8) | (unsigned char)'s'): // operator >> | |||
2725 | opcode = RSHIFT_EXPR; | |||
2726 | break; | |||
2727 | case CHARS2 ('e', 'q')(((unsigned char)'e' << 8) | (unsigned char)'q'): // operator == | |||
2728 | opcode = EQ_EXPR; | |||
2729 | break; | |||
2730 | case CHARS2 ('n', 'e')(((unsigned char)'n' << 8) | (unsigned char)'e'): // operator != | |||
2731 | opcode = NE_EXPR; | |||
2732 | break; | |||
2733 | case CHARS2 ('l', 't')(((unsigned char)'l' << 8) | (unsigned char)'t'): // operator < | |||
2734 | opcode = LT_EXPR; | |||
2735 | break; | |||
2736 | case CHARS2 ('g', 't')(((unsigned char)'g' << 8) | (unsigned char)'t'): // operator > | |||
2737 | opcode = GT_EXPR; | |||
2738 | break; | |||
2739 | case CHARS2 ('l', 'e')(((unsigned char)'l' << 8) | (unsigned char)'e'): // operator <= | |||
2740 | opcode = LE_EXPR; | |||
2741 | break; | |||
2742 | case CHARS2 ('g', 'e')(((unsigned char)'g' << 8) | (unsigned char)'e'): // operator >= | |||
2743 | opcode = GE_EXPR; | |||
2744 | break; | |||
2745 | case CHARS2 ('a', 'a')(((unsigned char)'a' << 8) | (unsigned char)'a'): // operator && | |||
2746 | opcode = TRUTH_ANDIF_EXPR; | |||
2747 | break; | |||
2748 | case CHARS2 ('o', 'o')(((unsigned char)'o' << 8) | (unsigned char)'o'): // operator || | |||
2749 | opcode = TRUTH_ORIF_EXPR; | |||
2750 | break; | |||
2751 | case CHARS2 ('c', 'm')(((unsigned char)'c' << 8) | (unsigned char)'m'): // operator , | |||
2752 | opcode = COMPOUND_EXPR; | |||
2753 | break; | |||
2754 | case CHARS2 ('p', 'm')(((unsigned char)'p' << 8) | (unsigned char)'m'): // operator ->* | |||
2755 | opcode = MEMBER_REF; | |||
2756 | break; | |||
2757 | case CHARS2 ('p', 't')(((unsigned char)'p' << 8) | (unsigned char)'t'): // operator -> | |||
2758 | opcode = INDIRECT_REF; // Not really! This will stand for | |||
2759 | // INDIRECT_REF followed by COMPONENT_REF | |||
2760 | // later on. | |||
2761 | break; | |||
2762 | case CHARS2 ('i', 'x')(((unsigned char)'i' << 8) | (unsigned char)'x'): // operator [] | |||
2763 | opcode = ARRAY_REF; | |||
2764 | break; | |||
2765 | case CHARS2 ('d', 's')(((unsigned char)'d' << 8) | (unsigned char)'s'): // operator .* | |||
2766 | opcode = DOTSTAR_EXPR; | |||
2767 | break; | |||
2768 | case CHARS2 ('d', 't')(((unsigned char)'d' << 8) | (unsigned char)'t'): // operator . | |||
2769 | opcode = COMPONENT_REF; | |||
2770 | break; | |||
2771 | ||||
2772 | default: | |||
2773 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2773, __FUNCTION__)); | |||
2774 | } | |||
2775 | ||||
2776 | processing_template_declscope_chain->x_processing_template_decl++; | |||
2777 | bool template_dependent_p = type_dependent_expression_p (op0) | |||
2778 | || value_dependent_expression_p (op0) | |||
2779 | || type_dependent_expression_p (op1) | |||
2780 | || value_dependent_expression_p (op1); | |||
2781 | if (!template_dependent_p) | |||
2782 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2783 | ||||
2784 | tree result; | |||
2785 | ||||
2786 | switch (opcode) | |||
2787 | { | |||
2788 | case INDIRECT_REF: // This is actually a "->". | |||
2789 | op0 = build_x_arrow (/*loc=*/0, op0, tf_error); | |||
2790 | /* Fall through. */ | |||
2791 | case COMPONENT_REF: | |||
2792 | result = finish_class_member_access_expr (op0, op1, | |||
2793 | /*template_p=*/false, | |||
2794 | tf_error); | |||
2795 | break; | |||
2796 | ||||
2797 | default: | |||
2798 | result = build_x_binary_op (/*loc=*/0, opcode, op0, ERROR_MARK, | |||
2799 | op1, ERROR_MARK, NULL_TREE(tree) nullptr, NULLnullptr, tf_error); | |||
2800 | break; | |||
2801 | } | |||
2802 | ||||
2803 | if (template_dependent_p) | |||
2804 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2805 | ||||
2806 | return convert_out (ctx->preserve (result)); | |||
2807 | } | |||
2808 | ||||
2809 | gcc_expr | |||
2810 | plugin_build_ternary_expr (cc1_plugin::connection *self, | |||
2811 | const char *ternary_op, | |||
2812 | gcc_expr operand1, | |||
2813 | gcc_expr operand2, | |||
2814 | gcc_expr operand3) | |||
2815 | { | |||
2816 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2817 | tree op0 = convert_in (operand1); | |||
2818 | tree op1 = convert_in (operand2); | |||
2819 | tree op2 = convert_in (operand3); | |||
2820 | gcc_assert (CHARS2 (ternary_op[0], ternary_op[1])((void)(!((((unsigned char)ternary_op[0] << 8) | (unsigned char)ternary_op[1]) == (((unsigned char)'q' << 8) | (unsigned char)'u')) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2821, __FUNCTION__), 0 : 0)) | |||
2821 | == CHARS2 ('q', 'u'))((void)(!((((unsigned char)ternary_op[0] << 8) | (unsigned char)ternary_op[1]) == (((unsigned char)'q' << 8) | (unsigned char)'u')) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2821, __FUNCTION__), 0 : 0)); // ternary operator | |||
2822 | ||||
2823 | processing_template_declscope_chain->x_processing_template_decl++; | |||
2824 | bool template_dependent_p = type_dependent_expression_p (op0) | |||
2825 | || value_dependent_expression_p (op0) | |||
2826 | || type_dependent_expression_p (op1) | |||
2827 | || value_dependent_expression_p (op1) | |||
2828 | || type_dependent_expression_p (op2) | |||
2829 | || value_dependent_expression_p (op2); | |||
2830 | if (!template_dependent_p) | |||
2831 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2832 | ||||
2833 | tree val = build_x_conditional_expr (/*loc=*/0, op0, op1, op2, tf_error); | |||
2834 | ||||
2835 | if (template_dependent_p) | |||
2836 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2837 | ||||
2838 | return convert_out (ctx->preserve (val)); | |||
2839 | } | |||
2840 | ||||
2841 | gcc_expr | |||
2842 | plugin_build_unary_type_expr (cc1_plugin::connection *self, | |||
2843 | const char *unary_op, | |||
2844 | gcc_type operand) | |||
2845 | { | |||
2846 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2847 | tree type = convert_in (operand); | |||
2848 | tree_code opcode = ERROR_MARK; | |||
2849 | ||||
2850 | switch (CHARS2 (unary_op[0], unary_op[1])(((unsigned char)unary_op[0] << 8) | (unsigned char)unary_op [1])) | |||
2851 | { | |||
2852 | case CHARS2 ('t', 'i')(((unsigned char)'t' << 8) | (unsigned char)'i'): // typeid (type) | |||
2853 | opcode = TYPEID_EXPR; | |||
2854 | break; | |||
2855 | ||||
2856 | case CHARS2 ('s', 't')(((unsigned char)'s' << 8) | (unsigned char)'t'): // sizeof (type) | |||
2857 | opcode = SIZEOF_EXPR; | |||
2858 | break; | |||
2859 | case CHARS2 ('a', 't')(((unsigned char)'a' << 8) | (unsigned char)'t'): // alignof (type) | |||
2860 | opcode = ALIGNOF_EXPR; | |||
2861 | break; | |||
2862 | ||||
2863 | case CHARS2 ('s', 'Z')(((unsigned char)'s' << 8) | (unsigned char)'Z'): // sizeof...(pack) | |||
2864 | opcode = TYPE_PACK_EXPANSION; // Not really, but let's use its code. | |||
2865 | break; | |||
2866 | ||||
2867 | // FIXME: do we have to handle "sp", for the size of a captured | |||
2868 | // template parameter pack from an alias template, taking | |||
2869 | // multiple template arguments? | |||
2870 | ||||
2871 | default: | |||
2872 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2872, __FUNCTION__)); | |||
2873 | } | |||
2874 | ||||
2875 | processing_template_declscope_chain->x_processing_template_decl++; | |||
2876 | bool template_dependent_p = dependent_type_p (type); | |||
2877 | if (!template_dependent_p) | |||
2878 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2879 | ||||
2880 | tree result; | |||
2881 | ||||
2882 | switch (opcode) | |||
2883 | { | |||
2884 | case TYPEID_EXPR: | |||
2885 | result = get_typeid (type, tf_error); | |||
2886 | break; | |||
2887 | ||||
2888 | // We're using this for sizeof...(pack). */ | |||
2889 | case TYPE_PACK_EXPANSION: | |||
2890 | result = make_pack_expansion (type); | |||
2891 | PACK_EXPANSION_SIZEOF_P (result)((tree_not_check2 (((tree_check2 ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2891, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION )))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2891, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) = true; | |||
2892 | break; | |||
2893 | ||||
2894 | default: | |||
2895 | /* Use the C++11 alignof semantics. */ | |||
2896 | result = cxx_sizeof_or_alignof_type (input_location, type, | |||
2897 | opcode, true, true); | |||
2898 | } | |||
2899 | ||||
2900 | if (template_dependent_p) | |||
2901 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2902 | ||||
2903 | return convert_out (ctx->preserve (result)); | |||
2904 | } | |||
2905 | ||||
2906 | gcc_expr | |||
2907 | plugin_build_cast_expr (cc1_plugin::connection *self, | |||
2908 | const char *binary_op, | |||
2909 | gcc_type operand1, | |||
2910 | gcc_expr operand2) | |||
2911 | { | |||
2912 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2913 | tree (*build_cast)(location_t loc, tree type, tree expr, | |||
2914 | tsubst_flags_t complain) = NULLnullptr; | |||
2915 | tree type = convert_in (operand1); | |||
2916 | tree expr = convert_in (operand2); | |||
2917 | ||||
2918 | switch (CHARS2 (binary_op[0], binary_op[1])(((unsigned char)binary_op[0] << 8) | (unsigned char)binary_op [1])) | |||
2919 | { | |||
2920 | case CHARS2 ('d', 'c')(((unsigned char)'d' << 8) | (unsigned char)'c'): // dynamic_cast | |||
2921 | build_cast = build_dynamic_cast; | |||
2922 | break; | |||
2923 | ||||
2924 | case CHARS2 ('s', 'c')(((unsigned char)'s' << 8) | (unsigned char)'c'): // static_cast | |||
2925 | build_cast = build_static_cast; | |||
2926 | break; | |||
2927 | ||||
2928 | case CHARS2 ('c', 'c')(((unsigned char)'c' << 8) | (unsigned char)'c'): // const_cast | |||
2929 | build_cast = build_const_cast; | |||
2930 | break; | |||
2931 | ||||
2932 | case CHARS2 ('r', 'c')(((unsigned char)'r' << 8) | (unsigned char)'c'): // reinterpret_cast | |||
2933 | build_cast = build_reinterpret_cast; | |||
2934 | break; | |||
2935 | ||||
2936 | case CHARS2 ('c', 'v')(((unsigned char)'c' << 8) | (unsigned char)'v'): // C cast, conversion with one argument | |||
2937 | build_cast = cp_build_c_cast; | |||
2938 | break; | |||
2939 | ||||
2940 | default: | |||
2941 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2941, __FUNCTION__)); | |||
2942 | } | |||
2943 | ||||
2944 | processing_template_declscope_chain->x_processing_template_decl++; | |||
2945 | bool template_dependent_p = dependent_type_p (type) | |||
2946 | || type_dependent_expression_p (expr) | |||
2947 | || value_dependent_expression_p (expr); | |||
2948 | if (!template_dependent_p) | |||
2949 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2950 | ||||
2951 | tree val = build_cast (input_location, type, expr, tf_error); | |||
2952 | ||||
2953 | if (template_dependent_p) | |||
2954 | processing_template_declscope_chain->x_processing_template_decl--; | |||
2955 | ||||
2956 | return convert_out (ctx->preserve (val)); | |||
2957 | } | |||
2958 | ||||
2959 | static inline vec<tree, va_gc> * | |||
2960 | args_to_tree_vec (const struct gcc_cp_function_args *args_in) | |||
2961 | { | |||
2962 | vec<tree, va_gc> *args = make_tree_vector (); | |||
2963 | for (int i = 0; i < args_in->n_elements; i++) | |||
2964 | vec_safe_push (args, convert_in (args_in->elements[i])); | |||
2965 | return args; | |||
2966 | } | |||
2967 | ||||
2968 | static inline tree | |||
2969 | args_to_tree_list (const struct gcc_cp_function_args *args_in) | |||
2970 | { | |||
2971 | tree args, *tail = &args; | |||
2972 | for (int i = 0; i < args_in->n_elements; i++) | |||
2973 | { | |||
2974 | *tail = build_tree_list (NULLnullptr, convert_in (args_in->elements[i])); | |||
2975 | tail = &TREE_CHAIN (*tail)((contains_struct_check ((*tail), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 2975, __FUNCTION__))->common.chain); | |||
2976 | } | |||
2977 | return args; | |||
| ||||
2978 | } | |||
2979 | ||||
2980 | static inline vec<constructor_elt, va_gc> * | |||
2981 | args_to_ctor_elts (const struct gcc_cp_function_args *args_in) | |||
2982 | { | |||
2983 | vec<constructor_elt, va_gc> *args = NULLnullptr; | |||
2984 | for (int i = 0; i < args_in->n_elements; i++) | |||
2985 | CONSTRUCTOR_APPEND_ELT (args, NULL_TREE, convert_in (args_in->elements[i]))do { constructor_elt _ce___ = {(tree) nullptr, convert_in (args_in ->elements[i])}; vec_safe_push ((args), _ce___); } while ( 0); | |||
2986 | return args; | |||
2987 | } | |||
2988 | ||||
2989 | gcc_expr | |||
2990 | plugin_build_expression_list_expr (cc1_plugin::connection *self, | |||
2991 | const char *conv_op, | |||
2992 | gcc_type type_in, | |||
2993 | const struct gcc_cp_function_args *values_in) | |||
2994 | { | |||
2995 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
2996 | tree type = convert_in (type_in); | |||
2997 | tree args; | |||
2998 | tree result; | |||
2999 | ||||
3000 | switch (CHARS2 (conv_op[0], conv_op[1])(((unsigned char)conv_op[0] << 8) | (unsigned char)conv_op [1])) | |||
| ||||
3001 | { | |||
3002 | case CHARS2 ('c', 'v')(((unsigned char)'c' << 8) | (unsigned char)'v'): // conversion with parenthesized expression list | |||
3003 | gcc_assert (TYPE_P (type))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int ) (((enum tree_code) (type)->base.code))] == tcc_type)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3003, __FUNCTION__), 0 : 0)); | |||
3004 | args = args_to_tree_list (values_in); | |||
3005 | result = build_functional_cast (input_location, type, args, tf_error); | |||
3006 | break; | |||
3007 | ||||
3008 | case CHARS2 ('t', 'l')(((unsigned char)'t' << 8) | (unsigned char)'l'): // conversion with braced expression list | |||
3009 | gcc_assert (type)((void)(!(type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3009, __FUNCTION__), 0 : 0)); | |||
3010 | gcc_assert (TYPE_P (type))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int ) (((enum tree_code) (type)->base.code))] == tcc_type)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3010, __FUNCTION__), 0 : 0)); | |||
3011 | args = make_node (CONSTRUCTOR); | |||
3012 | CONSTRUCTOR_ELTS (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3012, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts) = args_to_ctor_elts (values_in); | |||
3013 | CONSTRUCTOR_IS_DIRECT_INIT (args)(((tree_not_check2 (((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3013, __FUNCTION__, (CONSTRUCTOR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3013, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) = 1; | |||
3014 | result = finish_compound_literal (type, args, tf_error); | |||
3015 | break; | |||
3016 | ||||
3017 | case CHARS2 ('i', 'l')(((unsigned char)'i' << 8) | (unsigned char)'l'): // untyped braced expression list | |||
3018 | gcc_assert (!type)((void)(!(!type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3018, __FUNCTION__), 0 : 0)); | |||
3019 | result = make_node (CONSTRUCTOR); | |||
3020 | CONSTRUCTOR_ELTS (result)((tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3020, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts) = args_to_ctor_elts (values_in); | |||
3021 | break; | |||
3022 | ||||
3023 | default: | |||
3024 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3024, __FUNCTION__)); | |||
3025 | } | |||
3026 | ||||
3027 | return convert_out (ctx->preserve (result)); | |||
3028 | } | |||
3029 | ||||
3030 | gcc_expr | |||
3031 | plugin_build_new_expr (cc1_plugin::connection *self, | |||
3032 | const char *new_op, | |||
3033 | const struct gcc_cp_function_args *placement_in, | |||
3034 | gcc_type type_in, | |||
3035 | const struct gcc_cp_function_args *initializer_in) | |||
3036 | { | |||
3037 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3038 | tree type = convert_in (type_in); | |||
3039 | vec<tree, va_gc> *placement = NULLnullptr, *initializer = NULLnullptr; | |||
3040 | bool global_scope_p = false; | |||
3041 | tree nelts = NULLnullptr; | |||
3042 | ||||
3043 | if (placement_in) | |||
3044 | placement = args_to_tree_vec (placement_in); | |||
3045 | if (initializer_in) | |||
3046 | initializer = args_to_tree_vec (initializer_in); | |||
3047 | ||||
3048 | gcc_assert (TYPE_P (type))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int ) (((enum tree_code) (type)->base.code))] == tcc_type)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3048, __FUNCTION__), 0 : 0)); | |||
3049 | ||||
3050 | once_more: | |||
3051 | switch (CHARS2 (new_op[0], new_op[1])(((unsigned char)new_op[0] << 8) | (unsigned char)new_op [1])) | |||
3052 | { | |||
3053 | case CHARS2 ('g', 's')(((unsigned char)'g' << 8) | (unsigned char)'s'): | |||
3054 | gcc_assert (!global_scope_p)((void)(!(!global_scope_p) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3054, __FUNCTION__), 0 : 0)); | |||
3055 | global_scope_p = true; | |||
3056 | new_op += 2; | |||
3057 | goto once_more; | |||
3058 | ||||
3059 | case CHARS2 ('n', 'w')(((unsigned char)'n' << 8) | (unsigned char)'w'): // non-array new | |||
3060 | gcc_assert (TREE_CODE (type) != ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) != ARRAY_TYPE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3060, __FUNCTION__), 0 : 0)); | |||
3061 | break; | |||
3062 | ||||
3063 | case CHARS2 ('n', 'a')(((unsigned char)'n' << 8) | (unsigned char)'a'): // array new | |||
3064 | gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3064, __FUNCTION__), 0 : 0)); | |||
3065 | gcc_assert (TYPE_DOMAIN (type))((void)(!(((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3065, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3065, __FUNCTION__), 0 : 0)); | |||
3066 | { | |||
3067 | // Compute the length of the outermost array type, then discard it. | |||
3068 | tree maxelt = TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3068, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3068, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ); | |||
3069 | tree eltype = TREE_TYPE (maxelt)((contains_struct_check ((maxelt), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3069, __FUNCTION__))->typed.type); | |||
3070 | tree onecst = integer_one_nodeglobal_trees[TI_INTEGER_ONE]; | |||
3071 | ||||
3072 | processing_template_declscope_chain->x_processing_template_decl++; | |||
3073 | bool template_dependent_p = value_dependent_expression_p (maxelt) | |||
3074 | || type_dependent_expression_p (maxelt); | |||
3075 | if (!template_dependent_p) | |||
3076 | { | |||
3077 | processing_template_declscope_chain->x_processing_template_decl--; | |||
3078 | onecst = fold_convert (eltype, onecst)fold_convert_loc (((location_t) 0), eltype, onecst); | |||
3079 | } | |||
3080 | ||||
3081 | nelts = fold_build2 (PLUS_EXPR, eltype, nelts, onecst)fold_build2_loc (((location_t) 0), PLUS_EXPR, eltype, nelts, onecst ); | |||
3082 | ||||
3083 | if (template_dependent_p) | |||
3084 | processing_template_declscope_chain->x_processing_template_decl--; | |||
3085 | ||||
3086 | type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3086, __FUNCTION__))->typed.type); | |||
3087 | } | |||
3088 | break; | |||
3089 | ||||
3090 | default: | |||
3091 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3091, __FUNCTION__)); | |||
3092 | } | |||
3093 | ||||
3094 | processing_template_declscope_chain->x_processing_template_decl++; | |||
3095 | bool template_dependent_p = dependent_type_p (type) | |||
3096 | || value_dependent_expression_p (nelts) | |||
3097 | || (placement | |||
3098 | && any_type_dependent_arguments_p (placement)) | |||
3099 | || (initializer | |||
3100 | && any_type_dependent_arguments_p (initializer)); | |||
3101 | if (!template_dependent_p) | |||
3102 | processing_template_declscope_chain->x_processing_template_decl--; | |||
3103 | ||||
3104 | tree result = build_new (input_location, &placement, type, nelts, | |||
3105 | &initializer, global_scope_p, tf_error); | |||
3106 | ||||
3107 | if (template_dependent_p) | |||
3108 | processing_template_declscope_chain->x_processing_template_decl--; | |||
3109 | ||||
3110 | if (placement != NULLnullptr) | |||
3111 | release_tree_vector (placement); | |||
3112 | if (initializer != NULLnullptr) | |||
3113 | release_tree_vector (initializer); | |||
3114 | ||||
3115 | return convert_out (ctx->preserve (result)); | |||
3116 | } | |||
3117 | ||||
3118 | gcc_expr | |||
3119 | plugin_build_call_expr (cc1_plugin::connection *self, | |||
3120 | gcc_expr callable_in, int qualified_p, | |||
3121 | const struct gcc_cp_function_args *args_in) | |||
3122 | { | |||
3123 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3124 | tree callable = convert_in (callable_in); | |||
3125 | tree call_expr; | |||
3126 | ||||
3127 | vec<tree, va_gc> *args = args_to_tree_vec (args_in); | |||
3128 | ||||
3129 | bool koenig_p = false; | |||
3130 | if (!qualified_p && !args->is_empty ()) | |||
3131 | { | |||
3132 | if (identifier_p (callable)) | |||
3133 | koenig_p = true; | |||
3134 | else if (is_overloaded_fn (callable)) | |||
3135 | { | |||
3136 | tree fn = get_first_fn (callable); | |||
3137 | fn = STRIP_TEMPLATE (fn)(((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3137, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn); | |||
3138 | ||||
3139 | if (!DECL_FUNCTION_MEMBER_P (fn)((((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3139, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE ) || (__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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3139, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3139, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3139, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) nullptr && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3139, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3139, __FUNCTION__); <->u.fn; })->static_function )) | |||
3140 | && !DECL_LOCAL_DECL_P (fn)((contains_struct_check (((tree_check2 ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3140, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3140, __FUNCTION__))->decl_common.lang_flag_0)) | |||
3141 | koenig_p = true; | |||
3142 | } | |||
3143 | } | |||
3144 | ||||
3145 | if (koenig_p && !any_type_dependent_arguments_p (args)) | |||
3146 | callable = perform_koenig_lookup (callable, args, tf_none); | |||
3147 | ||||
3148 | if (TREE_CODE (callable)((enum tree_code) (callable)->base.code) == COMPONENT_REF) | |||
3149 | { | |||
3150 | tree object = TREE_OPERAND (callable, 0)(*((const_cast<tree*> (tree_operand_check ((callable), ( 0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3150, __FUNCTION__))))); | |||
3151 | tree memfn = TREE_OPERAND (callable, 1)(*((const_cast<tree*> (tree_operand_check ((callable), ( 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3151, __FUNCTION__))))); | |||
3152 | ||||
3153 | if (type_dependent_expression_p (object) | |||
3154 | || (!BASELINK_P (memfn)(((enum tree_code) (memfn)->base.code) == BASELINK) && TREE_CODE (memfn)((enum tree_code) (memfn)->base.code) != FIELD_DECL) | |||
3155 | || type_dependent_expression_p (memfn) | |||
3156 | || any_type_dependent_arguments_p (args)) | |||
3157 | call_expr = build_nt_call_vec (callable, args); | |||
3158 | else if (BASELINK_P (memfn)(((enum tree_code) (memfn)->base.code) == BASELINK)) | |||
3159 | call_expr = build_new_method_call (object, memfn, &args, NULL_TREE(tree) nullptr, | |||
3160 | qualified_p | |||
3161 | ? LOOKUP_NORMAL((1 << 0))|LOOKUP_NONVIRTUAL(1 << 1) | |||
3162 | : LOOKUP_NORMAL((1 << 0)), | |||
3163 | NULLnullptr, tf_none); | |||
3164 | else | |||
3165 | call_expr = finish_call_expr (callable, &args, false, false, tf_none); | |||
3166 | } | |||
3167 | else if (TREE_CODE (callable)((enum tree_code) (callable)->base.code) == OFFSET_REF | |||
3168 | || TREE_CODE (callable)((enum tree_code) (callable)->base.code) == MEMBER_REF | |||
3169 | || TREE_CODE (callable)((enum tree_code) (callable)->base.code) == DOTSTAR_EXPR) | |||
3170 | call_expr = build_offset_ref_call_from_tree (callable, &args, tf_none); | |||
3171 | else | |||
3172 | call_expr = finish_call_expr (callable, &args, | |||
3173 | !!qualified_p, koenig_p, tf_none); | |||
3174 | ||||
3175 | release_tree_vector (args); | |||
3176 | return convert_out (ctx->preserve (call_expr)); | |||
3177 | } | |||
3178 | ||||
3179 | gcc_type | |||
3180 | plugin_get_expr_type (cc1_plugin::connection *self, | |||
3181 | gcc_expr operand) | |||
3182 | { | |||
3183 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3184 | tree op0 = convert_in (operand); | |||
3185 | tree type; | |||
3186 | if (op0) | |||
3187 | type = TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3187, __FUNCTION__))->typed.type); | |||
3188 | else | |||
3189 | type = make_decltype_auto (); | |||
3190 | return convert_out (ctx->preserve (type)); | |||
3191 | } | |||
3192 | ||||
3193 | gcc_decl | |||
3194 | plugin_build_function_template_specialization (cc1_plugin::connection *self, | |||
3195 | gcc_decl template_decl, | |||
3196 | const gcc_cp_template_args *targs, | |||
3197 | gcc_address address, | |||
3198 | const char *filename, | |||
3199 | unsigned int line_number) | |||
3200 | { | |||
3201 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3202 | location_t loc = ctx->get_location_t (filename, line_number); | |||
3203 | tree name = convert_in (template_decl); | |||
3204 | tree targsl = targlist (targs); | |||
3205 | ||||
3206 | tree decl = tsubst (name, targsl, tf_error, NULL_TREE(tree) nullptr); | |||
3207 | DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3207, __FUNCTION__))->decl_minimal.locus) = loc; | |||
3208 | ||||
3209 | record_decl_address (ctx, build_decl_addr_value (decl, address)); | |||
3210 | ||||
3211 | return convert_out (ctx->preserve (decl)); | |||
3212 | } | |||
3213 | ||||
3214 | gcc_decl | |||
3215 | plugin_build_class_template_specialization (cc1_plugin::connection *self, | |||
3216 | gcc_decl template_decl, | |||
3217 | const gcc_cp_template_args *args, | |||
3218 | const char *filename, | |||
3219 | unsigned int line_number) | |||
3220 | { | |||
3221 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3222 | location_t loc = ctx->get_location_t (filename, line_number); | |||
3223 | tree name = convert_in (template_decl); | |||
3224 | ||||
3225 | tree tdecl = finish_template_type (name, targlist (args), false);; | |||
3226 | DECL_SOURCE_LOCATION (tdecl)((contains_struct_check ((tdecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3226, __FUNCTION__))->decl_minimal.locus) = loc; | |||
3227 | ||||
3228 | return convert_out (ctx->preserve (tdecl)); | |||
3229 | } | |||
3230 | ||||
3231 | /* Return a builtin type associated with BUILTIN_NAME. */ | |||
3232 | ||||
3233 | static tree | |||
3234 | safe_lookup_builtin_type (const char *builtin_name) | |||
3235 | { | |||
3236 | tree result = NULL_TREE(tree) nullptr; | |||
3237 | ||||
3238 | if (!builtin_name) | |||
3239 | return result; | |||
3240 | ||||
3241 | result = identifier_global_value (get_identifier (builtin_name)(__builtin_constant_p (builtin_name) ? get_identifier_with_length ((builtin_name), strlen (builtin_name)) : get_identifier (builtin_name ))); | |||
3242 | ||||
3243 | if (!result) | |||
3244 | return result; | |||
3245 | ||||
3246 | gcc_assert (TREE_CODE (result) == TYPE_DECL)((void)(!(((enum tree_code) (result)->base.code) == TYPE_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3246, __FUNCTION__), 0 : 0)); | |||
3247 | result = TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3247, __FUNCTION__))->typed.type); | |||
3248 | return result; | |||
3249 | } | |||
3250 | ||||
3251 | gcc_type | |||
3252 | plugin_get_int_type (cc1_plugin::connection *self, | |||
3253 | int is_unsigned, unsigned long size_in_bytes, | |||
3254 | const char *builtin_name) | |||
3255 | { | |||
3256 | tree result; | |||
3257 | ||||
3258 | if (builtin_name) | |||
3259 | { | |||
3260 | result = safe_lookup_builtin_type (builtin_name); | |||
3261 | gcc_assert (!result || TREE_CODE (result) == INTEGER_TYPE)((void)(!(!result || ((enum tree_code) (result)->base.code ) == INTEGER_TYPE) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3261, __FUNCTION__), 0 : 0)); | |||
3262 | } | |||
3263 | else | |||
3264 | result = c_common_type_for_size (BITS_PER_UNIT(8) * size_in_bytes, | |||
3265 | is_unsigned); | |||
3266 | ||||
3267 | if (result == NULL_TREE(tree) nullptr) | |||
3268 | result = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | |||
3269 | else | |||
3270 | { | |||
3271 | gcc_assert (!TYPE_UNSIGNED (result) == !is_unsigned)((void)(!(!((tree_class_check ((result), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3271, __FUNCTION__))->base.u.bits.unsigned_flag) == !is_unsigned ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3271, __FUNCTION__), 0 : 0)); | |||
3272 | gcc_assert (TREE_CODE (TYPE_SIZE (result)) == INTEGER_CST)((void)(!(((enum tree_code) (((tree_class_check ((result), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3272, __FUNCTION__))->type_common.size))->base.code) == INTEGER_CST) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3272, __FUNCTION__), 0 : 0)); | |||
3273 | gcc_assert (TYPE_PRECISION (result) == BITS_PER_UNIT * size_in_bytes)((void)(!(((tree_class_check ((result), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3273, __FUNCTION__))->type_common.precision) == (8) * size_in_bytes ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3273, __FUNCTION__), 0 : 0)); | |||
3274 | ||||
3275 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3276 | ctx->preserve (result); | |||
3277 | } | |||
3278 | return convert_out (result); | |||
3279 | } | |||
3280 | ||||
3281 | gcc_type | |||
3282 | plugin_get_char_type (cc1_plugin::connection *) | |||
3283 | { | |||
3284 | return convert_out (char_type_nodeinteger_types[itk_char]); | |||
3285 | } | |||
3286 | ||||
3287 | gcc_type | |||
3288 | plugin_get_float_type (cc1_plugin::connection *, | |||
3289 | unsigned long size_in_bytes, | |||
3290 | const char *builtin_name) | |||
3291 | { | |||
3292 | if (builtin_name) | |||
3293 | { | |||
3294 | tree result = safe_lookup_builtin_type (builtin_name); | |||
3295 | ||||
3296 | if (!result) | |||
3297 | return convert_out (error_mark_nodeglobal_trees[TI_ERROR_MARK]); | |||
3298 | ||||
3299 | gcc_assert (TREE_CODE (result) == REAL_TYPE)((void)(!(((enum tree_code) (result)->base.code) == REAL_TYPE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3299, __FUNCTION__), 0 : 0)); | |||
3300 | gcc_assert (BITS_PER_UNIT * size_in_bytes == TYPE_PRECISION (result))((void)(!((8) * size_in_bytes == ((tree_class_check ((result) , (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3300, __FUNCTION__))->type_common.precision)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3300, __FUNCTION__), 0 : 0)); | |||
3301 | ||||
3302 | return convert_out (result); | |||
3303 | } | |||
3304 | ||||
3305 | if (BITS_PER_UNIT(8) * size_in_bytes == TYPE_PRECISION (float_type_node)((tree_class_check ((global_trees[TI_FLOAT_TYPE]), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3305, __FUNCTION__))->type_common.precision)) | |||
3306 | return convert_out (float_type_nodeglobal_trees[TI_FLOAT_TYPE]); | |||
3307 | if (BITS_PER_UNIT(8) * size_in_bytes == TYPE_PRECISION (double_type_node)((tree_class_check ((global_trees[TI_DOUBLE_TYPE]), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3307, __FUNCTION__))->type_common.precision)) | |||
3308 | return convert_out (double_type_nodeglobal_trees[TI_DOUBLE_TYPE]); | |||
3309 | if (BITS_PER_UNIT(8) * size_in_bytes == TYPE_PRECISION (long_double_type_node)((tree_class_check ((global_trees[TI_LONG_DOUBLE_TYPE]), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3309, __FUNCTION__))->type_common.precision)) | |||
3310 | return convert_out (long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE]); | |||
3311 | return convert_out (error_mark_nodeglobal_trees[TI_ERROR_MARK]); | |||
3312 | } | |||
3313 | ||||
3314 | gcc_type | |||
3315 | plugin_get_void_type (cc1_plugin::connection *) | |||
3316 | { | |||
3317 | return convert_out (void_type_nodeglobal_trees[TI_VOID_TYPE]); | |||
3318 | } | |||
3319 | ||||
3320 | gcc_type | |||
3321 | plugin_get_bool_type (cc1_plugin::connection *) | |||
3322 | { | |||
3323 | return convert_out (boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE]); | |||
3324 | } | |||
3325 | ||||
3326 | gcc_type | |||
3327 | plugin_get_nullptr_type (cc1_plugin::connection *) | |||
3328 | { | |||
3329 | return convert_out (nullptr_type_nodec_global_trees[CTI_NULLPTR_TYPE]); | |||
3330 | } | |||
3331 | ||||
3332 | gcc_expr | |||
3333 | plugin_get_nullptr_constant (cc1_plugin::connection *) | |||
3334 | { | |||
3335 | return convert_out (nullptr_nodec_global_trees[CTI_NULLPTR]); | |||
3336 | } | |||
3337 | ||||
3338 | gcc_type | |||
3339 | plugin_build_array_type (cc1_plugin::connection *self, | |||
3340 | gcc_type element_type_in, int num_elements) | |||
3341 | { | |||
3342 | tree element_type = convert_in (element_type_in); | |||
3343 | tree result; | |||
3344 | ||||
3345 | if (num_elements == -1) | |||
3346 | result = build_array_type (element_type, NULL_TREE(tree) nullptr); | |||
3347 | else | |||
3348 | result = build_array_type_nelts (element_type, num_elements); | |||
3349 | ||||
3350 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3351 | return convert_out (ctx->preserve (result)); | |||
3352 | } | |||
3353 | ||||
3354 | gcc_type | |||
3355 | plugin_build_dependent_array_type (cc1_plugin::connection *self, | |||
3356 | gcc_type element_type_in, | |||
3357 | gcc_expr num_elements_in) | |||
3358 | { | |||
3359 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3360 | tree element_type = convert_in (element_type_in); | |||
3361 | tree size = convert_in (num_elements_in); | |||
3362 | tree name = get_identifier ("dependent array type")(__builtin_constant_p ("dependent array type") ? get_identifier_with_length (("dependent array type"), strlen ("dependent array type")) : get_identifier ("dependent array type")); | |||
3363 | ||||
3364 | processing_template_declscope_chain->x_processing_template_decl++; | |||
3365 | bool template_dependent_p = dependent_type_p (element_type) | |||
3366 | || type_dependent_expression_p (size) | |||
3367 | || value_dependent_expression_p (size); | |||
3368 | if (!template_dependent_p) | |||
3369 | processing_template_declscope_chain->x_processing_template_decl--; | |||
3370 | ||||
3371 | tree itype = compute_array_index_type (name, size, tf_error); | |||
3372 | tree type = build_cplus_array_type (element_type, itype); | |||
3373 | ||||
3374 | if (template_dependent_p) | |||
3375 | processing_template_declscope_chain->x_processing_template_decl--; | |||
3376 | ||||
3377 | return convert_out (ctx->preserve (type)); | |||
3378 | } | |||
3379 | ||||
3380 | gcc_type | |||
3381 | plugin_build_vla_array_type (cc1_plugin::connection *self, | |||
3382 | gcc_type element_type_in, | |||
3383 | const char *upper_bound_name) | |||
3384 | { | |||
3385 | tree element_type = convert_in (element_type_in); | |||
3386 | tree upper_bound = lookup_name (get_identifier (upper_bound_name)(__builtin_constant_p (upper_bound_name) ? get_identifier_with_length ((upper_bound_name), strlen (upper_bound_name)) : get_identifier (upper_bound_name))); | |||
3387 | tree size = fold_build2 (PLUS_EXPR, TREE_TYPE (upper_bound), upper_bound,fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check ((upper_bound), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3387, __FUNCTION__))->typed.type), upper_bound, build_one_cst (((contains_struct_check ((upper_bound), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3388, __FUNCTION__))->typed.type)) ) | |||
3388 | build_one_cst (TREE_TYPE (upper_bound)))fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check ((upper_bound), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3387, __FUNCTION__))->typed.type), upper_bound, build_one_cst (((contains_struct_check ((upper_bound), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3388, __FUNCTION__))->typed.type)) ); | |||
3389 | tree range = compute_array_index_type (NULL_TREE(tree) nullptr, size, | |||
3390 | tf_error); | |||
3391 | ||||
3392 | tree result = build_cplus_array_type (element_type, range); | |||
3393 | ||||
3394 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3395 | return convert_out (ctx->preserve (result)); | |||
3396 | } | |||
3397 | ||||
3398 | gcc_type | |||
3399 | plugin_build_qualified_type (cc1_plugin::connection *, | |||
3400 | gcc_type unqualified_type_in, | |||
3401 | enum gcc_cp_qualifiers qualifiers) | |||
3402 | { | |||
3403 | tree unqualified_type = convert_in (unqualified_type_in); | |||
3404 | cp_cv_quals quals = 0; | |||
3405 | ||||
3406 | if ((qualifiers & GCC_CP_QUALIFIER_CONST) != 0) | |||
3407 | quals |= TYPE_QUAL_CONST; | |||
3408 | if ((qualifiers & GCC_CP_QUALIFIER_VOLATILE) != 0) | |||
3409 | quals |= TYPE_QUAL_VOLATILE; | |||
3410 | if ((qualifiers & GCC_CP_QUALIFIER_RESTRICT) != 0) | |||
3411 | quals |= TYPE_QUAL_RESTRICT; | |||
3412 | ||||
3413 | gcc_assert ((TREE_CODE (unqualified_type) != METHOD_TYPE((void)(!((((enum tree_code) (unqualified_type)->base.code ) != METHOD_TYPE && ((enum tree_code) (unqualified_type )->base.code) != REFERENCE_TYPE) || quals == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3415, __FUNCTION__), 0 : 0)) | |||
3414 | && TREE_CODE (unqualified_type) != REFERENCE_TYPE)((void)(!((((enum tree_code) (unqualified_type)->base.code ) != METHOD_TYPE && ((enum tree_code) (unqualified_type )->base.code) != REFERENCE_TYPE) || quals == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3415, __FUNCTION__), 0 : 0)) | |||
3415 | || quals == 0)((void)(!((((enum tree_code) (unqualified_type)->base.code ) != METHOD_TYPE && ((enum tree_code) (unqualified_type )->base.code) != REFERENCE_TYPE) || quals == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3415, __FUNCTION__), 0 : 0)); | |||
3416 | ||||
3417 | return convert_out (build_qualified_type (unqualified_type, quals)); | |||
3418 | } | |||
3419 | ||||
3420 | gcc_type | |||
3421 | plugin_build_complex_type (cc1_plugin::connection *self, | |||
3422 | gcc_type base_type) | |||
3423 | { | |||
3424 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3425 | return convert_out (ctx->preserve (build_complex_type (convert_in (base_type)))); | |||
3426 | } | |||
3427 | ||||
3428 | gcc_type | |||
3429 | plugin_build_vector_type (cc1_plugin::connection *self, | |||
3430 | gcc_type base_type, int nunits) | |||
3431 | { | |||
3432 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3433 | return convert_out (ctx->preserve (build_vector_type (convert_in (base_type), | |||
3434 | nunits))); | |||
3435 | } | |||
3436 | ||||
3437 | int | |||
3438 | plugin_build_constant (cc1_plugin::connection *self, gcc_type type_in, | |||
3439 | const char *name, unsigned long value, | |||
3440 | const char *filename, unsigned int line_number) | |||
3441 | { | |||
3442 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3443 | tree cst, decl; | |||
3444 | tree type = convert_in (type_in); | |||
3445 | ||||
3446 | cst = build_int_cst (type, value); | |||
3447 | if (!TYPE_READONLY (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3447, __FUNCTION__))->base.readonly_flag)) | |||
3448 | type = build_qualified_type (type, TYPE_QUAL_CONST); | |||
3449 | decl = build_decl (ctx->get_location_t (filename, line_number), | |||
3450 | VAR_DECL, get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name ), strlen (name)) : get_identifier (name)), type); | |||
3451 | TREE_STATIC (decl)((decl)->base.static_flag) = 1; | |||
3452 | TREE_READONLY (decl)((non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3452, __FUNCTION__))->base.readonly_flag) = 1; | |||
3453 | cp_finish_decl (decl, cst, true, NULLnullptr, LOOKUP_ONLYCONVERTING(1 << 2)); | |||
3454 | safe_pushdecl (decl); | |||
3455 | ||||
3456 | return 1; | |||
3457 | } | |||
3458 | ||||
3459 | gcc_type | |||
3460 | plugin_error (cc1_plugin::connection *, | |||
3461 | const char *message) | |||
3462 | { | |||
3463 | error ("%s", message); | |||
3464 | return convert_out (error_mark_nodeglobal_trees[TI_ERROR_MARK]); | |||
3465 | } | |||
3466 | ||||
3467 | int | |||
3468 | plugin_add_static_assert (cc1_plugin::connection *self, | |||
3469 | gcc_expr condition_in, | |||
3470 | const char *errormsg, | |||
3471 | const char *filename, | |||
3472 | unsigned int line_number) | |||
3473 | { | |||
3474 | plugin_context *ctx = static_cast<plugin_context *> (self); | |||
3475 | tree condition = convert_in (condition_in); | |||
3476 | ||||
3477 | if (!errormsg) | |||
3478 | errormsg = ""; | |||
3479 | ||||
3480 | tree message = build_string (strlen (errormsg) + 1, errormsg); | |||
3481 | ||||
3482 | TREE_TYPE (message)((contains_struct_check ((message), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/libcc1/libcp1plugin.cc" , 3482, __FUNCTION__))->typed.type) = char_array_type_nodec_global_trees[CTI_CHAR_ARRAY_TYPE]; | |||
3483 | fix_string_type (message); | |||
3484 | ||||
3485 | location_t loc = ctx->get_location_t (filename, line_number); | |||
3486 | ||||
3487 | bool member_p = at_class_scope_p (); | |||
3488 | ||||
3489 | finish_static_assert (condition, message, loc, member_p, false); | |||
3490 | ||||
3491 | return 1; | |||
3492 | } | |||
3493 | ||||
3494 | ||||
3495 | ||||
3496 | #ifdef __GNUC__4 | |||
3497 | #pragma GCC visibility push(default) | |||
3498 | #endif | |||
3499 | ||||
3500 | int | |||
3501 | plugin_init (struct plugin_name_args *plugin_info, | |||
3502 | struct plugin_gcc_version *) | |||
3503 | { | |||
3504 | generic_plugin_init (plugin_info, GCC_CP_FE_VERSION_0); | |||
3505 | ||||
3506 | register_callback (plugin_info->base_name, PLUGIN_PRAGMAS, | |||
3507 | plugin_init_extra_pragmas, NULLnullptr); | |||
3508 | register_callback (plugin_info->base_name, PLUGIN_PRE_GENERICIZE, | |||
3509 | rewrite_decls_to_addresses, NULLnullptr); | |||
3510 | ||||
3511 | #define GCC_METHOD0(R, N) \ | |||
3512 | { \ | |||
3513 | cc1_plugin::callback_ftype *fun \ | |||
3514 | = cc1_plugin::invoker<R>::invoke<plugin_ ## N>; \ | |||
3515 | current_context->add_callback (# N, fun); \ | |||
3516 | } | |||
3517 | #define GCC_METHOD1(R, N, A) \ | |||
3518 | { \ | |||
3519 | cc1_plugin::callback_ftype *fun \ | |||
3520 | = cc1_plugin::invoker<R, A>::invoke<plugin_ ## N>; \ | |||
3521 | current_context->add_callback (# N, fun); \ | |||
3522 | } | |||
3523 | #define GCC_METHOD2(R, N, A, B) \ | |||
3524 | { \ | |||
3525 | cc1_plugin::callback_ftype *fun \ | |||
3526 | = cc1_plugin::invoker<R, A, B>::invoke<plugin_ ## N>; \ | |||
3527 | current_context->add_callback (# N, fun); \ | |||
3528 | } | |||
3529 | #define GCC_METHOD3(R, N, A, B, C) \ | |||
3530 | { \ | |||
3531 | cc1_plugin::callback_ftype *fun \ | |||
3532 | = cc1_plugin::invoker<R, A, B, C>::invoke<plugin_ ## N>; \ | |||
3533 | current_context->add_callback (# N, fun); \ | |||
3534 | } | |||
3535 | #define GCC_METHOD4(R, N, A, B, C, D) \ | |||
3536 | { \ | |||
3537 | cc1_plugin::callback_ftype *fun \ | |||
3538 | = cc1_plugin::invoker<R, A, B, C, \ | |||
3539 | D>::invoke<plugin_ ## N>; \ | |||
3540 | current_context->add_callback (# N, fun); \ | |||
3541 | } | |||
3542 | #define GCC_METHOD5(R, N, A, B, C, D, E) \ | |||
3543 | { \ | |||
3544 | cc1_plugin::callback_ftype *fun \ | |||
3545 | = cc1_plugin::invoker<R, A, B, C, \ | |||
3546 | D, E>::invoke<plugin_ ## N>; \ | |||
3547 | current_context->add_callback (# N, fun); \ | |||
3548 | } | |||
3549 | #define GCC_METHOD7(R, N, A, B, C, D, E, F, G) \ | |||
3550 | { \ | |||
3551 | cc1_plugin::callback_ftype *fun \ | |||
3552 | = cc1_plugin::invoker<R, A, B, C, \ | |||
3553 | D, E, F, G>::invoke<plugin_ ## N>; \ | |||
3554 | current_context->add_callback (# N, fun); \ | |||
3555 | } | |||
3556 | ||||
3557 | #include "gcc-cp-fe.def" | |||
3558 | ||||
3559 | #undef GCC_METHOD0 | |||
3560 | #undef GCC_METHOD1 | |||
3561 | #undef GCC_METHOD2 | |||
3562 | #undef GCC_METHOD3 | |||
3563 | #undef GCC_METHOD4 | |||
3564 | #undef GCC_METHOD5 | |||
3565 | #undef GCC_METHOD7 | |||
3566 | ||||
3567 | return 0; | |||
3568 | } |