1 | /* Declarations for meta-data attribute tags. |
2 | Copyright (C) 2011-2023 Free Software Foundation, Inc. |
3 | Contributed by Iain Sandoe |
4 | |
5 | This file is part of GCC. |
6 | |
7 | GCC is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 3, or (at your option) |
10 | any later version. |
11 | |
12 | GCC is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License 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 | /* These are identifiers used to flag meta-data attributes such that they |
22 | survive LTO and might be placed in correct sections for the target. */ |
23 | |
24 | enum objc_runtime_tree_index |
25 | { |
26 | OCTI_RT_OBJC_META, |
27 | OCTI_RT_META_BASE, |
28 | |
29 | OCTI_RT_META_CLASS, |
30 | OCTI_RT_META_METACLASS, |
31 | OCTI_RT_META_CATEGORY, |
32 | OCTI_RT_META_PROTOCOL, |
33 | |
34 | OCTI_RT_META_CLASS_CLS_VARS, |
35 | OCTI_RT_META_CLASS_NST_VARS, |
36 | |
37 | OCTI_RT_META_CLASS_CLS_METH, |
38 | OCTI_RT_META_CLASS_NST_METH, |
39 | OCTI_RT_META_CATEG_CLS_METH, |
40 | OCTI_RT_META_CATEG_NST_METH, |
41 | OCTI_RT_META_PROTO_CLS_METH, |
42 | OCTI_RT_META_PROTO_NST_METH, |
43 | |
44 | OCTI_RT_META_CLASS_PROT, |
45 | OCTI_RT_META_CATEG_PROT, |
46 | OCTI_RT_META_PROT_REFS, |
47 | |
48 | OCTI_RT_META_MSG_REFS, |
49 | OCTI_RT_META_SEL_REFS, |
50 | |
51 | OCTI_RT_META_CLSLST_REFS, |
52 | OCTI_RT_META_CLASS_REF, |
53 | OCTI_RT_META_SUPER_REF, |
54 | OCTI_RT_META_CLSLST_NLZY_LAB, |
55 | OCTI_RT_META_CLSLST_LAB, |
56 | OCTI_RT_META_LAB_PROTOLIST, |
57 | OCTI_RT_META_LAB_NLZY_CAT, |
58 | OCTI_RT_META_LAB_CAT, |
59 | |
60 | OCTI_RT_META_PROPERTY_LIST, |
61 | OCTI_RT_META_PROTOCOL_EXT, |
62 | OCTI_RT_META_CLASS_EXT, |
63 | |
64 | OCTI_RT_META_CLASS_NAME, |
65 | OCTI_RT_META_METHD_NAME, |
66 | OCTI_RT_META_METHD_TYPE, |
67 | OCTI_RT_META_PROPN_ATTR, |
68 | |
69 | OCTI_RT_META_MODULES, |
70 | OCTI_RT_META_SYMTAB, |
71 | OCTI_RT_META_INFO, |
72 | |
73 | OCTI_RT_META_EHTYPE, |
74 | |
75 | OCTI_RT_META_CONST_STR, |
76 | |
77 | OCTI_RT_META_IVAR_REF, |
78 | |
79 | OCTI_RT_META_MAX |
80 | }; |
81 | |
82 | extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX]; |
83 | |
84 | /* Tags for the META data so that the backend can put them in the correct |
85 | sections for targets/runtimes (Darwin/NeXT) that require this. |
86 | This information also survives LTO - which might produce mixed language |
87 | output. */ |
88 | |
89 | /* Objective-C meta data attribute tag */ |
90 | #define objc_meta objc_rt_trees[OCTI_RT_OBJC_META] |
91 | /* Attribute values, base = default section. */ |
92 | #define meta_base objc_rt_trees[OCTI_RT_META_BASE] |
93 | |
94 | /* CLASS. */ |
95 | #define meta_class objc_rt_trees[OCTI_RT_META_CLASS] |
96 | /* METACLASS. */ |
97 | #define meta_metaclass objc_rt_trees[OCTI_RT_META_METACLASS] |
98 | /* CLASS. */ |
99 | #define meta_category objc_rt_trees[OCTI_RT_META_CATEGORY] |
100 | /* PROTOCOL. */ |
101 | #define meta_protocol objc_rt_trees[OCTI_RT_META_PROTOCOL] |
102 | |
103 | /* Class class vars section. */ |
104 | #define meta_clac_vars objc_rt_trees[OCTI_RT_META_CLASS_CLS_VARS] |
105 | /* Class instance vars section. */ |
106 | #define meta_clai_vars objc_rt_trees[OCTI_RT_META_CLASS_NST_VARS] |
107 | /* Class class methods section. */ |
108 | #define meta_clac_meth objc_rt_trees[OCTI_RT_META_CLASS_CLS_METH] |
109 | /* Class instance methods section. */ |
110 | #define meta_clai_meth objc_rt_trees[OCTI_RT_META_CLASS_NST_METH] |
111 | /* Category class methods section. */ |
112 | #define meta_catc_meth objc_rt_trees[OCTI_RT_META_CATEG_CLS_METH] |
113 | /* Category instance methods section. */ |
114 | #define meta_cati_meth objc_rt_trees[OCTI_RT_META_CATEG_NST_METH] |
115 | #define meta_proto_cls_meth \ |
116 | objc_rt_trees[OCTI_RT_META_PROTO_CLS_METH] |
117 | #define meta_proto_nst_meth \ |
118 | objc_rt_trees[OCTI_RT_META_PROTO_NST_METH] |
119 | |
120 | /* Class protocols. */ |
121 | #define meta_clas_prot objc_rt_trees[OCTI_RT_META_CLASS_PROT] |
122 | /* Category protocols. */ |
123 | #define meta_catg_prot objc_rt_trees[OCTI_RT_META_CATEG_PROT] |
124 | /* Protocol references. */ |
125 | #define meta_proto_ref objc_rt_trees[OCTI_RT_META_PROT_REFS] |
126 | |
127 | /* Message refs. */ |
128 | #define meta_mref objc_rt_trees[OCTI_RT_META_MSG_REFS] |
129 | /* Selector refs. */ |
130 | #define meta_sel_refs objc_rt_trees[OCTI_RT_META_SEL_REFS] |
131 | |
132 | /* Class list refs. */ |
133 | #define meta_class_ref objc_rt_trees[OCTI_RT_META_CLSLST_REFS] |
134 | #define meta_class_reference \ |
135 | objc_rt_trees[OCTI_RT_META_CLASS_REF] |
136 | #define meta_superclass_ref \ |
137 | objc_rt_trees[OCTI_RT_META_SUPER_REF] |
138 | /* Class list Label. */ |
139 | #define meta_label_classlist \ |
140 | objc_rt_trees[OCTI_RT_META_CLSLST_LAB] |
141 | /* Class list Label (non lazy). */ |
142 | #define meta_label_nonlazy_classlist \ |
143 | objc_rt_trees[OCTI_RT_META_CLSLST_NLZY_LAB] |
144 | #define meta_label_categorylist \ |
145 | objc_rt_trees[OCTI_RT_META_LAB_CAT] |
146 | #define meta_label_nonlazy_categorylist \ |
147 | objc_rt_trees[OCTI_RT_META_LAB_NLZY_CAT] |
148 | |
149 | #define meta_label_protocollist \ |
150 | objc_rt_trees[OCTI_RT_META_LAB_PROTOLIST] |
151 | |
152 | |
153 | /* V1 - property list. */ |
154 | #define meta_proplist objc_rt_trees[OCTI_RT_META_PROPERTY_LIST] |
155 | #define meta_protocol_extension \ |
156 | objc_rt_trees[OCTI_RT_META_PROTOCOL_EXT] |
157 | #define meta_class_extension \ |
158 | objc_rt_trees[OCTI_RT_META_CLASS_EXT] |
159 | /* String sections. */ |
160 | #define meta_class_name objc_rt_trees[OCTI_RT_META_CLASS_NAME] |
161 | #define meta_meth_name objc_rt_trees[OCTI_RT_META_METHD_NAME] |
162 | #define meta_meth_type objc_rt_trees[OCTI_RT_META_METHD_TYPE] |
163 | #define meta_prop_name_attr \ |
164 | objc_rt_trees[OCTI_RT_META_PROPN_ATTR] |
165 | |
166 | #define meta_modules objc_rt_trees[OCTI_RT_META_MODULES] |
167 | #define meta_symtab objc_rt_trees[OCTI_RT_META_SYMTAB] |
168 | #define meta_info objc_rt_trees[OCTI_RT_META_INFO] |
169 | |
170 | #define meta_ehtype objc_rt_trees[OCTI_RT_META_EHTYPE] |
171 | |
172 | #define meta_const_str objc_rt_trees[OCTI_RT_META_CONST_STR] |
173 | |
174 | #define meta_ivar_ref objc_rt_trees[OCTI_RT_META_IVAR_REF] |
175 | |
176 | #define OBJCMETA(DECL,VERS,KIND) \ |
177 | if (VERS) \ |
178 | DECL_ATTRIBUTES (DECL) = build_tree_list ((VERS), (KIND)); |
179 | |