]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/gcc/stub-objc.c
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / gcc / 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, 1995, 1997, 1998,
5    1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
13
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING.  If not, write to the Free
21 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22 02110-1301, USA.  */
23
24 #include "config.h"
25 #include "system.h"
26 #include "coretypes.h"
27 #include "tree.h"
28 #include "c-common.h"
29
30 tree
31 objc_is_class_name (tree ARG_UNUSED (arg))
32 {
33   return 0;
34 }
35
36 tree
37 objc_is_id (tree ARG_UNUSED (arg))
38 {
39   return 0;
40 }
41
42 tree
43 objc_is_object_ptr (tree ARG_UNUSED (arg))
44 {
45   return 0;
46 }
47
48 /* APPLE LOCAL begin radar 4133425 */
49 bool objc_diagnose_private_ivar (tree ARG_UNUSED (arg))
50 {
51   return false;
52 }
53 /* APPLE LOCAL end radar 4133425 */
54
55 tree
56 objc_lookup_ivar (tree other, tree ARG_UNUSED (arg))
57 {
58   /* Just use whatever C/C++ found.  */
59   return other;
60 }
61
62 void
63 objc_check_decl (tree ARG_UNUSED (decl))
64 {
65 }
66
67 /* APPLE LOCAL begin radar 4281748 */
68 void
69 objc_check_global_decl (tree ARG_UNUSED (decl))
70 {
71 }
72 /* APPLE LOCAL end radar 4281748 */
73
74 /* APPLE LOCAL begin radar 4330422 */
75 tree
76 objc_non_volatilized_type (tree type)
77 {
78   return type;
79 }
80 /* APPLE LOCAL end radar 4330422 */
81
82 /* APPLE LOCAL begin radar 4697411 */
83 void
84 objc_volatilize_component_ref (tree ARG_UNUSED (cref), tree ARG_UNUSED (type))
85 {
86 }
87 /* APPLE LOCAL end radar 4697411 */
88    
89 int
90 objc_is_reserved_word (tree ARG_UNUSED (ident))
91 {
92   return 0;
93 }
94
95 /* APPLE LOCAL begin 4154928 */
96 tree
97 objc_common_type (tree ARG_UNUSED (type1), tree ARG_UNUSED (type2))
98 {
99   return false;
100 }
101 /* APPLE LOCAL end 4154928 */
102
103 bool
104 objc_compare_types (tree ARG_UNUSED (ltyp), tree ARG_UNUSED (rtyp),
105                     /* APPLE LOCAL begin radar 6231433 */
106                     int ARG_UNUSED (argno), tree ARG_UNUSED (callee),
107                     const char * ARG_UNUSED (message))
108                     /* APPLE LOCAL end radar 6231433 */
109 {
110   return false;
111 }
112
113 /* APPLE LOCAL begin radar 4229905 - radar 6231433 */
114 bool
115 objc_have_common_type (tree ARG_UNUSED (ltyp), tree ARG_UNUSED (rtyp),
116                        int ARG_UNUSED (argno), tree ARG_UNUSED (callee),
117                        const char * ARG_UNUSED (message))
118 {
119   return false;
120 }
121 /* APPLE LOCAL end radar 4229905 - radar 6231433 */
122
123 void
124 objc_volatilize_decl (tree ARG_UNUSED (decl))
125 {
126 }
127
128 bool
129 objc_type_quals_match (tree ARG_UNUSED (ltyp), tree ARG_UNUSED (rtyp))
130 {
131   return false;
132 }
133
134 tree
135 objc_rewrite_function_call (tree function, tree ARG_UNUSED (params))
136 {
137   return function;
138 }
139
140 tree
141 objc_message_selector (void)
142
143   return 0;
144 }
145
146 void
147 objc_declare_alias (tree ARG_UNUSED (alias), tree ARG_UNUSED (orig))
148 {
149 }
150
151 void
152 objc_declare_class (tree ARG_UNUSED (list))
153 {
154 }
155
156 void
157 /* APPLE LOCAL begin radar 4947311 - protocol attributes */
158 objc_declare_protocols (tree ARG_UNUSED (list), tree ARG_UNUSED (attributes))
159 {
160 }
161
162 void
163 objc_start_protocol (tree ARG_UNUSED (proto),
164                      tree ARG_UNUSED (protorefs),
165                      tree ARG_UNUSED (attributes))
166 {
167 }
168 /* APPLE LOCAL end radar 4947311 - protocol attributes */
169
170 void
171 objc_start_class_interface (tree ARG_UNUSED (name),
172                             tree ARG_UNUSED (super),
173 /* APPLE LOCAL begin radar 4548636 */
174                             tree ARG_UNUSED (protos),
175                             tree ARG_UNUSED (attributes))
176 /* APPLE LOCAL end radar 4548636 */
177 {
178 }
179
180 void
181 objc_start_category_interface (tree ARG_UNUSED (name),
182                                tree ARG_UNUSED (categ),
183                                tree ARG_UNUSED (protos))
184 {
185 }
186
187 void
188 objc_continue_interface (void)
189 {
190 }
191
192 void
193 objc_finish_interface (void)
194 {
195 }
196
197 void
198 objc_add_instance_variable (tree ARG_UNUSED (decl))
199 {
200 }
201
202 void
203 objc_set_visibility (int ARG_UNUSED (vis))
204 {
205 }
206
207 void
208 objc_set_method_type (enum tree_code ARG_UNUSED (code))
209 {
210 }
211
212 void
213 objc_start_class_implementation (tree ARG_UNUSED (name),
214                                  tree ARG_UNUSED (super))
215 {
216 }
217
218 void
219 objc_start_category_implementation (tree ARG_UNUSED (name),
220                                     tree ARG_UNUSED (categ))
221 {
222 }
223
224 void
225 objc_continue_implementation (void)
226 {
227 }
228
229 void
230 objc_clear_super_receiver (void)
231 {
232 }
233
234 void
235 objc_finish_implementation (void)
236 {
237 }
238
239 void
240 /* APPLE LOCAL begin radar 3803157 - objc attribute */
241 objc_add_method_declaration (tree ARG_UNUSED (signature),
242                              tree ARG_UNUSED (attribute))
243 /* APPLE LOCAL end radar 3803157 - objc attribute */
244 {
245 }
246
247 void
248 /* APPLE LOCAL begin radar 3803157 - objc attribute */
249 objc_start_method_definition (tree ARG_UNUSED (signature),
250                               tree ARG_UNUSED (attribute))
251 /* APPLE LOCAL end radar 3803157 - objc attribute */
252 {
253 }
254
255 void
256 objc_finish_method_definition (tree ARG_UNUSED (fndecl))
257 {
258 }
259
260 tree
261 objc_build_keyword_decl (tree ARG_UNUSED (selector),
262                          tree ARG_UNUSED (typename),
263                          /* APPLE LOCAL begin radar 4157812 */
264                          tree ARG_UNUSED (identifier),
265                          tree ARG_UNUSED (attribute))
266                          /* APPLE LOCAL end radar 4157812 */
267 {
268   return 0;
269 }
270
271 tree
272 objc_build_method_signature (tree ARG_UNUSED (rettype),
273                              tree ARG_UNUSED (selectors),
274                              tree ARG_UNUSED (optparms),
275                              bool ARG_UNUSED (ellipsis))
276 {
277   return 0;
278 }
279
280 tree
281 objc_build_encode_expr (tree ARG_UNUSED (expr))
282 {
283   return 0;
284 }
285
286 tree
287 objc_build_protocol_expr (tree ARG_UNUSED (expr))
288 {
289   return 0;
290 }
291
292 tree
293 objc_build_selector_expr (tree ARG_UNUSED (expr))
294 {
295   return 0;
296 }
297
298 tree
299 objc_build_message_expr (tree ARG_UNUSED (expr))
300 {
301   return 0;
302 }
303
304 tree
305 objc_build_string_object (tree ARG_UNUSED (str))
306 {
307   return 0;
308 }
309
310 tree
311 objc_get_class_reference (tree ARG_UNUSED (name))
312 {
313   return 0;
314 }
315
316 /* APPLE LOCAL begin radar 4291785 */
317 tree
318 objc_get_interface_ivars (tree ARG_UNUSED (fieldlist))
319 {
320   return 0;
321 }
322 void
323 objc_detect_field_duplicates (tree ARG_UNUSED (fieldlist))
324 {
325 }
326 /* APPLE LOCAL end radar 4291785 */
327
328 tree
329 objc_get_protocol_qualified_type (tree ARG_UNUSED (name),
330                                   tree ARG_UNUSED (protos))
331 {
332   return 0;
333 }
334
335 int
336 objc_static_init_needed_p (void)
337 {
338   return 0;
339 }
340
341 tree
342 objc_generate_static_init_call (tree ARG_UNUSED (ctors))
343 {
344   return 0;
345 }
346
347 int
348 objc_is_public (tree ARG_UNUSED (expr), tree ARG_UNUSED (identifier))
349 {
350   return 1;
351 }
352
353 /* APPLE LOCAL begin C* language */
354 void
355 objc_set_method_opt (int ARG_UNUSED (opt))
356 {
357 }
358
359 tree
360 objc_build_component_ref (tree ARG_UNUSED (datum), tree ARG_UNUSED (component))
361 {
362   return 0;
363 }
364
365 tree
366 objc_build_foreach_components (tree ARG_UNUSED (receiver),
367                                tree *ARG_UNUSED (enumState_decl),
368                                tree *ARG_UNUSED (items_decl),
369                                tree *ARG_UNUSED (limit_decl),
370                                tree *ARG_UNUSED (startMutations_decl),
371                                tree *ARG_UNUSED (counter_decl),
372                                tree *ARG_UNUSED (countByEnumeratingWithState))
373 {
374   return 0;
375 }
376 /* APPLE LOCAL end C* language */
377
378 /* APPLE LOCAL begin C* property (Radar 4436866) */
379 void
380 objc_set_property_attr (int ARG_UNUSED (code), tree ARG_UNUSED (identifier))
381 {
382 }
383 void
384 objc_add_property_variable (tree ARG_UNUSED (prop))
385 {
386 }
387 /* APPLE LOCAL radar 5285911 */
388 /* Stub for objc_build_getter_call is removed. */
389 tree
390 objc_build_setter_call (tree ARG_UNUSED (lhs), tree ARG_UNUSED (rhs))
391 {
392   return 0;
393 }
394 /* APPLE LOCAL end C* property (Radar 4436866) */
395
396 tree
397 objc_get_class_ivars (tree ARG_UNUSED (name))
398 {
399   return 0;
400 }
401
402 tree
403 objc_build_throw_stmt (tree ARG_UNUSED (expr))
404 {
405   return 0;
406 }
407
408 tree
409 objc_build_synchronized (location_t ARG_UNUSED (start_locus),
410                          tree ARG_UNUSED (mutex), tree ARG_UNUSED (body))
411 {
412   return 0;
413 }
414
415 void
416 objc_begin_try_stmt (location_t ARG_UNUSED (try_locus), tree ARG_UNUSED (body))
417 {
418 }
419    
420 void
421 objc_begin_catch_clause (tree ARG_UNUSED (decl))
422 {
423 }
424
425 void
426 objc_finish_catch_clause (void)
427 {
428 }
429
430 void
431 objc_build_finally_clause (location_t ARG_UNUSED (finally_locus),
432                            tree ARG_UNUSED (body))
433 {
434 }
435
436 tree
437 objc_finish_try_stmt (void)
438 {
439   return 0;
440 }
441
442 tree
443 objc_generate_write_barrier (tree ARG_UNUSED (lhs),
444                              enum tree_code ARG_UNUSED (modifycode),
445                              tree ARG_UNUSED (rhs))
446 {
447   return 0;
448 }  
449 /* APPLE LOCAL begin radar 5276085 */
450 void objc_weak_reference_expr (tree* ARG_UNUSED (expr))
451 {
452 }
453
454 tree
455 objc_build_weak_reference_tree (tree expr)
456 {
457   return expr;
458 }
459 /* APPLE LOCAL end radar 5276085 */
460
461 /* APPLE LOCAL begin C* warnings to easy porting to new abi */
462 void
463 diagnose_selector_cast (tree ARG_UNUSED (cast_type), tree ARG_UNUSED (sel_exp))
464 {
465 }
466 /* APPLE LOCAL end C* warnings to easy porting to new abi */
467
468 /* APPLE LOCAL begin radar 4441049 */
469 tree
470 objc_v2_component_ref_field_offset (tree ARG_UNUSED (exp))
471 {
472   return 0;
473 }
474
475 tree
476 objc_v2_bitfield_ivar_bitpos (tree ARG_UNUSED (exp))
477 {
478   return 0;
479 }
480 /* APPLE LOCAL end radar 4441049 */ 
481 /* APPLE LOCAL begin radar 4507230 */
482 bool 
483 objc_type_valid_for_messaging (tree ARG_UNUSED (exp))
484 {
485   return false;
486 }
487 /* APPLE LOCAL end radar 4507230 */
488 /* APPLE LOCAL begin radar 3803157 - objc attribute */
489 bool 
490 objc_method_decl (enum tree_code ARG_UNUSED (opcode))
491 {
492   return false;
493 }
494 /* APPLE LOCAL end radar 3803157 - objc attribute */
495
496 /* APPLE LOCAL begin radar 4708210 (for_objc_collection in 4.2) */
497 void
498 objc_finish_foreach_loop (location_t ARG_UNUSED (location), tree ARG_UNUSED (cond), 
499           tree ARG_UNUSED (for_body), tree ARG_UNUSED (blab), 
500           tree ARG_UNUSED (clab))
501 {
502   return;
503 }
504 /* APPLE LOCAL end radar 4708210 (for_objc_collection in 4.2) */
505 /* APPLE LOCAL begin radar 5847976 */
506 int
507 objc_is_gcable_type (tree ARG_UNUSED (type))
508 {
509   return 0;
510 }
511 /* APPLE LOCAL end radar 5847976 */
512 /* APPLE LOCAL begin radar 4592503 */
513 void
514 objc_checkon_weak_attribute (tree ARG_UNUSED (decl))
515 {
516   return;
517 }
518 /* APPLE LOCAL end radar 4592503 */
519 /* APPLE LOCAL begin radar 4712269 */
520 tree
521 objc_build_incr_decr_setter_call (enum tree_code ARG_UNUSED (code),
522                                    tree ARG_UNUSED (lhs), 
523                                    tree ARG_UNUSED (inc))
524 {
525   return NULL_TREE;
526 }
527 /* APPLE LOCAL end radar 4712269 */
528 /* APPLE LOCAL begin objc new property */
529 void objc_declare_property_impl (int ARG_UNUSED (code), 
530                                  tree ARG_UNUSED (tree_list))
531 {
532 }
533 /* APPLE LOCAL begin radar 5285911 */
534 tree
535 objc_build_property_reference_expr (tree ARG_UNUSED (datum),
536                                     tree ARG_UNUSED (component))
537 {
538   return 0;
539 }
540 bool 
541 objc_property_reference_expr (tree ARG_UNUSED (exp))
542 {
543   return false;
544 }
545 /* APPLE LOCAL end radar 5285911 */
546 /* APPLE LOCAL end objc new property */
547 /* APPLE LOCAL begin radar 4985544 */
548 bool
549 objc_check_format_nsstring (tree ARG_UNUSED (argument),
550                              unsigned HOST_WIDE_INT ARG_UNUSED (format_num),
551                              bool * ARG_UNUSED(no_add_attrs))
552 {
553   return false;
554 }
555 /* APPLE LOCAL end radar 4985544 */
556 /* APPLE LOCAL begin radar 5202926 */
557 bool
558 objc_anonymous_local_objc_name (const char * ARG_UNUSED (name))
559 {
560   return false;
561 }
562 /* APPLE LOCAL begin radar 5195402 */
563 bool
564 objc_check_nsstring_pointer_type (tree ARG_UNUSED (type))
565 {
566   return false;
567 }
568 /* APPLE LOCAL end radar 5195402 */
569 /* APPLE LOCAL end radar 5202926 */
570
571 /* APPLE LOCAL begin radar 5782740 - blocks */
572 bool block_requires_copying (tree exp)
573 {
574   /* APPLE LOCAL begin radar 6175959 */
575   tree type = TREE_TYPE (exp);
576   return TREE_CODE (type) == BLOCK_POINTER_TYPE
577    || (POINTER_TYPE_P (type) 
578         && lookup_attribute ("NSObject", TYPE_ATTRIBUTES (type)));
579   /* APPLE LOCAL end radar 6175959 */
580 }
581 /* APPLE LOCAL end radar 5782740 - blocks */
582
583 /* APPLE LOCAL begin radar 5802025 */
584 tree objc_build_property_getter_func_call (tree object)
585 {
586   return object;
587 }
588 /* APPLE LOCAL end radar 5802025 */