Mercurial > hg > CbC > CbC_gcc
annotate gcc/langhooks.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
rev | line source |
---|---|
0 | 1 /* Default language-specific hooks. |
145 | 2 Copyright (C) 2001-2020 Free Software Foundation, Inc. |
0 | 3 Contributed by Alexandre Oliva <aoliva@redhat.com> |
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 #include "config.h" | |
22 #include "system.h" | |
23 #include "coretypes.h" | |
111 | 24 #include "target.h" |
0 | 25 #include "rtl.h" |
111 | 26 #include "tree.h" |
27 #include "timevar.h" | |
28 #include "stringpool.h" | |
29 #include "diagnostic.h" | |
30 #include "intl.h" | |
31 #include "toplev.h" | |
32 #include "attribs.h" | |
33 #include "gimplify.h" | |
0 | 34 #include "langhooks.h" |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
35 #include "tree-diagnostic.h" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
36 #include "output.h" |
111 | 37 #include "timevar.h" |
145 | 38 #include "stor-layout.h" |
0 | 39 |
40 /* Do nothing; in many cases the default hook. */ | |
41 | |
42 void | |
43 lhd_do_nothing (void) | |
44 { | |
45 } | |
46 | |
47 /* Do nothing (tree). */ | |
48 | |
49 void | |
50 lhd_do_nothing_t (tree ARG_UNUSED (t)) | |
51 { | |
52 } | |
53 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
54 /* Pass through (tree). */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
55 tree |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
56 lhd_pass_through_t (tree t) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
57 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
58 return t; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
59 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
60 |
0 | 61 /* Do nothing (int, int, int). Return NULL_TREE. */ |
62 | |
63 tree | |
64 lhd_do_nothing_iii_return_null_tree (int ARG_UNUSED (i), | |
65 int ARG_UNUSED (j), | |
66 int ARG_UNUSED (k)) | |
67 { | |
68 return NULL_TREE; | |
69 } | |
70 | |
71 /* Do nothing (function). */ | |
72 | |
73 void | |
74 lhd_do_nothing_f (struct function * ARG_UNUSED (f)) | |
75 { | |
76 } | |
77 | |
78 /* Do nothing (return NULL_TREE). */ | |
79 | |
80 tree | |
81 lhd_return_null_tree (tree ARG_UNUSED (t)) | |
82 { | |
83 return NULL_TREE; | |
84 } | |
85 | |
86 /* Do nothing (return NULL_TREE). */ | |
87 | |
88 tree | |
89 lhd_return_null_const_tree (const_tree ARG_UNUSED (t)) | |
90 { | |
91 return NULL_TREE; | |
92 } | |
93 | |
94 /* The default post options hook. */ | |
95 | |
96 bool | |
97 lhd_post_options (const char ** ARG_UNUSED (pfilename)) | |
98 { | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
99 /* Excess precision other than "fast" requires front-end |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
100 support. */ |
145 | 101 flag_excess_precision = EXCESS_PRECISION_FAST; |
0 | 102 return false; |
103 } | |
104 | |
105 /* Called from by print-tree.c. */ | |
106 | |
107 void | |
108 lhd_print_tree_nothing (FILE * ARG_UNUSED (file), | |
109 tree ARG_UNUSED (node), | |
110 int ARG_UNUSED (indent)) | |
111 { | |
112 } | |
113 | |
111 | 114 /* Called from check_global_declaration. */ |
0 | 115 |
116 bool | |
117 lhd_warn_unused_global_decl (const_tree decl) | |
118 { | |
111 | 119 /* This is what used to exist in check_global_declaration. Probably |
0 | 120 not many of these actually apply to non-C languages. */ |
121 | |
122 if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)) | |
123 return false; | |
111 | 124 if (VAR_P (decl) && TREE_READONLY (decl)) |
0 | 125 return false; |
126 if (DECL_IN_SYSTEM_HEADER (decl)) | |
127 return false; | |
128 | |
129 return true; | |
130 } | |
131 | |
132 /* Set the DECL_ASSEMBLER_NAME for DECL. */ | |
133 void | |
134 lhd_set_decl_assembler_name (tree decl) | |
135 { | |
136 tree id; | |
137 | |
111 | 138 /* set_decl_assembler_name may be called on TYPE_DECL to record ODR |
139 name for C++ types. By default types have no ODR names. */ | |
140 if (TREE_CODE (decl) == TYPE_DECL) | |
141 return; | |
142 | |
0 | 143 /* The language-independent code should never use the |
144 DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and | |
145 VAR_DECLs for variables with static storage duration need a real | |
146 DECL_ASSEMBLER_NAME. */ | |
147 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL | |
111 | 148 || (VAR_P (decl) |
0 | 149 && (TREE_STATIC (decl) |
150 || DECL_EXTERNAL (decl) | |
151 || TREE_PUBLIC (decl)))); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
152 |
0 | 153 /* By default, assume the name to use in assembly code is the same |
154 as that used in the source language. (That's correct for C, and | |
155 GCC used to set DECL_ASSEMBLER_NAME to the same value as | |
156 DECL_NAME in build_decl, so this choice provides backwards | |
157 compatibility with existing front-ends. This assumption is wrapped | |
158 in a target hook, to allow for target-specific modification of the | |
159 identifier. | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
160 |
0 | 161 Can't use just the variable's own name for a variable whose scope |
162 is less than the whole compilation. Concatenate a distinguishing | |
163 number - we use the DECL_UID. */ | |
164 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
165 if (TREE_PUBLIC (decl) || DECL_FILE_SCOPE_P (decl)) |
0 | 166 id = targetm.mangle_decl_assembler_name (decl, DECL_NAME (decl)); |
167 else | |
168 { | |
169 const char *name = IDENTIFIER_POINTER (DECL_NAME (decl)); | |
170 char *label; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
171 |
0 | 172 ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl)); |
173 id = get_identifier (label); | |
174 } | |
131 | 175 |
0 | 176 SET_DECL_ASSEMBLER_NAME (decl, id); |
131 | 177 } |
0 | 178 |
131 | 179 /* Forcibly overwrite the DECL_ASSEMBLER_NAME for DECL to NAME. */ |
180 void | |
181 lhd_overwrite_decl_assembler_name (tree decl, tree name) | |
182 { | |
183 DECL_ASSEMBLER_NAME_RAW (decl) = name; | |
0 | 184 } |
185 | |
186 /* Type promotion for variable arguments. */ | |
187 tree | |
188 lhd_type_promotes_to (tree ARG_UNUSED (type)) | |
189 { | |
190 gcc_unreachable (); | |
191 } | |
192 | |
193 /* Registration of machine- or os-specific builtin types. */ | |
194 void | |
195 lhd_register_builtin_type (tree ARG_UNUSED (type), | |
196 const char * ARG_UNUSED (name)) | |
197 { | |
198 } | |
199 | |
200 /* Invalid use of an incomplete type. */ | |
201 void | |
111 | 202 lhd_incomplete_type_error (location_t ARG_UNUSED (loc), |
203 const_tree ARG_UNUSED (value), const_tree type) | |
0 | 204 { |
205 gcc_assert (TREE_CODE (type) == ERROR_MARK); | |
206 return; | |
207 } | |
208 | |
209 /* Provide a default routine for alias sets that always returns -1. This | |
210 is used by languages that don't need to do anything special. */ | |
211 | |
212 alias_set_type | |
213 lhd_get_alias_set (tree ARG_UNUSED (t)) | |
214 { | |
215 return -1; | |
216 } | |
217 | |
218 /* This is the default decl_printable_name function. */ | |
219 | |
220 const char * | |
221 lhd_decl_printable_name (tree decl, int ARG_UNUSED (verbosity)) | |
222 { | |
223 gcc_assert (decl && DECL_NAME (decl)); | |
224 return IDENTIFIER_POINTER (DECL_NAME (decl)); | |
225 } | |
226 | |
227 /* This is the default dwarf_name function. */ | |
228 | |
229 const char * | |
230 lhd_dwarf_name (tree t, int verbosity) | |
231 { | |
232 gcc_assert (DECL_P (t)); | |
233 | |
234 return lang_hooks.decl_printable_name (t, verbosity); | |
235 } | |
236 | |
237 /* This compares two types for equivalence ("compatible" in C-based languages). | |
238 This routine should only return 1 if it is sure. It should not be used | |
239 in contexts where erroneously returning 0 causes problems. */ | |
240 | |
241 int | |
242 lhd_types_compatible_p (tree x, tree y) | |
243 { | |
244 return TYPE_MAIN_VARIANT (x) == TYPE_MAIN_VARIANT (y); | |
245 } | |
246 | |
247 /* lang_hooks.tree_dump.dump_tree: Dump language-specific parts of tree | |
248 nodes. Returns nonzero if it does not want the usual dumping of the | |
249 second argument. */ | |
250 | |
251 bool | |
252 lhd_tree_dump_dump_tree (void *di ATTRIBUTE_UNUSED, tree t ATTRIBUTE_UNUSED) | |
253 { | |
254 return false; | |
255 } | |
256 | |
257 /* lang_hooks.tree_dump.type_qual: Determine type qualifiers in a | |
258 language-specific way. */ | |
259 | |
260 int | |
261 lhd_tree_dump_type_quals (const_tree t) | |
262 { | |
263 return TYPE_QUALS (t); | |
264 } | |
265 | |
266 /* lang_hooks.gimplify_expr re-writes *EXPR_P into GIMPLE form. */ | |
267 | |
268 int | |
269 lhd_gimplify_expr (tree *expr_p ATTRIBUTE_UNUSED, | |
270 gimple_seq *pre_p ATTRIBUTE_UNUSED, | |
271 gimple_seq *post_p ATTRIBUTE_UNUSED) | |
272 { | |
273 return GS_UNHANDLED; | |
274 } | |
275 | |
276 /* lang_hooks.tree_size: Determine the size of a tree with code C, | |
111 | 277 which is a language-specific tree code in category tcc_constant, |
278 tcc_exceptional or tcc_type. The default expects never to be called. */ | |
0 | 279 size_t |
280 lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED) | |
281 { | |
282 gcc_unreachable (); | |
283 } | |
284 | |
285 /* Return true if decl, which is a function decl, may be called by a | |
286 sibcall. */ | |
287 | |
288 bool | |
289 lhd_decl_ok_for_sibcall (const_tree decl ATTRIBUTE_UNUSED) | |
290 { | |
291 return true; | |
292 } | |
293 | |
111 | 294 /* Generic global declaration processing. This is meant to be called |
295 by the front-ends at the end of parsing. C/C++ do their own thing, | |
296 but other front-ends may call this. */ | |
297 | |
0 | 298 void |
111 | 299 global_decl_processing (void) |
0 | 300 { |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
301 tree globals, decl, *vec; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
302 int len, i; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
303 |
111 | 304 timevar_stop (TV_PHASE_PARSING); |
305 timevar_start (TV_PHASE_DEFERRED); | |
0 | 306 /* Really define vars that have had only a tentative definition. |
307 Really output inline functions that must actually be callable | |
308 and have not been output so far. */ | |
309 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
310 globals = lang_hooks.decls.getdecls (); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
311 len = list_length (globals); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
312 vec = XNEWVEC (tree, len); |
0 | 313 |
314 /* Process the decls in reverse order--earliest first. | |
315 Put them into VEC from back to front, then take out from front. */ | |
316 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
317 for (i = 0, decl = globals; i < len; i++, decl = DECL_CHAIN (decl)) |
0 | 318 vec[len - i - 1] = decl; |
319 | |
320 wrapup_global_declarations (vec, len); | |
111 | 321 timevar_stop (TV_PHASE_DEFERRED); |
0 | 322 |
111 | 323 timevar_start (TV_PHASE_PARSING); |
0 | 324 free (vec); |
325 } | |
326 | |
327 /* Called to perform language-specific initialization of CTX. */ | |
328 void | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
329 lhd_initialize_diagnostics (diagnostic_context *ctx ATTRIBUTE_UNUSED) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
330 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
331 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
332 |
111 | 333 /* Called to register dumps. */ |
334 void | |
335 lhd_register_dumps (gcc::dump_manager *) | |
336 { | |
337 } | |
338 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
339 /* Called to perform language-specific options initialization. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
340 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
341 lhd_init_options (unsigned int decoded_options_count ATTRIBUTE_UNUSED, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
342 struct cl_decoded_option *decoded_options ATTRIBUTE_UNUSED) |
0 | 343 { |
344 } | |
345 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
346 /* By default, always complain about options for the wrong language. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
347 bool |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
348 lhd_complain_wrong_lang_p (const struct cl_option *option ATTRIBUTE_UNUSED) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
349 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
350 return true; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
351 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
352 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
353 /* By default, no language-specific options are valid. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
354 bool |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
355 lhd_handle_option (size_t code ATTRIBUTE_UNUSED, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
356 const char *arg ATTRIBUTE_UNUSED, |
131 | 357 HOST_WIDE_INT value ATTRIBUTE_UNUSED, |
358 int kind ATTRIBUTE_UNUSED, | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
359 location_t loc ATTRIBUTE_UNUSED, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
360 const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
361 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
362 return false; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
363 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
364 |
0 | 365 /* The default function to print out name of current function that caused |
366 an error. */ | |
367 void | |
368 lhd_print_error_function (diagnostic_context *context, const char *file, | |
369 diagnostic_info *diagnostic) | |
370 { | |
371 if (diagnostic_last_function_changed (context, diagnostic)) | |
372 { | |
131 | 373 char *old_prefix = pp_take_prefix (context->printer); |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
374 tree abstract_origin = diagnostic_abstract_origin (diagnostic); |
0 | 375 char *new_prefix = (file && abstract_origin == NULL) |
111 | 376 ? file_name_as_prefix (context, file) : NULL; |
0 | 377 |
378 pp_set_prefix (context->printer, new_prefix); | |
379 | |
380 if (current_function_decl == NULL) | |
381 pp_printf (context->printer, _("At top level:")); | |
382 else | |
383 { | |
384 tree fndecl, ao; | |
385 | |
386 if (abstract_origin) | |
387 { | |
388 ao = BLOCK_ABSTRACT_ORIGIN (abstract_origin); | |
389 gcc_assert (TREE_CODE (ao) == FUNCTION_DECL); | |
390 fndecl = ao; | |
391 } | |
392 else | |
393 fndecl = current_function_decl; | |
394 | |
395 if (TREE_CODE (TREE_TYPE (fndecl)) == METHOD_TYPE) | |
396 pp_printf | |
397 (context->printer, _("In member function %qs"), | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
398 identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2))); |
0 | 399 else |
400 pp_printf | |
401 (context->printer, _("In function %qs"), | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
402 identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2))); |
0 | 403 |
404 while (abstract_origin) | |
405 { | |
406 location_t *locus; | |
407 tree block = abstract_origin; | |
408 | |
409 locus = &BLOCK_SOURCE_LOCATION (block); | |
410 fndecl = NULL; | |
411 block = BLOCK_SUPERCONTEXT (block); | |
412 while (block && TREE_CODE (block) == BLOCK | |
413 && BLOCK_ABSTRACT_ORIGIN (block)) | |
414 { | |
415 ao = BLOCK_ABSTRACT_ORIGIN (block); | |
416 if (TREE_CODE (ao) == FUNCTION_DECL) | |
417 { | |
418 fndecl = ao; | |
419 break; | |
420 } | |
421 else if (TREE_CODE (ao) != BLOCK) | |
422 break; | |
423 | |
424 block = BLOCK_SUPERCONTEXT (block); | |
425 } | |
426 if (fndecl) | |
427 abstract_origin = block; | |
428 else | |
429 { | |
430 while (block && TREE_CODE (block) == BLOCK) | |
431 block = BLOCK_SUPERCONTEXT (block); | |
432 | |
433 if (block && TREE_CODE (block) == FUNCTION_DECL) | |
434 fndecl = block; | |
435 abstract_origin = NULL; | |
436 } | |
437 if (fndecl) | |
438 { | |
439 expanded_location s = expand_location (*locus); | |
111 | 440 pp_comma (context->printer); |
0 | 441 pp_newline (context->printer); |
442 if (s.file != NULL) | |
443 { | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
444 if (context->show_column) |
0 | 445 pp_printf (context->printer, |
111 | 446 _(" inlined from %qs at %r%s:%d:%d%R"), |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
447 identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2)), |
111 | 448 "locus", s.file, s.line, s.column); |
0 | 449 else |
450 pp_printf (context->printer, | |
111 | 451 _(" inlined from %qs at %r%s:%d%R"), |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
452 identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2)), |
111 | 453 "locus", s.file, s.line); |
0 | 454 |
455 } | |
456 else | |
457 pp_printf (context->printer, _(" inlined from %qs"), | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
458 identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2))); |
0 | 459 } |
460 } | |
111 | 461 pp_colon (context->printer); |
0 | 462 } |
463 | |
464 diagnostic_set_last_function (context, diagnostic); | |
111 | 465 pp_newline_and_flush (context->printer); |
0 | 466 context->printer->prefix = old_prefix; |
467 free ((char*) new_prefix); | |
468 } | |
469 } | |
470 | |
471 tree | |
472 lhd_make_node (enum tree_code code) | |
473 { | |
474 return make_node (code); | |
475 } | |
476 | |
145 | 477 /* Default implementation of LANG_HOOKS_SIMULATE_ENUM_DECL. Assume a |
478 simple int-based enumerator (which is all the hook can be used for | |
479 at present) and push each decl individually without any decoration. | |
480 | |
481 This definition is suitable for LTO and is generic enough that it | |
482 might be reusable elsewhere. */ | |
483 tree | |
484 lhd_simulate_enum_decl (location_t loc, const char *name, | |
485 vec<string_int_pair> values) | |
486 { | |
487 tree enumtype = lang_hooks.types.make_type (ENUMERAL_TYPE); | |
488 tree enumdecl = build_decl (loc, TYPE_DECL, get_identifier (name), enumtype); | |
489 TYPE_STUB_DECL (enumtype) = enumdecl; | |
490 | |
491 tree value_chain = NULL_TREE; | |
492 string_int_pair *value; | |
493 unsigned int i; | |
494 FOR_EACH_VEC_ELT (values, i, value) | |
495 { | |
496 tree value_decl = build_decl (loc, CONST_DECL, | |
497 get_identifier (value->first), enumtype); | |
498 DECL_INITIAL (value_decl) = build_int_cst (integer_type_node, | |
499 value->second); | |
500 lang_hooks.decls.pushdecl (value_decl); | |
501 value_chain = tree_cons (value_decl, DECL_INITIAL (value_decl), | |
502 value_chain); | |
503 } | |
504 | |
505 TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (integer_type_node); | |
506 TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (integer_type_node); | |
507 SET_TYPE_ALIGN (enumtype, TYPE_ALIGN (integer_type_node)); | |
508 TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node); | |
509 layout_type (enumtype); | |
510 lang_hooks.decls.pushdecl (enumdecl); | |
511 | |
512 return enumtype; | |
513 } | |
514 | |
111 | 515 /* Default implementation of LANG_HOOKS_TYPE_FOR_SIZE. |
516 Return an integer type with PRECISION bits of precision, | |
517 that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */ | |
518 | |
519 tree | |
520 lhd_type_for_size (unsigned precision, int unsignedp) | |
521 { | |
522 int i; | |
523 | |
524 if (precision == TYPE_PRECISION (integer_type_node)) | |
525 return unsignedp ? unsigned_type_node : integer_type_node; | |
526 | |
527 if (precision == TYPE_PRECISION (signed_char_type_node)) | |
528 return unsignedp ? unsigned_char_type_node : signed_char_type_node; | |
529 | |
530 if (precision == TYPE_PRECISION (short_integer_type_node)) | |
531 return unsignedp ? short_unsigned_type_node : short_integer_type_node; | |
532 | |
533 if (precision == TYPE_PRECISION (long_integer_type_node)) | |
534 return unsignedp ? long_unsigned_type_node : long_integer_type_node; | |
535 | |
536 if (precision == TYPE_PRECISION (long_long_integer_type_node)) | |
537 return unsignedp | |
538 ? long_long_unsigned_type_node | |
539 : long_long_integer_type_node; | |
540 | |
541 for (i = 0; i < NUM_INT_N_ENTS; i ++) | |
542 if (int_n_enabled_p[i] | |
543 && precision == int_n_data[i].bitsize) | |
544 return (unsignedp ? int_n_trees[i].unsigned_type | |
545 : int_n_trees[i].signed_type); | |
546 | |
547 if (precision <= TYPE_PRECISION (intQI_type_node)) | |
548 return unsignedp ? unsigned_intQI_type_node : intQI_type_node; | |
549 | |
550 if (precision <= TYPE_PRECISION (intHI_type_node)) | |
551 return unsignedp ? unsigned_intHI_type_node : intHI_type_node; | |
552 | |
553 if (precision <= TYPE_PRECISION (intSI_type_node)) | |
554 return unsignedp ? unsigned_intSI_type_node : intSI_type_node; | |
555 | |
556 if (precision <= TYPE_PRECISION (intDI_type_node)) | |
557 return unsignedp ? unsigned_intDI_type_node : intDI_type_node; | |
558 | |
559 if (precision <= TYPE_PRECISION (intTI_type_node)) | |
560 return unsignedp ? unsigned_intTI_type_node : intTI_type_node; | |
561 | |
562 return NULL_TREE; | |
563 } | |
564 | |
0 | 565 HOST_WIDE_INT |
566 lhd_to_target_charset (HOST_WIDE_INT c) | |
567 { | |
568 return c; | |
569 } | |
570 | |
571 tree | |
572 lhd_expr_to_decl (tree expr, bool *tc ATTRIBUTE_UNUSED, bool *se ATTRIBUTE_UNUSED) | |
573 { | |
574 return expr; | |
575 } | |
576 | |
577 /* Return sharing kind if OpenMP sharing attribute of DECL is | |
578 predetermined, OMP_CLAUSE_DEFAULT_UNSPECIFIED otherwise. */ | |
579 | |
580 enum omp_clause_default_kind | |
581 lhd_omp_predetermined_sharing (tree decl ATTRIBUTE_UNUSED) | |
582 { | |
583 if (DECL_ARTIFICIAL (decl)) | |
584 return OMP_CLAUSE_DEFAULT_SHARED; | |
585 return OMP_CLAUSE_DEFAULT_UNSPECIFIED; | |
586 } | |
587 | |
588 /* Generate code to copy SRC to DST. */ | |
589 | |
590 tree | |
591 lhd_omp_assignment (tree clause ATTRIBUTE_UNUSED, tree dst, tree src) | |
592 { | |
593 return build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src); | |
594 } | |
595 | |
111 | 596 /* Finalize clause C. */ |
597 | |
598 void | |
599 lhd_omp_finish_clause (tree, gimple_seq *) | |
600 { | |
601 } | |
602 | |
603 /* Return true if DECL is a scalar variable (for the purpose of | |
604 implicit firstprivatization). */ | |
605 | |
606 bool | |
607 lhd_omp_scalar_p (tree decl) | |
608 { | |
609 tree type = TREE_TYPE (decl); | |
610 if (TREE_CODE (type) == REFERENCE_TYPE) | |
611 type = TREE_TYPE (type); | |
612 if (TREE_CODE (type) == COMPLEX_TYPE) | |
613 type = TREE_TYPE (type); | |
614 if (INTEGRAL_TYPE_P (type) | |
615 || SCALAR_FLOAT_TYPE_P (type) | |
616 || TREE_CODE (type) == POINTER_TYPE) | |
617 return true; | |
618 return false; | |
619 } | |
620 | |
0 | 621 /* Register language specific type size variables as potentially OpenMP |
622 firstprivate variables. */ | |
623 | |
624 void | |
625 lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *c ATTRIBUTE_UNUSED, | |
626 tree t ATTRIBUTE_UNUSED) | |
627 { | |
628 } | |
629 | |
111 | 630 /* Return true if TYPE is an OpenMP mappable type. */ |
631 | |
632 bool | |
633 lhd_omp_mappable_type (tree type) | |
634 { | |
635 /* Mappable type has to be complete. */ | |
636 if (type == error_mark_node || !COMPLETE_TYPE_P (type)) | |
637 return false; | |
638 return true; | |
639 } | |
640 | |
145 | 641 /* Common function for add_builtin_function, add_builtin_function_ext_scope |
642 and simulate_builtin_function_decl. */ | |
643 | |
0 | 644 static tree |
145 | 645 build_builtin_function (location_t location, const char *name, tree type, |
646 int function_code, enum built_in_class cl, | |
647 const char *library_name, tree attrs) | |
0 | 648 { |
649 tree id = get_identifier (name); | |
145 | 650 tree decl = build_decl (location, FUNCTION_DECL, id, type); |
0 | 651 |
652 TREE_PUBLIC (decl) = 1; | |
653 DECL_EXTERNAL (decl) = 1; | |
654 | |
145 | 655 set_decl_built_in_function (decl, cl, function_code); |
0 | 656 |
657 if (library_name) | |
658 { | |
659 tree libname = get_identifier (library_name); | |
111 | 660 |
661 libname = targetm.mangle_decl_assembler_name (decl, libname); | |
0 | 662 SET_DECL_ASSEMBLER_NAME (decl, libname); |
663 } | |
664 | |
665 /* Possibly apply some default attributes to this built-in function. */ | |
666 if (attrs) | |
667 decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN); | |
668 else | |
669 decl_attributes (&decl, NULL_TREE, 0); | |
670 | |
145 | 671 return decl; |
0 | 672 } |
673 | |
674 /* Create a builtin function. */ | |
675 | |
676 tree | |
677 add_builtin_function (const char *name, | |
678 tree type, | |
679 int function_code, | |
680 enum built_in_class cl, | |
681 const char *library_name, | |
682 tree attrs) | |
683 { | |
145 | 684 tree decl = build_builtin_function (BUILTINS_LOCATION, name, type, |
685 function_code, cl, library_name, attrs); | |
686 return lang_hooks.builtin_function (decl); | |
0 | 687 } |
688 | |
689 /* Like add_builtin_function, but make sure the scope is the external scope. | |
690 This is used to delay putting in back end builtin functions until the ISA | |
691 that defines the builtin is declared via function specific target options, | |
692 which can save memory for machines like the x86_64 that have multiple ISAs. | |
693 If this points to the same function as builtin_function, the backend must | |
694 add all of the builtins at program initialization time. */ | |
695 | |
696 tree | |
697 add_builtin_function_ext_scope (const char *name, | |
698 tree type, | |
699 int function_code, | |
700 enum built_in_class cl, | |
701 const char *library_name, | |
702 tree attrs) | |
703 { | |
145 | 704 tree decl = build_builtin_function (BUILTINS_LOCATION, name, type, |
705 function_code, cl, library_name, attrs); | |
706 return lang_hooks.builtin_function_ext_scope (decl); | |
707 } | |
708 | |
709 /* Simulate a declaration of a target-specific built-in function at | |
710 location LOCATION, as though it had been declared directly in the | |
711 source language. NAME is the name of the function, TYPE is its function | |
712 type, FUNCTION_CODE is the target-specific function code, LIBRARY_NAME | |
713 is the name of the underlying library function (NULL if none) and | |
714 ATTRS is a list of function attributes. | |
715 | |
716 Return the decl of the declared function. */ | |
717 | |
718 tree | |
719 simulate_builtin_function_decl (location_t location, const char *name, | |
720 tree type, int function_code, | |
721 const char *library_name, tree attrs) | |
722 { | |
723 tree decl = build_builtin_function (location, name, type, | |
724 function_code, BUILT_IN_MD, | |
725 library_name, attrs); | |
726 tree new_decl = lang_hooks.simulate_builtin_function_decl (decl); | |
727 | |
728 /* Give the front end a chance to create a new decl if necessary, | |
729 but if the front end discards the decl in favour of a conflicting | |
730 (erroneous) previous definition, return the decl that we tried but | |
731 failed to add. This allows the caller to process the returned decl | |
732 normally, even though the source code won't be able to use it. */ | |
733 if (TREE_CODE (new_decl) == FUNCTION_DECL | |
734 && fndecl_built_in_p (new_decl, function_code, BUILT_IN_MD)) | |
735 return new_decl; | |
736 | |
737 return decl; | |
0 | 738 } |
739 | |
740 tree | |
741 lhd_builtin_function (tree decl) | |
742 { | |
743 lang_hooks.decls.pushdecl (decl); | |
744 return decl; | |
745 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
746 |
111 | 747 /* Create a builtin type. */ |
748 | |
749 tree | |
750 add_builtin_type (const char *name, tree type) | |
751 { | |
752 tree id = get_identifier (name); | |
753 tree decl = build_decl (BUILTINS_LOCATION, TYPE_DECL, id, type); | |
754 return lang_hooks.decls.pushdecl (decl); | |
755 } | |
756 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
757 /* LTO hooks. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
758 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
759 /* Used to save and restore any previously active section. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
760 static section *saved_section; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
761 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
762 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
763 /* Begin a new LTO output section named NAME. This default implementation |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
764 saves the old section and emits assembly code to switch to the new |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
765 section. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
766 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
767 void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
768 lhd_begin_section (const char *name) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
769 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
770 section *section; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
771 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
772 /* Save the old section so we can restore it in lto_end_asm_section. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
773 gcc_assert (!saved_section); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
774 saved_section = in_section; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
775 if (!saved_section) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
776 saved_section = text_section; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
777 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
778 /* Create a new section and switch to it. */ |
111 | 779 section = get_section (name, SECTION_DEBUG | SECTION_EXCLUDE, NULL); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
780 switch_to_section (section); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
781 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
782 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
783 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
784 /* Write DATA of length LEN to the current LTO output section. This default |
111 | 785 implementation just calls assemble_string. */ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
786 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
787 void |
111 | 788 lhd_append_data (const void *data, size_t len, void *) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
789 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
790 if (data) |
111 | 791 { |
792 timevar_push (TV_IPA_LTO_OUTPUT); | |
793 assemble_string ((const char *)data, len); | |
794 timevar_pop (TV_IPA_LTO_OUTPUT); | |
795 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
796 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
797 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
798 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
799 /* Finish the current LTO output section. This default implementation emits |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
800 assembly code to switch to any section previously saved by |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
801 lhd_begin_section. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
802 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
803 void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
804 lhd_end_section (void) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
805 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
806 if (saved_section) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
807 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
808 switch_to_section (saved_section); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
809 saved_section = NULL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
810 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
811 } |
111 | 812 |
813 /* Default implementation of enum_underlying_base_type using type_for_size. */ | |
814 | |
815 tree | |
816 lhd_enum_underlying_base_type (const_tree enum_type) | |
817 { | |
818 return lang_hooks.types.type_for_size (TYPE_PRECISION (enum_type), | |
819 TYPE_UNSIGNED (enum_type)); | |
820 } | |
821 | |
822 /* Default implementation of LANG_HOOKS_GET_SUBSTRING_LOCATION. */ | |
823 | |
824 const char * | |
825 lhd_get_substring_location (const substring_loc &, location_t *) | |
826 { | |
827 return "unimplemented"; | |
828 } | |
829 | |
830 /* Default implementation of LANG_HOOKS_DECL_DWARF_ATTRIBUTE. Don't add | |
831 any attributes. */ | |
832 | |
833 int | |
834 lhd_decl_dwarf_attribute (const_tree, int) | |
835 { | |
836 return -1; | |
837 } | |
838 | |
839 /* Default implementation of LANG_HOOKS_TYPE_DWARF_ATTRIBUTE. Don't add | |
840 any attributes. */ | |
841 | |
842 int | |
843 lhd_type_dwarf_attribute (const_tree, int) | |
844 { | |
845 return -1; | |
846 } | |
847 | |
848 /* Default implementation of LANG_HOOKS_UNIT_SIZE_WITHOUT_REUSABLE_PADDING. | |
849 Just return TYPE_SIZE_UNIT unadjusted. */ | |
850 | |
851 tree | |
852 lhd_unit_size_without_reusable_padding (tree t) | |
853 { | |
854 return TYPE_SIZE_UNIT (t); | |
855 } | |
856 | |
857 /* Returns true if the current lang_hooks represents the GNU C frontend. */ | |
858 | |
859 bool | |
860 lang_GNU_C (void) | |
861 { | |
862 return (strncmp (lang_hooks.name, "GNU C", 5) == 0 | |
863 && (lang_hooks.name[5] == '\0' || ISDIGIT (lang_hooks.name[5]))); | |
864 } | |
865 | |
866 /* Returns true if the current lang_hooks represents the GNU C++ frontend. */ | |
867 | |
868 bool | |
869 lang_GNU_CXX (void) | |
870 { | |
871 return strncmp (lang_hooks.name, "GNU C++", 7) == 0; | |
872 } | |
873 | |
874 /* Returns true if the current lang_hooks represents the GNU Fortran frontend. */ | |
875 | |
876 bool | |
877 lang_GNU_Fortran (void) | |
878 { | |
879 return strncmp (lang_hooks.name, "GNU Fortran", 11) == 0; | |
880 } | |
881 | |
882 /* Returns true if the current lang_hooks represents the GNU Objective-C | |
883 frontend. */ | |
884 | |
885 bool | |
886 lang_GNU_OBJC (void) | |
887 { | |
888 return strncmp (lang_hooks.name, "GNU Objective-C", 15) == 0; | |
889 } |