annotate libobjc/objc-private/selector.h @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 84e7813d76e9
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* GNU Objective C Runtime selector implementation - Private functions
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 Copyright (C) 2010-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 Contributed by Nicola Pero <nicola.pero@meta-innovation.com>
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify it under the
kono
parents:
diff changeset
8 terms of the GNU General Public License as published by the Free Software
kono
parents:
diff changeset
9 Foundation; either version 3, or (at your option) any later version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
kono
parents:
diff changeset
13 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
kono
parents:
diff changeset
14 details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 Under Section 7 of GPL version 3, you are granted additional
kono
parents:
diff changeset
17 permissions described in the GCC Runtime Library Exception, version
kono
parents:
diff changeset
18 3.1, as published by the Free Software Foundation.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 You should have received a copy of the GNU General Public License and
kono
parents:
diff changeset
21 a copy of the GCC Runtime Library Exception along with this program;
kono
parents:
diff changeset
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
kono
parents:
diff changeset
23 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 #ifndef __objc_private_selector_INCLUDE_GNU
kono
parents:
diff changeset
26 #define __objc_private_selector_INCLUDE_GNU
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* Private runtime functions that may go away or be rewritten or
kono
parents:
diff changeset
29 replaced. */
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 /* Definition of a selector. Selectors themselves are not unique, but
kono
parents:
diff changeset
32 the sel_id is a unique identifier. */
kono
parents:
diff changeset
33 struct objc_selector
kono
parents:
diff changeset
34 {
kono
parents:
diff changeset
35 void *sel_id;
kono
parents:
diff changeset
36 const char *sel_types;
kono
parents:
diff changeset
37 };
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 /* An inline, fast version of sel_isEqual(). */
kono
parents:
diff changeset
40 inline static BOOL
kono
parents:
diff changeset
41 sel_eq (SEL s1, SEL s2)
kono
parents:
diff changeset
42 {
kono
parents:
diff changeset
43 if (s1 == 0 || s2 == 0)
kono
parents:
diff changeset
44 return s1 == s2;
kono
parents:
diff changeset
45 else
kono
parents:
diff changeset
46 return s1->sel_id == s2->sel_id;
kono
parents:
diff changeset
47 }
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 /* Number of selectors stored in each of the selector tables. */
kono
parents:
diff changeset
50 extern unsigned int __objc_selector_max_index;
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 /* Initialize the selector tables. This must be called by init.c. */
kono
parents:
diff changeset
53 void __objc_init_selector_tables(void);
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 /* Various private functions to register selectors. */
kono
parents:
diff changeset
56 void __objc_register_selectors_from_class(Class);
kono
parents:
diff changeset
57 void __objc_register_selectors_from_list (struct objc_method_list *);
kono
parents:
diff changeset
58 void __objc_register_selectors_from_description_list
kono
parents:
diff changeset
59 (struct objc_method_description_list *method_list);
kono
parents:
diff changeset
60 void __objc_register_selectors_from_module (struct objc_selector *selectors);
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 /* Return whether a selector is mapped or not ("mapped" meaning that
kono
parents:
diff changeset
63 it has been inserted into the selector table). This is private as
kono
parents:
diff changeset
64 only the runtime should ever encounter or need to know about
kono
parents:
diff changeset
65 unmapped selectors. */
kono
parents:
diff changeset
66 BOOL sel_is_mapped (SEL aSel);
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 /* Return selector representing name without registering it if it
kono
parents:
diff changeset
69 doesn't exist. Typically used internally by the runtime when it's
kono
parents:
diff changeset
70 looking up methods that may or may not exist (such as +initialize)
kono
parents:
diff changeset
71 in the most efficient way. */
kono
parents:
diff changeset
72 SEL
kono
parents:
diff changeset
73 sel_get_any_uid (const char *name);
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 #endif /* not __objc_private_selector_INCLUDE_GNU */