26941aa2cb4cd8e881ea706b79f701f345f4b81e
[gcc.git] / gcc / c-family / stub-objc.c
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
35 objc_is_class_name (tree ARG_UNUSED (arg))
36 {
37 return 0;
38 }
39
40 tree
41 objc_is_id (tree ARG_UNUSED (arg))
42 {
43 return 0;
44 }
45
46 tree
47 objc_is_object_ptr (tree ARG_UNUSED (arg))
48 {
49 return 0;
50 }
51
52 bool objc_diagnose_private_ivar (tree ARG_UNUSED (arg))
53 {
54 return false;
55 }
56
57 tree
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
65 objc_check_decl (tree ARG_UNUSED (decl))
66 {
67 }
68
69 void
70 objc_check_global_decl (tree ARG_UNUSED (decl))
71 {
72 }
73
74 tree
75 objc_common_type (tree ARG_UNUSED (type1), tree ARG_UNUSED (type2))
76 {
77 return 0;
78 }
79
80 bool
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
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
95 objc_volatilize_decl (tree ARG_UNUSED (decl))
96 {
97 }
98
99 tree
100 objc_rewrite_function_call (tree function, tree ARG_UNUSED (first_param))
101 {
102 return function;
103 }
104
105 tree
106 objc_message_selector (void)
107 {
108 return 0;
109 }
110
111 void
112 objc_declare_alias (tree ARG_UNUSED (alias), tree ARG_UNUSED (orig))
113 {
114 }
115
116 void
117 objc_declare_class (tree ARG_UNUSED (identifier))
118 {
119 }
120
121 void
122 objc_declare_protocol (tree ARG_UNUSED (name), tree ARG_UNUSED (attributes))
123 {
124 }
125
126 void
127 objc_start_protocol (tree ARG_UNUSED (proto),
128 tree ARG_UNUSED (protorefs),
129 tree ARG_UNUSED (attribs))
130 {
131 }
132
133 void
134 objc_set_method_opt (bool ARG_UNUSED (optional))
135 {
136 }
137
138 void
139 objc_start_class_interface (tree ARG_UNUSED (name),
140 location_t /*name_loc*/,
141 tree ARG_UNUSED (super),
142 tree ARG_UNUSED (protos),
143 tree ARG_UNUSED (attribs))
144 {
145 }
146
147 void
148 objc_start_category_interface (tree ARG_UNUSED (name),
149 tree ARG_UNUSED (categ),
150 tree ARG_UNUSED (protos),
151 tree ARG_UNUSED (attribs))
152 {
153 }
154
155 void
156 objc_continue_interface (void)
157 {
158 }
159
160 void
161 objc_finish_interface (void)
162 {
163 }
164
165 void
166 objc_add_instance_variable (tree ARG_UNUSED (decl))
167 {
168 }
169
170 void
171 objc_set_visibility (objc_ivar_visibility_kind ARG_UNUSED (vis))
172 {
173 }
174
175 void
176 objc_start_class_implementation (tree ARG_UNUSED (name),
177 tree ARG_UNUSED (super))
178 {
179 }
180
181 void
182 objc_start_category_implementation (tree ARG_UNUSED (name),
183 tree ARG_UNUSED (categ))
184 {
185 }
186
187 void
188 objc_continue_implementation (void)
189 {
190 }
191
192 void
193 objc_clear_super_receiver (void)
194 {
195 }
196
197 void
198 objc_finish_implementation (void)
199 {
200 }
201
202 void
203 objc_add_method_declaration (bool ARG_UNUSED (is_class_method),
204 tree ARG_UNUSED (signature),
205 tree ARG_UNUSED (attributes))
206 {
207 }
208
209 bool
210 objc_start_method_definition (bool ARG_UNUSED (is_class_method),
211 tree ARG_UNUSED (signature),
212 tree ARG_UNUSED (attributes),
213 tree ARG_UNUSED (expr))
214 {
215 return true;
216 }
217
218 void
219 objc_finish_method_definition (tree ARG_UNUSED (fndecl))
220 {
221 }
222
223 bool
224 objc_method_decl (enum tree_code ARG_UNUSED(opcode))
225 {
226 return false;
227 }
228
229 tree
230 objc_build_keyword_decl (tree ARG_UNUSED (selector),
231 tree ARG_UNUSED (type),
232 tree ARG_UNUSED (identifier),
233 tree ARG_UNUSED (attributes))
234 {
235 return 0;
236 }
237
238 tree
239 objc_build_method_signature (bool ARG_UNUSED (is_class_method),
240 tree ARG_UNUSED (rettype),
241 tree ARG_UNUSED (selectors),
242 tree ARG_UNUSED (optparms),
243 bool ARG_UNUSED (ellipsis))
244 {
245 return 0;
246 }
247
248 tree
249 objc_build_encode_expr (tree ARG_UNUSED (expr))
250 {
251 return 0;
252 }
253
254 tree
255 objc_build_protocol_expr (tree ARG_UNUSED (expr))
256 {
257 return 0;
258 }
259
260 tree
261 objc_build_selector_expr (location_t ARG_UNUSED (loc), tree ARG_UNUSED (expr))
262 {
263 return 0;
264 }
265
266 tree
267 objc_build_message_expr (tree ARG_UNUSED (receiver), tree ARG_UNUSED (args))
268 {
269 return 0;
270 }
271
272 tree
273 objc_build_string_object (tree ARG_UNUSED (str))
274 {
275 return 0;
276 }
277
278 tree
279 objc_get_class_reference (tree ARG_UNUSED (name))
280 {
281 return 0;
282 }
283
284 bool
285 objc_detect_field_duplicates (bool ARG_UNUSED (check_superclasses_only))
286 {
287 return false;
288 }
289
290 tree
291 objc_get_protocol_qualified_type (tree ARG_UNUSED (name),
292 tree ARG_UNUSED (protos))
293 {
294 return 0;
295 }
296
297 int
298 objc_static_init_needed_p (void)
299 {
300 return 0;
301 }
302
303 tree
304 objc_generate_static_init_call (tree ARG_UNUSED (ctors))
305 {
306 return 0;
307 }
308
309 int
310 objc_is_public (tree ARG_UNUSED (expr), tree ARG_UNUSED (identifier))
311 {
312 return 1;
313 }
314
315 tree
316 objc_get_class_ivars (tree ARG_UNUSED (name))
317 {
318 return 0;
319 }
320
321 void
322 objc_add_property_declaration (location_t ARG_UNUSED (location),
323 tree ARG_UNUSED (decl),
324 vec<property_attribute_info *>&
325 /*prop_attr_list*/)
326 {
327 }
328
329 bool
330 objc_is_property_ref (tree ARG_UNUSED (node))
331 {
332 return 0;
333 }
334
335 bool
336 objc_non_constant_expr_p (tree)
337 {
338 return 0;
339 }
340
341 tree
342 objc_maybe_build_component_ref (tree ARG_UNUSED (datum), tree ARG_UNUSED (component))
343 {
344 return 0;
345 }
346
347 tree
348 objc_build_class_component_ref (tree ARG_UNUSED (datum), tree ARG_UNUSED (component))
349 {
350 return 0;
351 }
352
353 tree
354 objc_maybe_build_modify_expr (tree ARG_UNUSED (lhs), tree ARG_UNUSED (rhs))
355 {
356 return 0;
357 }
358
359 tree
360 objc_build_incr_expr_for_property_ref (location_t ARG_UNUSED (location),
361 enum tree_code ARG_UNUSED (code),
362 tree ARG_UNUSED (argument),
363 tree ARG_UNUSED (increment))
364 {
365 return 0;
366 }
367
368 void
369 objc_add_synthesize_declaration (location_t ARG_UNUSED (start_locus),
370 tree ARG_UNUSED (property_and_ivar_list))
371 {
372 }
373
374 void
375 objc_add_dynamic_declaration (location_t ARG_UNUSED (start_locus),
376 tree ARG_UNUSED (property_list))
377 {
378 }
379
380 const char *
381 objc_maybe_printable_name (tree ARG_UNUSED (decl),
382 int ARG_UNUSED (v))
383 {
384 return NULL;
385 }
386
387 tree
388 objc_build_throw_stmt (location_t ARG_UNUSED (loc), tree ARG_UNUSED (expr))
389 {
390 return 0;
391 }
392
393 tree
394 objc_build_synchronized (location_t ARG_UNUSED (start_locus),
395 tree ARG_UNUSED (mutex), tree ARG_UNUSED (body))
396 {
397 return 0;
398 }
399
400 void
401 objc_begin_try_stmt (location_t ARG_UNUSED (try_locus), tree ARG_UNUSED (body))
402 {
403 }
404
405 void
406 objc_begin_catch_clause (tree ARG_UNUSED (decl))
407 {
408 }
409
410 void
411 objc_finish_catch_clause (void)
412 {
413 }
414
415 void
416 objc_build_finally_clause (location_t ARG_UNUSED (finally_locus),
417 tree ARG_UNUSED (body))
418 {
419 }
420
421 tree
422 objc_finish_try_stmt (void)
423 {
424 return 0;
425 }
426
427 tree
428 objc_generate_write_barrier (tree ARG_UNUSED (lhs),
429 enum tree_code ARG_UNUSED (modifycode),
430 tree ARG_UNUSED (rhs))
431 {
432 return 0;
433 }
434
435 void
436 objc_finish_foreach_loop (location_t ARG_UNUSED (location), tree ARG_UNUSED (object_expression),
437 tree ARG_UNUSED (collection_expression), tree ARG_UNUSED (for_body),
438 tree ARG_UNUSED (break_label), tree ARG_UNUSED (continue_label))
439 {
440 return;
441 }
442
443 void
444 objc_write_global_declarations (void)
445 {
446 }
447
448 bool
449 objc_string_ref_type_p (tree ARG_UNUSED (strp))
450 {
451 return false;
452 }
453
454 void
455 objc_check_format_arg (tree ARG_UNUSED (format_arg),
456 tree ARG_UNUSED (args_list))
457 {
458 }
459
460 void
461 objc_finish_function (void)
462 {
463 }
464
465 void
466 objc_maybe_warn_exceptions (location_t ARG_UNUSED (loc))
467 {
468 }
469
470 enum objc_property_attribute_kind objc_prop_attr_kind_for_rid (enum rid)
471 {
472 return OBJC_PROPERTY_ATTR_UNKNOWN;
473 }