1 /* Stub functions for Objective-C and Objective-C++ routines
2    that are called from within the C and C++ front-ends,
3    respectively.
4    Copyright (C) 1991-2020 Free Software Foundation, Inc.
5 
6 This file is part of GCC.
7 
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
12 
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3.  If not see
20 <http://www.gnu.org/licenses/>.  */
21 
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tree.h"
26 #include "vec.h"
27 
28 /* Provide a dummy type for the RID enum used as an argument to
29    objc_prop_attr_kind_for_rid () */
30 enum rid { DUMMY };
31 
32 #include "c-objc.h"
33 
34 tree
objc_is_class_name(tree ARG_UNUSED (arg))35 objc_is_class_name (tree ARG_UNUSED (arg))
36 {
37   return 0;
38 }
39 
40 tree
objc_is_id(tree ARG_UNUSED (arg))41 objc_is_id (tree ARG_UNUSED (arg))
42 {
43   return 0;
44 }
45 
46 tree
objc_is_object_ptr(tree ARG_UNUSED (arg))47 objc_is_object_ptr (tree ARG_UNUSED (arg))
48 {
49   return 0;
50 }
51 
objc_diagnose_private_ivar(tree ARG_UNUSED (arg))52 bool objc_diagnose_private_ivar (tree ARG_UNUSED (arg))
53 {
54   return false;
55 }
56 
57 tree
objc_lookup_ivar(tree other,tree ARG_UNUSED (arg))58 objc_lookup_ivar (tree other, tree ARG_UNUSED (arg))
59 {
60   /* Just use whatever C/C++ found.  */
61   return other;
62 }
63 
64 void
objc_check_decl(tree ARG_UNUSED (decl))65 objc_check_decl (tree ARG_UNUSED (decl))
66 {
67 }
68 
69 void
objc_check_global_decl(tree ARG_UNUSED (decl))70 objc_check_global_decl (tree ARG_UNUSED (decl))
71 {
72 }
73 
74 tree
objc_common_type(tree ARG_UNUSED (type1),tree ARG_UNUSED (type2))75 objc_common_type (tree ARG_UNUSED (type1), tree ARG_UNUSED (type2))
76 {
77   return 0;
78 }
79 
80 bool
objc_compare_types(tree ARG_UNUSED (ltyp),tree ARG_UNUSED (rtyp),int ARG_UNUSED (argno),tree ARG_UNUSED (callee))81 objc_compare_types (tree ARG_UNUSED (ltyp), tree ARG_UNUSED (rtyp),
82 		    int ARG_UNUSED (argno), tree ARG_UNUSED (callee))
83 {
84   return false;
85 }
86 
87 bool
objc_have_common_type(tree ARG_UNUSED (ltyp),tree ARG_UNUSED (rtyp),int ARG_UNUSED (argno),tree ARG_UNUSED (callee))88 objc_have_common_type (tree ARG_UNUSED (ltyp), tree ARG_UNUSED (rtyp),
89 		       int ARG_UNUSED (argno), tree ARG_UNUSED (callee))
90 {
91   return false;
92 }
93 
94 void
objc_volatilize_decl(tree ARG_UNUSED (decl))95 objc_volatilize_decl (tree ARG_UNUSED (decl))
96 {
97 }
98 
99 tree
objc_rewrite_function_call(tree function,tree ARG_UNUSED (first_param))100 objc_rewrite_function_call (tree function, tree ARG_UNUSED (first_param))
101 {
102   return function;
103 }
104 
105 tree
objc_message_selector(void)106 objc_message_selector (void)
107 {
108   return 0;
109 }
110 
111 void
objc_declare_alias(tree ARG_UNUSED (alias),tree ARG_UNUSED (orig))112 objc_declare_alias (tree ARG_UNUSED (alias), tree ARG_UNUSED (orig))
113 {
114 }
115 
116 void
objc_declare_class(tree ARG_UNUSED (identifier))117 objc_declare_class (tree ARG_UNUSED (identifier))
118 {
119 }
120 
121 void
objc_declare_protocol(tree ARG_UNUSED (name),tree ARG_UNUSED (attributes))122 objc_declare_protocol (tree ARG_UNUSED (name), tree ARG_UNUSED (attributes))
123 {
124 }
125 
126 void
objc_start_protocol(tree ARG_UNUSED (proto),tree ARG_UNUSED (protorefs),tree ARG_UNUSED (attribs))127 objc_start_protocol (tree ARG_UNUSED (proto),
128 		     tree ARG_UNUSED (protorefs),
129 		     tree ARG_UNUSED (attribs))
130 {
131 }
132 
133 void
objc_set_method_opt(bool ARG_UNUSED (optional))134 objc_set_method_opt (bool ARG_UNUSED (optional))
135 {
136 }
137 
138 void
objc_start_class_interface(tree ARG_UNUSED (name),tree ARG_UNUSED (super),tree ARG_UNUSED (protos),tree ARG_UNUSED (attribs))139 objc_start_class_interface (tree ARG_UNUSED (name),
140 			    tree ARG_UNUSED (super),
141 			    tree ARG_UNUSED (protos),
142 			    tree ARG_UNUSED (attribs))
143 {
144 }
145 
146 void
objc_start_category_interface(tree ARG_UNUSED (name),tree ARG_UNUSED (categ),tree ARG_UNUSED (protos),tree ARG_UNUSED (attribs))147 objc_start_category_interface (tree ARG_UNUSED (name),
148 			       tree ARG_UNUSED (categ),
149 			       tree ARG_UNUSED (protos),
150 			       tree ARG_UNUSED (attribs))
151 {
152 }
153 
154 void
objc_continue_interface(void)155 objc_continue_interface (void)
156 {
157 }
158 
159 void
objc_finish_interface(void)160 objc_finish_interface (void)
161 {
162 }
163 
164 void
objc_add_instance_variable(tree ARG_UNUSED (decl))165 objc_add_instance_variable (tree ARG_UNUSED (decl))
166 {
167 }
168 
169 void
objc_set_visibility(objc_ivar_visibility_kind ARG_UNUSED (vis))170 objc_set_visibility (objc_ivar_visibility_kind ARG_UNUSED (vis))
171 {
172 }
173 
174 void
objc_start_class_implementation(tree ARG_UNUSED (name),tree ARG_UNUSED (super))175 objc_start_class_implementation (tree ARG_UNUSED (name),
176 				 tree ARG_UNUSED (super))
177 {
178 }
179 
180 void
objc_start_category_implementation(tree ARG_UNUSED (name),tree ARG_UNUSED (categ))181 objc_start_category_implementation (tree ARG_UNUSED (name),
182 				    tree ARG_UNUSED (categ))
183 {
184 }
185 
186 void
objc_continue_implementation(void)187 objc_continue_implementation (void)
188 {
189 }
190 
191 void
objc_clear_super_receiver(void)192 objc_clear_super_receiver (void)
193 {
194 }
195 
196 void
objc_finish_implementation(void)197 objc_finish_implementation (void)
198 {
199 }
200 
201 void
objc_add_method_declaration(bool ARG_UNUSED (is_class_method),tree ARG_UNUSED (signature),tree ARG_UNUSED (attributes))202 objc_add_method_declaration (bool ARG_UNUSED (is_class_method),
203 			     tree ARG_UNUSED (signature),
204 			     tree ARG_UNUSED (attributes))
205 {
206 }
207 
208 bool
objc_start_method_definition(bool ARG_UNUSED (is_class_method),tree ARG_UNUSED (signature),tree ARG_UNUSED (attributes),tree ARG_UNUSED (expr))209 objc_start_method_definition (bool ARG_UNUSED (is_class_method),
210 			      tree ARG_UNUSED (signature),
211 			      tree ARG_UNUSED (attributes),
212 			      tree ARG_UNUSED (expr))
213 {
214   return true;
215 }
216 
217 void
objc_finish_method_definition(tree ARG_UNUSED (fndecl))218 objc_finish_method_definition (tree ARG_UNUSED (fndecl))
219 {
220 }
221 
222 bool
objc_method_decl(enum tree_code ARG_UNUSED (opcode))223 objc_method_decl (enum tree_code ARG_UNUSED(opcode))
224 {
225   return false;
226 }
227 
228 tree
objc_build_keyword_decl(tree ARG_UNUSED (selector),tree ARG_UNUSED (type),tree ARG_UNUSED (identifier),tree ARG_UNUSED (attributes))229 objc_build_keyword_decl (tree ARG_UNUSED (selector),
230 			 tree ARG_UNUSED (type),
231 			 tree ARG_UNUSED (identifier),
232 			 tree ARG_UNUSED (attributes))
233 {
234   return 0;
235 }
236 
237 tree
objc_build_method_signature(bool ARG_UNUSED (is_class_method),tree ARG_UNUSED (rettype),tree ARG_UNUSED (selectors),tree ARG_UNUSED (optparms),bool ARG_UNUSED (ellipsis))238 objc_build_method_signature (bool ARG_UNUSED (is_class_method),
239 			     tree ARG_UNUSED (rettype),
240 			     tree ARG_UNUSED (selectors),
241 			     tree ARG_UNUSED (optparms),
242 			     bool ARG_UNUSED (ellipsis))
243 {
244   return 0;
245 }
246 
247 tree
objc_build_encode_expr(tree ARG_UNUSED (expr))248 objc_build_encode_expr (tree ARG_UNUSED (expr))
249 {
250   return 0;
251 }
252 
253 tree
objc_build_protocol_expr(tree ARG_UNUSED (expr))254 objc_build_protocol_expr (tree ARG_UNUSED (expr))
255 {
256   return 0;
257 }
258 
259 tree
objc_build_selector_expr(location_t ARG_UNUSED (loc),tree ARG_UNUSED (expr))260 objc_build_selector_expr (location_t ARG_UNUSED (loc), tree ARG_UNUSED (expr))
261 {
262   return 0;
263 }
264 
265 tree
objc_build_message_expr(tree ARG_UNUSED (receiver),tree ARG_UNUSED (args))266 objc_build_message_expr (tree ARG_UNUSED (receiver), tree ARG_UNUSED (args))
267 {
268   return 0;
269 }
270 
271 tree
objc_build_string_object(tree ARG_UNUSED (str))272 objc_build_string_object (tree ARG_UNUSED (str))
273 {
274   return 0;
275 }
276 
277 tree
objc_get_class_reference(tree ARG_UNUSED (name))278 objc_get_class_reference (tree ARG_UNUSED (name))
279 {
280   return 0;
281 }
282 
283 bool
objc_detect_field_duplicates(bool ARG_UNUSED (check_superclasses_only))284 objc_detect_field_duplicates (bool ARG_UNUSED (check_superclasses_only))
285 {
286   return false;
287 }
288 
289 tree
objc_get_protocol_qualified_type(tree ARG_UNUSED (name),tree ARG_UNUSED (protos))290 objc_get_protocol_qualified_type (tree ARG_UNUSED (name),
291 				  tree ARG_UNUSED (protos))
292 {
293   return 0;
294 }
295 
296 int
objc_static_init_needed_p(void)297 objc_static_init_needed_p (void)
298 {
299   return 0;
300 }
301 
302 tree
objc_generate_static_init_call(tree ARG_UNUSED (ctors))303 objc_generate_static_init_call (tree ARG_UNUSED (ctors))
304 {
305   return 0;
306 }
307 
308 int
objc_is_public(tree ARG_UNUSED (expr),tree ARG_UNUSED (identifier))309 objc_is_public (tree ARG_UNUSED (expr), tree ARG_UNUSED (identifier))
310 {
311   return 1;
312 }
313 
314 tree
objc_get_class_ivars(tree ARG_UNUSED (name))315 objc_get_class_ivars (tree ARG_UNUSED (name))
316 {
317   return 0;
318 }
319 
320 void
objc_add_property_declaration(location_t ARG_UNUSED (location),tree ARG_UNUSED (decl),vec<property_attribute_info * > &)321 objc_add_property_declaration (location_t ARG_UNUSED (location),
322 			       tree ARG_UNUSED (decl),
323 			       vec<property_attribute_info *>&
324 			       /*prop_attr_list*/)
325 {
326 }
327 
328 bool
objc_is_property_ref(tree ARG_UNUSED (node))329 objc_is_property_ref (tree ARG_UNUSED (node))
330 {
331   return 0;
332 }
333 
334 bool
objc_non_constant_expr_p(tree)335 objc_non_constant_expr_p (tree)
336 {
337   return 0;
338 }
339 
340 tree
objc_maybe_build_component_ref(tree ARG_UNUSED (datum),tree ARG_UNUSED (component))341 objc_maybe_build_component_ref (tree ARG_UNUSED (datum), tree ARG_UNUSED (component))
342 {
343   return 0;
344 }
345 
346 tree
objc_build_class_component_ref(tree ARG_UNUSED (datum),tree ARG_UNUSED (component))347 objc_build_class_component_ref (tree ARG_UNUSED (datum), tree ARG_UNUSED (component))
348 {
349   return 0;
350 }
351 
352 tree
objc_maybe_build_modify_expr(tree ARG_UNUSED (lhs),tree ARG_UNUSED (rhs))353 objc_maybe_build_modify_expr (tree ARG_UNUSED (lhs), tree ARG_UNUSED (rhs))
354 {
355   return 0;
356 }
357 
358 tree
objc_build_incr_expr_for_property_ref(location_t ARG_UNUSED (location),enum tree_code ARG_UNUSED (code),tree ARG_UNUSED (argument),tree ARG_UNUSED (increment))359 objc_build_incr_expr_for_property_ref (location_t ARG_UNUSED (location),
360 				       enum tree_code ARG_UNUSED (code),
361 				       tree ARG_UNUSED (argument),
362 				       tree ARG_UNUSED (increment))
363 {
364   return 0;
365 }
366 
367 void
objc_add_synthesize_declaration(location_t ARG_UNUSED (start_locus),tree ARG_UNUSED (property_and_ivar_list))368 objc_add_synthesize_declaration (location_t ARG_UNUSED (start_locus),
369 				 tree ARG_UNUSED (property_and_ivar_list))
370 {
371 }
372 
373 void
objc_add_dynamic_declaration(location_t ARG_UNUSED (start_locus),tree ARG_UNUSED (property_list))374 objc_add_dynamic_declaration (location_t ARG_UNUSED (start_locus),
375 			      tree ARG_UNUSED (property_list))
376 {
377 }
378 
379 const char *
objc_maybe_printable_name(tree ARG_UNUSED (decl),int ARG_UNUSED (v))380 objc_maybe_printable_name (tree ARG_UNUSED (decl),
381 			   int ARG_UNUSED (v))
382 {
383   return NULL;
384 }
385 
386 tree
objc_build_throw_stmt(location_t ARG_UNUSED (loc),tree ARG_UNUSED (expr))387 objc_build_throw_stmt (location_t ARG_UNUSED (loc), tree ARG_UNUSED (expr))
388 {
389   return 0;
390 }
391 
392 tree
objc_build_synchronized(location_t ARG_UNUSED (start_locus),tree ARG_UNUSED (mutex),tree ARG_UNUSED (body))393 objc_build_synchronized (location_t ARG_UNUSED (start_locus),
394 			 tree ARG_UNUSED (mutex), tree ARG_UNUSED (body))
395 {
396   return 0;
397 }
398 
399 void
objc_begin_try_stmt(location_t ARG_UNUSED (try_locus),tree ARG_UNUSED (body))400 objc_begin_try_stmt (location_t ARG_UNUSED (try_locus), tree ARG_UNUSED (body))
401 {
402 }
403 
404 void
objc_begin_catch_clause(tree ARG_UNUSED (decl))405 objc_begin_catch_clause (tree ARG_UNUSED (decl))
406 {
407 }
408 
409 void
objc_finish_catch_clause(void)410 objc_finish_catch_clause (void)
411 {
412 }
413 
414 void
objc_build_finally_clause(location_t ARG_UNUSED (finally_locus),tree ARG_UNUSED (body))415 objc_build_finally_clause (location_t ARG_UNUSED (finally_locus),
416 			   tree ARG_UNUSED (body))
417 {
418 }
419 
420 tree
objc_finish_try_stmt(void)421 objc_finish_try_stmt (void)
422 {
423   return 0;
424 }
425 
426 tree
objc_generate_write_barrier(tree ARG_UNUSED (lhs),enum tree_code ARG_UNUSED (modifycode),tree ARG_UNUSED (rhs))427 objc_generate_write_barrier (tree ARG_UNUSED (lhs),
428 			     enum tree_code ARG_UNUSED (modifycode),
429 			     tree ARG_UNUSED (rhs))
430 {
431   return 0;
432 }
433 
434 void
objc_finish_foreach_loop(location_t ARG_UNUSED (location),tree ARG_UNUSED (object_expression),tree ARG_UNUSED (collection_expression),tree ARG_UNUSED (for_body),tree ARG_UNUSED (break_label),tree ARG_UNUSED (continue_label))435 objc_finish_foreach_loop (location_t ARG_UNUSED (location), tree ARG_UNUSED (object_expression),
436 			  tree ARG_UNUSED (collection_expression), tree ARG_UNUSED (for_body),
437 			  tree ARG_UNUSED (break_label), tree ARG_UNUSED (continue_label))
438 {
439   return;
440 }
441 
442 void
objc_write_global_declarations(void)443 objc_write_global_declarations (void)
444 {
445 }
446 
447 bool
objc_string_ref_type_p(tree ARG_UNUSED (strp))448 objc_string_ref_type_p (tree ARG_UNUSED (strp))
449 {
450    return false;
451 }
452 
453 void
objc_check_format_arg(tree ARG_UNUSED (format_arg),tree ARG_UNUSED (args_list))454 objc_check_format_arg (tree ARG_UNUSED (format_arg),
455 		       tree ARG_UNUSED (args_list))
456 {
457 }
458 
459 void
objc_finish_function(void)460 objc_finish_function (void)
461 {
462 }
463 
464 void
objc_maybe_warn_exceptions(location_t ARG_UNUSED (loc))465 objc_maybe_warn_exceptions (location_t ARG_UNUSED (loc))
466 {
467 }
468 
objc_prop_attr_kind_for_rid(enum rid)469 enum objc_property_attribute_kind objc_prop_attr_kind_for_rid (enum rid)
470 {
471   return OBJC_PROPERTY_ATTR_UNKNOWN;
472 }
473