1 /* Language-dependent hooks for LTO.
2 Copyright 2009, 2010 Free Software Foundation, Inc.
3 Contributed by CodeSourcery, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/>. */
23 #include "coretypes.h"
28 #include "langhooks.h"
29 #include "langhooks-def.h"
33 #include "tree-inline.h"
35 #include "diagnostic-core.h"
37 #include "lto-streamer.h"
39 static tree
handle_noreturn_attribute (tree
*, tree
, tree
, int, bool *);
40 static tree
handle_leaf_attribute (tree
*, tree
, tree
, int, bool *);
41 static tree
handle_const_attribute (tree
*, tree
, tree
, int, bool *);
42 static tree
handle_malloc_attribute (tree
*, tree
, tree
, int, bool *);
43 static tree
handle_pure_attribute (tree
*, tree
, tree
, int, bool *);
44 static tree
handle_novops_attribute (tree
*, tree
, tree
, int, bool *);
45 static tree
handle_nonnull_attribute (tree
*, tree
, tree
, int, bool *);
46 static tree
handle_nothrow_attribute (tree
*, tree
, tree
, int, bool *);
47 static tree
handle_sentinel_attribute (tree
*, tree
, tree
, int, bool *);
48 static tree
handle_type_generic_attribute (tree
*, tree
, tree
, int, bool *);
49 static tree
handle_transaction_pure_attribute (tree
*, tree
, tree
, int, bool *);
50 static tree
ignore_attribute (tree
*, tree
, tree
, int, bool *);
52 static tree
handle_format_attribute (tree
*, tree
, tree
, int, bool *);
53 static tree
handle_format_arg_attribute (tree
*, tree
, tree
, int, bool *);
55 /* Table of machine-independent attributes supported in GIMPLE. */
56 const struct attribute_spec lto_attribute_table
[] =
58 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
60 { "noreturn", 0, 0, true, false, false,
61 handle_noreturn_attribute
, false },
62 { "leaf", 0, 0, true, false, false,
63 handle_leaf_attribute
, false },
64 /* The same comments as for noreturn attributes apply to const ones. */
65 { "const", 0, 0, true, false, false,
66 handle_const_attribute
, false },
67 { "malloc", 0, 0, true, false, false,
68 handle_malloc_attribute
, false },
69 { "pure", 0, 0, true, false, false,
70 handle_pure_attribute
, false },
71 { "no vops", 0, 0, true, false, false,
72 handle_novops_attribute
, false },
73 { "nonnull", 0, -1, false, true, true,
74 handle_nonnull_attribute
, false },
75 { "nothrow", 0, 0, true, false, false,
76 handle_nothrow_attribute
, false },
77 { "sentinel", 0, 1, false, true, true,
78 handle_sentinel_attribute
, false },
79 { "type generic", 0, 0, false, true, true,
80 handle_type_generic_attribute
, false },
81 { "transaction_pure", 0, 0, false, true, true,
82 handle_transaction_pure_attribute
, false },
83 /* For internal use only. The leading '*' both prevents its usage in
84 source code and signals that it may be overridden by machine tables. */
85 { "*tm regparm", 0, 0, false, true, true,
86 ignore_attribute
, false },
87 { NULL
, 0, 0, false, false, false, NULL
, false }
90 /* Give the specifications for the format attributes, used by C and all
93 const struct attribute_spec lto_format_attribute_table
[] =
95 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
96 affects_type_identity } */
97 { "format", 3, 3, false, true, true,
98 handle_format_attribute
, false },
99 { "format_arg", 1, 1, false, true, true,
100 handle_format_arg_attribute
, false },
101 { NULL
, 0, 0, false, false, false, NULL
, false }
104 enum built_in_attribute
106 #define DEF_ATTR_NULL_TREE(ENUM) ENUM,
107 #define DEF_ATTR_INT(ENUM, VALUE) ENUM,
108 #define DEF_ATTR_IDENT(ENUM, STRING) ENUM,
109 #define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) ENUM,
110 #include "builtin-attrs.def"
111 #undef DEF_ATTR_NULL_TREE
113 #undef DEF_ATTR_IDENT
114 #undef DEF_ATTR_TREE_LIST
118 static GTY(()) tree built_in_attributes
[(int) ATTR_LAST
];
122 enum lto_builtin_type
124 #define DEF_PRIMITIVE_TYPE(NAME, VALUE) NAME,
125 #define DEF_FUNCTION_TYPE_0(NAME, RETURN) NAME,
126 #define DEF_FUNCTION_TYPE_1(NAME, RETURN, ARG1) NAME,
127 #define DEF_FUNCTION_TYPE_2(NAME, RETURN, ARG1, ARG2) NAME,
128 #define DEF_FUNCTION_TYPE_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
129 #define DEF_FUNCTION_TYPE_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
130 #define DEF_FUNCTION_TYPE_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) NAME,
131 #define DEF_FUNCTION_TYPE_6(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) NAME,
132 #define DEF_FUNCTION_TYPE_7(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) NAME,
133 #define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
134 #define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
135 #define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
136 #define DEF_FUNCTION_TYPE_VAR_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
137 #define DEF_FUNCTION_TYPE_VAR_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
138 #define DEF_FUNCTION_TYPE_VAR_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG6) \
140 #define DEF_POINTER_TYPE(NAME, TYPE) NAME,
141 #include "builtin-types.def"
142 #undef DEF_PRIMITIVE_TYPE
143 #undef DEF_FUNCTION_TYPE_0
144 #undef DEF_FUNCTION_TYPE_1
145 #undef DEF_FUNCTION_TYPE_2
146 #undef DEF_FUNCTION_TYPE_3
147 #undef DEF_FUNCTION_TYPE_4
148 #undef DEF_FUNCTION_TYPE_5
149 #undef DEF_FUNCTION_TYPE_6
150 #undef DEF_FUNCTION_TYPE_7
151 #undef DEF_FUNCTION_TYPE_VAR_0
152 #undef DEF_FUNCTION_TYPE_VAR_1
153 #undef DEF_FUNCTION_TYPE_VAR_2
154 #undef DEF_FUNCTION_TYPE_VAR_3
155 #undef DEF_FUNCTION_TYPE_VAR_4
156 #undef DEF_FUNCTION_TYPE_VAR_5
157 #undef DEF_POINTER_TYPE
161 typedef enum lto_builtin_type builtin_type
;
163 static GTY(()) tree builtin_types
[(int) BT_LAST
+ 1];
165 static GTY(()) tree string_type_node
;
166 static GTY(()) tree const_string_type_node
;
167 static GTY(()) tree wint_type_node
;
168 static GTY(()) tree intmax_type_node
;
169 static GTY(()) tree uintmax_type_node
;
170 static GTY(()) tree signed_size_type_node
;
172 /* Flags needed to process builtins.def. */
176 /* Attribute handlers. */
178 /* Handle a "noreturn" attribute; arguments as in
179 struct attribute_spec.handler. */
182 handle_noreturn_attribute (tree
*node
, tree
ARG_UNUSED (name
),
183 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
184 bool * ARG_UNUSED (no_add_attrs
))
186 tree type
= TREE_TYPE (*node
);
188 if (TREE_CODE (*node
) == FUNCTION_DECL
)
189 TREE_THIS_VOLATILE (*node
) = 1;
190 else if (TREE_CODE (type
) == POINTER_TYPE
191 && TREE_CODE (TREE_TYPE (type
)) == FUNCTION_TYPE
)
194 (build_type_variant (TREE_TYPE (type
),
195 TYPE_READONLY (TREE_TYPE (type
)), 1));
202 /* Handle a "leaf" attribute; arguments as in
203 struct attribute_spec.handler. */
206 handle_leaf_attribute (tree
*node
, tree name
,
207 tree
ARG_UNUSED (args
),
208 int ARG_UNUSED (flags
), bool *no_add_attrs
)
210 if (TREE_CODE (*node
) != FUNCTION_DECL
)
212 warning (OPT_Wattributes
, "%qE attribute ignored", name
);
213 *no_add_attrs
= true;
215 if (!TREE_PUBLIC (*node
))
217 warning (OPT_Wattributes
, "%qE attribute has no effect on unit local functions", name
);
218 *no_add_attrs
= true;
224 /* Handle a "const" attribute; arguments as in
225 struct attribute_spec.handler. */
228 handle_const_attribute (tree
*node
, tree
ARG_UNUSED (name
),
229 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
230 bool * ARG_UNUSED (no_add_attrs
))
232 tree type
= TREE_TYPE (*node
);
234 /* See FIXME comment on noreturn in c_common_attribute_table. */
235 if (TREE_CODE (*node
) == FUNCTION_DECL
)
236 TREE_READONLY (*node
) = 1;
237 else if (TREE_CODE (type
) == POINTER_TYPE
238 && TREE_CODE (TREE_TYPE (type
)) == FUNCTION_TYPE
)
241 (build_type_variant (TREE_TYPE (type
), 1,
242 TREE_THIS_VOLATILE (TREE_TYPE (type
))));
250 /* Handle a "malloc" attribute; arguments as in
251 struct attribute_spec.handler. */
254 handle_malloc_attribute (tree
*node
, tree
ARG_UNUSED (name
),
255 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
256 bool * ARG_UNUSED (no_add_attrs
))
258 if (TREE_CODE (*node
) == FUNCTION_DECL
259 && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node
))))
260 DECL_IS_MALLOC (*node
) = 1;
268 /* Handle a "pure" attribute; arguments as in
269 struct attribute_spec.handler. */
272 handle_pure_attribute (tree
*node
, tree
ARG_UNUSED (name
),
273 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
274 bool * ARG_UNUSED (no_add_attrs
))
276 if (TREE_CODE (*node
) == FUNCTION_DECL
)
277 DECL_PURE_P (*node
) = 1;
285 /* Handle a "no vops" attribute; arguments as in
286 struct attribute_spec.handler. */
289 handle_novops_attribute (tree
*node
, tree
ARG_UNUSED (name
),
290 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
291 bool *ARG_UNUSED (no_add_attrs
))
293 gcc_assert (TREE_CODE (*node
) == FUNCTION_DECL
);
294 DECL_IS_NOVOPS (*node
) = 1;
299 /* Helper for nonnull attribute handling; fetch the operand number
300 from the attribute argument list. */
303 get_nonnull_operand (tree arg_num_expr
, unsigned HOST_WIDE_INT
*valp
)
305 /* Verify the arg number is a constant. */
306 if (TREE_CODE (arg_num_expr
) != INTEGER_CST
307 || TREE_INT_CST_HIGH (arg_num_expr
) != 0)
310 *valp
= TREE_INT_CST_LOW (arg_num_expr
);
314 /* Handle the "nonnull" attribute. */
317 handle_nonnull_attribute (tree
*node
, tree
ARG_UNUSED (name
),
318 tree args
, int ARG_UNUSED (flags
),
319 bool * ARG_UNUSED (no_add_attrs
))
323 /* If no arguments are specified, all pointer arguments should be
324 non-null. Verify a full prototype is given so that the arguments
325 will have the correct types when we actually check them later. */
328 gcc_assert (prototype_p (type
));
332 /* Argument list specified. Verify that each argument number references
333 a pointer argument. */
334 for (; args
; args
= TREE_CHAIN (args
))
337 unsigned HOST_WIDE_INT arg_num
= 0, ck_num
;
339 if (!get_nonnull_operand (TREE_VALUE (args
), &arg_num
))
342 argument
= TYPE_ARG_TYPES (type
);
345 for (ck_num
= 1; ; ck_num
++)
347 if (!argument
|| ck_num
== arg_num
)
349 argument
= TREE_CHAIN (argument
);
353 && TREE_CODE (TREE_VALUE (argument
)) == POINTER_TYPE
);
361 /* Handle a "nothrow" attribute; arguments as in
362 struct attribute_spec.handler. */
365 handle_nothrow_attribute (tree
*node
, tree
ARG_UNUSED (name
),
366 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
367 bool * ARG_UNUSED (no_add_attrs
))
369 if (TREE_CODE (*node
) == FUNCTION_DECL
)
370 TREE_NOTHROW (*node
) = 1;
378 /* Handle a "sentinel" attribute. */
381 handle_sentinel_attribute (tree
*node
, tree
ARG_UNUSED (name
), tree args
,
382 int ARG_UNUSED (flags
),
383 bool * ARG_UNUSED (no_add_attrs
))
385 gcc_assert (stdarg_p (*node
));
389 tree position
= TREE_VALUE (args
);
390 gcc_assert (TREE_CODE (position
) == INTEGER_CST
);
391 if (tree_int_cst_lt (position
, integer_zero_node
))
398 /* Handle a "type_generic" attribute. */
401 handle_type_generic_attribute (tree
*node
, tree
ARG_UNUSED (name
),
402 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
403 bool * ARG_UNUSED (no_add_attrs
))
405 /* Ensure we have a function type. */
406 gcc_assert (TREE_CODE (*node
) == FUNCTION_TYPE
);
408 /* Ensure we have a variadic function. */
409 gcc_assert (!prototype_p (*node
) || stdarg_p (*node
));
414 /* Handle a "transaction_pure" attribute. */
417 handle_transaction_pure_attribute (tree
*node
, tree
ARG_UNUSED (name
),
418 tree
ARG_UNUSED (args
),
419 int ARG_UNUSED (flags
),
420 bool * ARG_UNUSED (no_add_attrs
))
422 /* Ensure we have a function type. */
423 gcc_assert (TREE_CODE (*node
) == FUNCTION_TYPE
);
428 /* Ignore the given attribute. Used when this attribute may be usefully
429 overridden by the target, but is not used generically. */
432 ignore_attribute (tree
* ARG_UNUSED (node
), tree
ARG_UNUSED (name
),
433 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
436 *no_add_attrs
= true;
440 /* Handle a "format" attribute; arguments as in
441 struct attribute_spec.handler. */
444 handle_format_attribute (tree
* ARG_UNUSED (node
), tree
ARG_UNUSED (name
),
445 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
448 *no_add_attrs
= true;
453 /* Handle a "format_arg" attribute; arguments as in
454 struct attribute_spec.handler. */
457 handle_format_arg_attribute (tree
* ARG_UNUSED (node
), tree
ARG_UNUSED (name
),
458 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
461 *no_add_attrs
= true;
466 /* Cribbed from c-common.c. */
469 def_fn_type (builtin_type def
, builtin_type ret
, bool var
, int n
, ...)
472 tree
*args
= XALLOCAVEC (tree
, n
);
477 for (i
= 0; i
< n
; ++i
)
479 builtin_type a
= (builtin_type
) va_arg (list
, int);
480 t
= builtin_types
[a
];
481 if (t
== error_mark_node
)
487 t
= builtin_types
[ret
];
488 if (t
== error_mark_node
)
491 t
= build_varargs_function_type_array (t
, n
, args
);
493 t
= build_function_type_array (t
, n
, args
);
496 builtin_types
[def
] = t
;
500 /* Used to help initialize the builtin-types.def table. When a type of
501 the correct size doesn't exist, use error_mark_node instead of NULL.
502 The later results in segfaults even when a decl using the type doesn't
506 builtin_type_for_size (int size
, bool unsignedp
)
508 tree type
= lang_hooks
.types
.type_for_size (size
, unsignedp
);
509 return type
? type
: error_mark_node
;
512 /* Support for DEF_BUILTIN. */
515 def_builtin_1 (enum built_in_function fncode
, const char *name
,
516 enum built_in_class fnclass
, tree fntype
, tree libtype
,
517 bool both_p
, bool fallback_p
, bool nonansi_p
,
518 tree fnattrs
, bool implicit_p
)
523 if (fntype
== error_mark_node
)
526 libname
= name
+ strlen ("__builtin_");
527 decl
= add_builtin_function (name
, fntype
, fncode
, fnclass
,
528 (fallback_p
? libname
: NULL
),
533 && !(nonansi_p
&& flag_no_nonansi_builtin
))
534 add_builtin_function (libname
, libtype
, fncode
, fnclass
,
537 set_builtin_decl (fncode
, decl
, implicit_p
);
541 /* Initialize the attribute table for all the supported builtins. */
544 lto_init_attributes (void)
546 /* Fill in the built_in_attributes array. */
547 #define DEF_ATTR_NULL_TREE(ENUM) \
548 built_in_attributes[(int) ENUM] = NULL_TREE;
549 #define DEF_ATTR_INT(ENUM, VALUE) \
550 built_in_attributes[(int) ENUM] = build_int_cst (NULL_TREE, VALUE);
551 #define DEF_ATTR_IDENT(ENUM, STRING) \
552 built_in_attributes[(int) ENUM] = get_identifier (STRING);
553 #define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) \
554 built_in_attributes[(int) ENUM] \
555 = tree_cons (built_in_attributes[(int) PURPOSE], \
556 built_in_attributes[(int) VALUE], \
557 built_in_attributes[(int) CHAIN]);
558 #include "builtin-attrs.def"
559 #undef DEF_ATTR_NULL_TREE
561 #undef DEF_ATTR_IDENT
562 #undef DEF_ATTR_TREE_LIST
565 /* Create builtin types and functions. VA_LIST_REF_TYPE_NODE and
566 VA_LIST_ARG_TYPE_NODE are used in builtin-types.def. */
569 lto_define_builtins (tree va_list_ref_type_node ATTRIBUTE_UNUSED
,
570 tree va_list_arg_type_node ATTRIBUTE_UNUSED
)
572 #define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
573 builtin_types[ENUM] = VALUE;
574 #define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
575 def_fn_type (ENUM, RETURN, 0, 0);
576 #define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \
577 def_fn_type (ENUM, RETURN, 0, 1, ARG1);
578 #define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
579 def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2);
580 #define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
581 def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3);
582 #define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
583 def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4);
584 #define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
585 def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
586 #define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
588 def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
589 #define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
591 def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
592 #define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
593 def_fn_type (ENUM, RETURN, 1, 0);
594 #define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
595 def_fn_type (ENUM, RETURN, 1, 1, ARG1);
596 #define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
597 def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2);
598 #define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
599 def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3);
600 #define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
601 def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4);
602 #define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
603 def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
604 #define DEF_POINTER_TYPE(ENUM, TYPE) \
605 builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]);
607 #include "builtin-types.def"
609 #undef DEF_PRIMITIVE_TYPE
610 #undef DEF_FUNCTION_TYPE_1
611 #undef DEF_FUNCTION_TYPE_2
612 #undef DEF_FUNCTION_TYPE_3
613 #undef DEF_FUNCTION_TYPE_4
614 #undef DEF_FUNCTION_TYPE_5
615 #undef DEF_FUNCTION_TYPE_6
616 #undef DEF_FUNCTION_TYPE_VAR_0
617 #undef DEF_FUNCTION_TYPE_VAR_1
618 #undef DEF_FUNCTION_TYPE_VAR_2
619 #undef DEF_FUNCTION_TYPE_VAR_3
620 #undef DEF_FUNCTION_TYPE_VAR_4
621 #undef DEF_FUNCTION_TYPE_VAR_5
622 #undef DEF_POINTER_TYPE
623 builtin_types
[(int) BT_LAST
] = NULL_TREE
;
625 lto_init_attributes ();
627 #define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P,\
628 NONANSI_P, ATTRS, IMPLICIT, COND) \
630 def_builtin_1 (ENUM, NAME, CLASS, builtin_types[(int) TYPE], \
631 builtin_types[(int) LIBTYPE], BOTH_P, FALLBACK_P, \
632 NONANSI_P, built_in_attributes[(int) ATTRS], IMPLICIT);
633 #include "builtins.def"
637 static GTY(()) tree registered_builtin_types
;
639 /* Language hooks. */
642 lto_option_lang_mask (void)
648 lto_complain_wrong_lang_p (const struct cl_option
*option ATTRIBUTE_UNUSED
)
650 /* The LTO front end inherits all the options from the first front
651 end that was used. However, not all the original front end
652 options make sense in LTO.
654 A real solution would be to filter this in collect2, but collect2
655 does not have access to all the option attributes to know what to
656 filter. So, in lto1 we silently accept inherited flags and do
662 lto_init_options_struct (struct gcc_options
*opts
)
664 /* By default, C99-like requirements for complex multiply and divide.
665 ??? Until the complex method is encoded in the IL this is the only
666 safe choice. This will pessimize Fortran code with LTO unless
667 people specify a complex method manually or use -ffast-math. */
668 opts
->x_flag_complex_method
= 2;
671 /* Handle command-line option SCODE. If the option takes an argument, it is
672 stored in ARG, which is otherwise NULL. VALUE holds either a numerical
673 argument or a binary value indicating whether the positive or negative form
674 of the option was supplied. */
676 const char *resolution_file_name
;
678 lto_handle_option (size_t scode
, const char *arg
,
679 int value ATTRIBUTE_UNUSED
, int kind ATTRIBUTE_UNUSED
,
680 location_t loc ATTRIBUTE_UNUSED
,
681 const struct cl_option_handlers
*handlers ATTRIBUTE_UNUSED
)
683 enum opt_code code
= (enum opt_code
) scode
;
688 case OPT_fresolution_
:
689 resolution_file_name
= arg
;
703 /* Perform post-option processing. Does additional initialization based on
704 command-line options. PFILENAME is the main input filename. Returns false
705 to enable subsequent back-end initialization. */
708 lto_post_options (const char **pfilename ATTRIBUTE_UNUSED
)
710 /* -fltrans and -fwpa are mutually exclusive. Check for that here. */
711 if (flag_wpa
&& flag_ltrans
)
712 error ("-fwpa and -fltrans are mutually exclusive");
716 flag_generate_lto
= 0;
718 /* During LTRANS, we are not looking at the whole program, only
719 a subset of the whole callgraph. */
720 flag_whole_program
= 0;
724 flag_generate_lto
= 1;
726 /* Excess precision other than "fast" requires front-end
728 flag_excess_precision_cmdline
= EXCESS_PRECISION_FAST
;
730 /* Initialize the compiler back end. */
734 /* Return an integer type with PRECISION bits of precision,
735 that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
738 lto_type_for_size (unsigned precision
, int unsignedp
)
740 if (precision
== TYPE_PRECISION (integer_type_node
))
741 return unsignedp
? unsigned_type_node
: integer_type_node
;
743 if (precision
== TYPE_PRECISION (signed_char_type_node
))
744 return unsignedp
? unsigned_char_type_node
: signed_char_type_node
;
746 if (precision
== TYPE_PRECISION (short_integer_type_node
))
747 return unsignedp
? short_unsigned_type_node
: short_integer_type_node
;
749 if (precision
== TYPE_PRECISION (long_integer_type_node
))
750 return unsignedp
? long_unsigned_type_node
: long_integer_type_node
;
752 if (precision
== TYPE_PRECISION (long_long_integer_type_node
))
754 ? long_long_unsigned_type_node
755 : long_long_integer_type_node
;
757 if (precision
<= TYPE_PRECISION (intQI_type_node
))
758 return unsignedp
? unsigned_intQI_type_node
: intQI_type_node
;
760 if (precision
<= TYPE_PRECISION (intHI_type_node
))
761 return unsignedp
? unsigned_intHI_type_node
: intHI_type_node
;
763 if (precision
<= TYPE_PRECISION (intSI_type_node
))
764 return unsignedp
? unsigned_intSI_type_node
: intSI_type_node
;
766 if (precision
<= TYPE_PRECISION (intDI_type_node
))
767 return unsignedp
? unsigned_intDI_type_node
: intDI_type_node
;
769 if (precision
<= TYPE_PRECISION (intTI_type_node
))
770 return unsignedp
? unsigned_intTI_type_node
: intTI_type_node
;
776 /* Return a data type that has machine mode MODE.
777 If the mode is an integer,
778 then UNSIGNEDP selects between signed and unsigned types.
779 If the mode is a fixed-point mode,
780 then UNSIGNEDP selects between saturating and nonsaturating types. */
783 lto_type_for_mode (enum machine_mode mode
, int unsigned_p
)
787 if (mode
== TYPE_MODE (integer_type_node
))
788 return unsigned_p
? unsigned_type_node
: integer_type_node
;
790 if (mode
== TYPE_MODE (signed_char_type_node
))
791 return unsigned_p
? unsigned_char_type_node
: signed_char_type_node
;
793 if (mode
== TYPE_MODE (short_integer_type_node
))
794 return unsigned_p
? short_unsigned_type_node
: short_integer_type_node
;
796 if (mode
== TYPE_MODE (long_integer_type_node
))
797 return unsigned_p
? long_unsigned_type_node
: long_integer_type_node
;
799 if (mode
== TYPE_MODE (long_long_integer_type_node
))
800 return unsigned_p
? long_long_unsigned_type_node
: long_long_integer_type_node
;
803 return unsigned_p
? unsigned_intQI_type_node
: intQI_type_node
;
806 return unsigned_p
? unsigned_intHI_type_node
: intHI_type_node
;
809 return unsigned_p
? unsigned_intSI_type_node
: intSI_type_node
;
812 return unsigned_p
? unsigned_intDI_type_node
: intDI_type_node
;
814 #if HOST_BITS_PER_WIDE_INT >= 64
815 if (mode
== TYPE_MODE (intTI_type_node
))
816 return unsigned_p
? unsigned_intTI_type_node
: intTI_type_node
;
819 if (mode
== TYPE_MODE (float_type_node
))
820 return float_type_node
;
822 if (mode
== TYPE_MODE (double_type_node
))
823 return double_type_node
;
825 if (mode
== TYPE_MODE (long_double_type_node
))
826 return long_double_type_node
;
828 if (mode
== TYPE_MODE (void_type_node
))
829 return void_type_node
;
831 if (mode
== TYPE_MODE (build_pointer_type (char_type_node
)))
833 ? make_unsigned_type (GET_MODE_PRECISION (mode
))
834 : make_signed_type (GET_MODE_PRECISION (mode
)));
836 if (mode
== TYPE_MODE (build_pointer_type (integer_type_node
)))
838 ? make_unsigned_type (GET_MODE_PRECISION (mode
))
839 : make_signed_type (GET_MODE_PRECISION (mode
)));
841 if (COMPLEX_MODE_P (mode
))
843 enum machine_mode inner_mode
;
846 if (mode
== TYPE_MODE (complex_float_type_node
))
847 return complex_float_type_node
;
848 if (mode
== TYPE_MODE (complex_double_type_node
))
849 return complex_double_type_node
;
850 if (mode
== TYPE_MODE (complex_long_double_type_node
))
851 return complex_long_double_type_node
;
853 if (mode
== TYPE_MODE (complex_integer_type_node
) && !unsigned_p
)
854 return complex_integer_type_node
;
856 inner_mode
= GET_MODE_INNER (mode
);
857 inner_type
= lto_type_for_mode (inner_mode
, unsigned_p
);
858 if (inner_type
!= NULL_TREE
)
859 return build_complex_type (inner_type
);
861 else if (VECTOR_MODE_P (mode
))
863 enum machine_mode inner_mode
= GET_MODE_INNER (mode
);
864 tree inner_type
= lto_type_for_mode (inner_mode
, unsigned_p
);
865 if (inner_type
!= NULL_TREE
)
866 return build_vector_type_for_mode (inner_type
, mode
);
869 if (mode
== TYPE_MODE (dfloat32_type_node
))
870 return dfloat32_type_node
;
871 if (mode
== TYPE_MODE (dfloat64_type_node
))
872 return dfloat64_type_node
;
873 if (mode
== TYPE_MODE (dfloat128_type_node
))
874 return dfloat128_type_node
;
876 if (ALL_SCALAR_FIXED_POINT_MODE_P (mode
))
878 if (mode
== TYPE_MODE (short_fract_type_node
))
879 return unsigned_p
? sat_short_fract_type_node
: short_fract_type_node
;
880 if (mode
== TYPE_MODE (fract_type_node
))
881 return unsigned_p
? sat_fract_type_node
: fract_type_node
;
882 if (mode
== TYPE_MODE (long_fract_type_node
))
883 return unsigned_p
? sat_long_fract_type_node
: long_fract_type_node
;
884 if (mode
== TYPE_MODE (long_long_fract_type_node
))
885 return unsigned_p
? sat_long_long_fract_type_node
886 : long_long_fract_type_node
;
888 if (mode
== TYPE_MODE (unsigned_short_fract_type_node
))
889 return unsigned_p
? sat_unsigned_short_fract_type_node
890 : unsigned_short_fract_type_node
;
891 if (mode
== TYPE_MODE (unsigned_fract_type_node
))
892 return unsigned_p
? sat_unsigned_fract_type_node
893 : unsigned_fract_type_node
;
894 if (mode
== TYPE_MODE (unsigned_long_fract_type_node
))
895 return unsigned_p
? sat_unsigned_long_fract_type_node
896 : unsigned_long_fract_type_node
;
897 if (mode
== TYPE_MODE (unsigned_long_long_fract_type_node
))
898 return unsigned_p
? sat_unsigned_long_long_fract_type_node
899 : unsigned_long_long_fract_type_node
;
901 if (mode
== TYPE_MODE (short_accum_type_node
))
902 return unsigned_p
? sat_short_accum_type_node
: short_accum_type_node
;
903 if (mode
== TYPE_MODE (accum_type_node
))
904 return unsigned_p
? sat_accum_type_node
: accum_type_node
;
905 if (mode
== TYPE_MODE (long_accum_type_node
))
906 return unsigned_p
? sat_long_accum_type_node
: long_accum_type_node
;
907 if (mode
== TYPE_MODE (long_long_accum_type_node
))
908 return unsigned_p
? sat_long_long_accum_type_node
909 : long_long_accum_type_node
;
911 if (mode
== TYPE_MODE (unsigned_short_accum_type_node
))
912 return unsigned_p
? sat_unsigned_short_accum_type_node
913 : unsigned_short_accum_type_node
;
914 if (mode
== TYPE_MODE (unsigned_accum_type_node
))
915 return unsigned_p
? sat_unsigned_accum_type_node
916 : unsigned_accum_type_node
;
917 if (mode
== TYPE_MODE (unsigned_long_accum_type_node
))
918 return unsigned_p
? sat_unsigned_long_accum_type_node
919 : unsigned_long_accum_type_node
;
920 if (mode
== TYPE_MODE (unsigned_long_long_accum_type_node
))
921 return unsigned_p
? sat_unsigned_long_long_accum_type_node
922 : unsigned_long_long_accum_type_node
;
925 return unsigned_p
? sat_qq_type_node
: qq_type_node
;
927 return unsigned_p
? sat_hq_type_node
: hq_type_node
;
929 return unsigned_p
? sat_sq_type_node
: sq_type_node
;
931 return unsigned_p
? sat_dq_type_node
: dq_type_node
;
933 return unsigned_p
? sat_tq_type_node
: tq_type_node
;
936 return unsigned_p
? sat_uqq_type_node
: uqq_type_node
;
938 return unsigned_p
? sat_uhq_type_node
: uhq_type_node
;
940 return unsigned_p
? sat_usq_type_node
: usq_type_node
;
942 return unsigned_p
? sat_udq_type_node
: udq_type_node
;
944 return unsigned_p
? sat_utq_type_node
: utq_type_node
;
947 return unsigned_p
? sat_ha_type_node
: ha_type_node
;
949 return unsigned_p
? sat_sa_type_node
: sa_type_node
;
951 return unsigned_p
? sat_da_type_node
: da_type_node
;
953 return unsigned_p
? sat_ta_type_node
: ta_type_node
;
956 return unsigned_p
? sat_uha_type_node
: uha_type_node
;
958 return unsigned_p
? sat_usa_type_node
: usa_type_node
;
960 return unsigned_p
? sat_uda_type_node
: uda_type_node
;
962 return unsigned_p
? sat_uta_type_node
: uta_type_node
;
965 for (t
= registered_builtin_types
; t
; t
= TREE_CHAIN (t
))
966 if (TYPE_MODE (TREE_VALUE (t
)) == mode
)
967 return TREE_VALUE (t
);
972 /* Return true if we are in the global binding level. */
975 lto_global_bindings_p (void)
981 lto_set_decl_assembler_name (tree decl
)
983 /* This is almost the same as lhd_set_decl_assembler_name, except that
984 we need to uniquify file-scope names, even if they are not
985 TREE_PUBLIC, to avoid conflicts between individual files. */
988 if (TREE_PUBLIC (decl
))
989 id
= targetm
.mangle_decl_assembler_name (decl
, DECL_NAME (decl
));
992 const char *name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
995 ASM_FORMAT_PRIVATE_NAME (label
, name
, DECL_UID (decl
));
996 id
= get_identifier (label
);
999 SET_DECL_ASSEMBLER_NAME (decl
, id
);
1003 lto_pushdecl (tree t ATTRIBUTE_UNUSED
)
1005 /* Do nothing, since we get all information from DWARF and LTO
1013 /* We have our own write_globals langhook, hence the getdecls
1014 langhook shouldn't be used, except by dbxout.c, so we can't
1020 lto_write_globals (void)
1022 tree
*vec
= VEC_address (tree
, lto_global_var_decls
);
1023 int len
= VEC_length (tree
, lto_global_var_decls
);
1024 wrapup_global_declarations (vec
, len
);
1025 emit_debug_global_declarations (vec
, len
);
1026 VEC_free (tree
, gc
, lto_global_var_decls
);
1030 lto_builtin_function (tree decl
)
1036 lto_register_builtin_type (tree type
, const char *name
)
1040 decl
= build_decl (UNKNOWN_LOCATION
, TYPE_DECL
, get_identifier (name
), type
);
1041 DECL_ARTIFICIAL (decl
) = 1;
1042 if (!TYPE_NAME (type
))
1043 TYPE_NAME (type
) = decl
;
1045 registered_builtin_types
= tree_cons (0, type
, registered_builtin_types
);
1048 /* Build nodes that would have be created by the C front-end; necessary
1049 for including builtin-types.def and ultimately builtins.def. */
1052 lto_build_c_type_nodes (void)
1054 gcc_assert (void_type_node
);
1056 void_list_node
= build_tree_list (NULL_TREE
, void_type_node
);
1057 string_type_node
= build_pointer_type (char_type_node
);
1058 const_string_type_node
1059 = build_pointer_type (build_qualified_type (char_type_node
, TYPE_QUAL_CONST
));
1061 if (strcmp (SIZE_TYPE
, "unsigned int") == 0)
1063 intmax_type_node
= integer_type_node
;
1064 uintmax_type_node
= unsigned_type_node
;
1065 signed_size_type_node
= integer_type_node
;
1067 else if (strcmp (SIZE_TYPE
, "long unsigned int") == 0)
1069 intmax_type_node
= long_integer_type_node
;
1070 uintmax_type_node
= long_unsigned_type_node
;
1071 signed_size_type_node
= long_integer_type_node
;
1073 else if (strcmp (SIZE_TYPE
, "long long unsigned int") == 0)
1075 intmax_type_node
= long_long_integer_type_node
;
1076 uintmax_type_node
= long_long_unsigned_type_node
;
1077 signed_size_type_node
= long_long_integer_type_node
;
1082 wint_type_node
= unsigned_type_node
;
1083 pid_type_node
= integer_type_node
;
1086 /* Re-compute TYPE_CANONICAL for NODE and related types. */
1089 lto_register_canonical_types (tree node
)
1095 TYPE_CANONICAL (node
) = NULL_TREE
;
1096 TYPE_CANONICAL (node
) = gimple_register_canonical_type (node
);
1098 if (POINTER_TYPE_P (node
)
1099 || TREE_CODE (node
) == COMPLEX_TYPE
1100 || TREE_CODE (node
) == ARRAY_TYPE
)
1101 lto_register_canonical_types (TREE_TYPE (node
));
1104 /* Perform LTO-specific initialization. */
1111 /* We need to generate LTO if running in WPA mode. */
1112 flag_generate_lto
= flag_wpa
;
1114 /* Initialize libcpp line maps for gcc_assert to work. */
1115 linemap_add (line_table
, LC_ENTER
, 0, NULL
, 0);
1117 /* Create the basic integer types. */
1118 build_common_tree_nodes (flag_signed_char
, /*short_double=*/false);
1120 /* The global tree for the main identifier is filled in by
1121 language-specific front-end initialization that is not run in the
1122 LTO back-end. It appears that all languages that perform such
1123 initialization currently do so in the same way, so we do it here. */
1124 if (main_identifier_node
== NULL_TREE
)
1125 main_identifier_node
= get_identifier ("main");
1127 /* In the C++ front-end, fileptr_type_node is defined as a variant
1128 copy of of ptr_type_node, rather than ptr_node itself. The
1129 distinction should only be relevant to the front-end, so we
1130 always use the C definition here in lto1. */
1131 gcc_assert (fileptr_type_node
== ptr_type_node
);
1132 gcc_assert (TYPE_MAIN_VARIANT (fileptr_type_node
) == ptr_type_node
);
1134 ptrdiff_type_node
= integer_type_node
;
1136 lto_build_c_type_nodes ();
1137 gcc_assert (va_list_type_node
);
1139 if (TREE_CODE (va_list_type_node
) == ARRAY_TYPE
)
1141 tree x
= build_pointer_type (TREE_TYPE (va_list_type_node
));
1142 lto_define_builtins (x
, x
);
1146 lto_define_builtins (va_list_type_node
,
1147 build_reference_type (va_list_type_node
));
1150 targetm
.init_builtins ();
1151 build_common_builtin_nodes ();
1153 /* Assign names to the builtin types, otherwise they'll end up
1154 as __unknown__ in debug info.
1155 ??? We simply need to stop pre-seeding the streamer cache.
1156 Below is modeled after from c-common.c:c_common_nodes_and_builtins */
1157 #define NAME_TYPE(t,n) \
1159 TYPE_NAME (t) = build_decl (UNKNOWN_LOCATION, TYPE_DECL, \
1160 get_identifier (n), t)
1161 NAME_TYPE (integer_type_node
, "int");
1162 NAME_TYPE (char_type_node
, "char");
1163 NAME_TYPE (long_integer_type_node
, "long int");
1164 NAME_TYPE (unsigned_type_node
, "unsigned int");
1165 NAME_TYPE (long_unsigned_type_node
, "long unsigned int");
1166 NAME_TYPE (long_long_integer_type_node
, "long long int");
1167 NAME_TYPE (long_long_unsigned_type_node
, "long long unsigned int");
1168 NAME_TYPE (short_integer_type_node
, "short int");
1169 NAME_TYPE (short_unsigned_type_node
, "short unsigned int");
1170 if (signed_char_type_node
!= char_type_node
)
1171 NAME_TYPE (signed_char_type_node
, "signed char");
1172 if (unsigned_char_type_node
!= char_type_node
)
1173 NAME_TYPE (unsigned_char_type_node
, "unsigned char");
1174 NAME_TYPE (float_type_node
, "float");
1175 NAME_TYPE (double_type_node
, "double");
1176 NAME_TYPE (long_double_type_node
, "long double");
1177 NAME_TYPE (void_type_node
, "void");
1178 NAME_TYPE (boolean_type_node
, "bool");
1181 /* Register the common node types with the canonical type machinery so
1182 we properly share alias-sets across languages and TUs. Do not
1183 expose the common nodes as type merge target - those that should be
1184 are already exposed so by pre-loading the LTO streamer caches. */
1185 for (i
= 0; i
< itk_none
; ++i
)
1186 lto_register_canonical_types (integer_types
[i
]);
1187 /* The sizetypes are not used to access data so we do not need to
1188 do anything about them. */
1189 for (i
= 0; i
< TI_MAX
; ++i
)
1190 lto_register_canonical_types (global_trees
[i
]);
1192 /* Initialize LTO-specific data structures. */
1193 lto_global_var_decls
= VEC_alloc (tree
, gc
, 256);
1199 /* Initialize tree structures required by the LTO front end. */
1201 static void lto_init_ts (void)
1203 tree_contains_struct
[NAMESPACE_DECL
][TS_DECL_MINIMAL
] = 1;
1206 #undef LANG_HOOKS_NAME
1207 #define LANG_HOOKS_NAME "GNU GIMPLE"
1208 #undef LANG_HOOKS_OPTION_LANG_MASK
1209 #define LANG_HOOKS_OPTION_LANG_MASK lto_option_lang_mask
1210 #undef LANG_HOOKS_COMPLAIN_WRONG_LANG_P
1211 #define LANG_HOOKS_COMPLAIN_WRONG_LANG_P lto_complain_wrong_lang_p
1212 #undef LANG_HOOKS_INIT_OPTIONS_STRUCT
1213 #define LANG_HOOKS_INIT_OPTIONS_STRUCT lto_init_options_struct
1214 #undef LANG_HOOKS_HANDLE_OPTION
1215 #define LANG_HOOKS_HANDLE_OPTION lto_handle_option
1216 #undef LANG_HOOKS_POST_OPTIONS
1217 #define LANG_HOOKS_POST_OPTIONS lto_post_options
1218 #undef LANG_HOOKS_GET_ALIAS_SET
1219 #define LANG_HOOKS_GET_ALIAS_SET gimple_get_alias_set
1220 #undef LANG_HOOKS_TYPE_FOR_MODE
1221 #define LANG_HOOKS_TYPE_FOR_MODE lto_type_for_mode
1222 #undef LANG_HOOKS_TYPE_FOR_SIZE
1223 #define LANG_HOOKS_TYPE_FOR_SIZE lto_type_for_size
1224 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
1225 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lto_set_decl_assembler_name
1226 #undef LANG_HOOKS_GLOBAL_BINDINGS_P
1227 #define LANG_HOOKS_GLOBAL_BINDINGS_P lto_global_bindings_p
1228 #undef LANG_HOOKS_PUSHDECL
1229 #define LANG_HOOKS_PUSHDECL lto_pushdecl
1230 #undef LANG_HOOKS_GETDECLS
1231 #define LANG_HOOKS_GETDECLS lto_getdecls
1232 #undef LANG_HOOKS_WRITE_GLOBALS
1233 #define LANG_HOOKS_WRITE_GLOBALS lto_write_globals
1234 #undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
1235 #define LANG_HOOKS_REGISTER_BUILTIN_TYPE lto_register_builtin_type
1236 #undef LANG_HOOKS_BUILTIN_FUNCTION
1237 #define LANG_HOOKS_BUILTIN_FUNCTION lto_builtin_function
1238 #undef LANG_HOOKS_INIT
1239 #define LANG_HOOKS_INIT lto_init
1240 #undef LANG_HOOKS_PARSE_FILE
1241 #define LANG_HOOKS_PARSE_FILE lto_main
1242 #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
1243 #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION tree_rest_of_compilation
1244 #undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
1245 #define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
1246 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
1247 #define LANG_HOOKS_TYPES_COMPATIBLE_P NULL
1248 #undef LANG_HOOKS_EH_PERSONALITY
1249 #define LANG_HOOKS_EH_PERSONALITY lto_eh_personality
1251 /* Attribute hooks. */
1252 #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
1253 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE lto_attribute_table
1254 #undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
1255 #define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE lto_format_attribute_table
1257 #undef LANG_HOOKS_BEGIN_SECTION
1258 #define LANG_HOOKS_BEGIN_SECTION lto_obj_begin_section
1259 #undef LANG_HOOKS_APPEND_DATA
1260 #define LANG_HOOKS_APPEND_DATA lto_obj_append_data
1261 #undef LANG_HOOKS_END_SECTION
1262 #define LANG_HOOKS_END_SECTION lto_obj_end_section
1264 #undef LANG_HOOKS_INIT_TS
1265 #define LANG_HOOKS_INIT_TS lto_init_ts
1267 struct lang_hooks lang_hooks
= LANG_HOOKS_INITIALIZER
;
1269 /* Language hooks that are not part of lang_hooks. */
1272 convert (tree type ATTRIBUTE_UNUSED
, tree expr ATTRIBUTE_UNUSED
)
1277 /* Tree walking support. */
1279 static enum lto_tree_node_structure_enum
1280 lto_tree_node_structure (union lang_tree_node
*t ATTRIBUTE_UNUSED
)
1282 return TS_LTO_GENERIC
;
1286 #include "gtype-lto.h"
1287 #include "gt-lto-lto-lang.h"