1 /* Language-dependent hooks for LTO.
2 Copyright (C) 2009-2013 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"
40 static tree
lto_type_for_size (unsigned, int);
42 static tree
handle_noreturn_attribute (tree
*, tree
, tree
, int, bool *);
43 static tree
handle_leaf_attribute (tree
*, tree
, tree
, int, bool *);
44 static tree
handle_const_attribute (tree
*, tree
, tree
, int, bool *);
45 static tree
handle_malloc_attribute (tree
*, tree
, tree
, int, bool *);
46 static tree
handle_pure_attribute (tree
*, tree
, tree
, int, bool *);
47 static tree
handle_novops_attribute (tree
*, tree
, tree
, int, bool *);
48 static tree
handle_nonnull_attribute (tree
*, tree
, tree
, int, bool *);
49 static tree
handle_nothrow_attribute (tree
*, tree
, tree
, int, bool *);
50 static tree
handle_sentinel_attribute (tree
*, tree
, tree
, int, bool *);
51 static tree
handle_type_generic_attribute (tree
*, tree
, tree
, int, bool *);
52 static tree
handle_transaction_pure_attribute (tree
*, tree
, tree
, int, bool *);
53 static tree
handle_returns_twice_attribute (tree
*, tree
, tree
, int, bool *);
54 static tree
ignore_attribute (tree
*, tree
, tree
, int, bool *);
56 static tree
handle_format_attribute (tree
*, tree
, tree
, int, bool *);
57 static tree
handle_fnspec_attribute (tree
*, tree
, tree
, int, bool *);
58 static tree
handle_format_arg_attribute (tree
*, tree
, tree
, int, bool *);
60 /* Table of machine-independent attributes supported in GIMPLE. */
61 const struct attribute_spec lto_attribute_table
[] =
63 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
65 { "noreturn", 0, 0, true, false, false,
66 handle_noreturn_attribute
, false },
67 { "leaf", 0, 0, true, false, false,
68 handle_leaf_attribute
, false },
69 /* The same comments as for noreturn attributes apply to const ones. */
70 { "const", 0, 0, true, false, false,
71 handle_const_attribute
, false },
72 { "malloc", 0, 0, true, false, false,
73 handle_malloc_attribute
, false },
74 { "pure", 0, 0, true, false, false,
75 handle_pure_attribute
, false },
76 { "no vops", 0, 0, true, false, false,
77 handle_novops_attribute
, false },
78 { "nonnull", 0, -1, false, true, true,
79 handle_nonnull_attribute
, false },
80 { "nothrow", 0, 0, true, false, false,
81 handle_nothrow_attribute
, false },
82 { "returns_twice", 0, 0, true, false, false,
83 handle_returns_twice_attribute
, false },
84 { "sentinel", 0, 1, false, true, true,
85 handle_sentinel_attribute
, false },
86 { "type generic", 0, 0, false, true, true,
87 handle_type_generic_attribute
, false },
88 { "fn spec", 1, 1, false, true, true,
89 handle_fnspec_attribute
, false },
90 { "transaction_pure", 0, 0, false, true, true,
91 handle_transaction_pure_attribute
, false },
92 /* For internal use only. The leading '*' both prevents its usage in
93 source code and signals that it may be overridden by machine tables. */
94 { "*tm regparm", 0, 0, false, true, true,
95 ignore_attribute
, false },
96 { NULL
, 0, 0, false, false, false, NULL
, false }
99 /* Give the specifications for the format attributes, used by C and all
102 const struct attribute_spec lto_format_attribute_table
[] =
104 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
105 affects_type_identity } */
106 { "format", 3, 3, false, true, true,
107 handle_format_attribute
, false },
108 { "format_arg", 1, 1, false, true, true,
109 handle_format_arg_attribute
, false },
110 { NULL
, 0, 0, false, false, false, NULL
, false }
113 enum built_in_attribute
115 #define DEF_ATTR_NULL_TREE(ENUM) ENUM,
116 #define DEF_ATTR_INT(ENUM, VALUE) ENUM,
117 #define DEF_ATTR_STRING(ENUM, VALUE) ENUM,
118 #define DEF_ATTR_IDENT(ENUM, STRING) ENUM,
119 #define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) ENUM,
120 #include "builtin-attrs.def"
121 #undef DEF_ATTR_NULL_TREE
123 #undef DEF_ATTR_STRING
124 #undef DEF_ATTR_IDENT
125 #undef DEF_ATTR_TREE_LIST
129 static GTY(()) tree built_in_attributes
[(int) ATTR_LAST
];
133 enum lto_builtin_type
135 #define DEF_PRIMITIVE_TYPE(NAME, VALUE) NAME,
136 #define DEF_FUNCTION_TYPE_0(NAME, RETURN) NAME,
137 #define DEF_FUNCTION_TYPE_1(NAME, RETURN, ARG1) NAME,
138 #define DEF_FUNCTION_TYPE_2(NAME, RETURN, ARG1, ARG2) NAME,
139 #define DEF_FUNCTION_TYPE_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
140 #define DEF_FUNCTION_TYPE_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
141 #define DEF_FUNCTION_TYPE_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) NAME,
142 #define DEF_FUNCTION_TYPE_6(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) NAME,
143 #define DEF_FUNCTION_TYPE_7(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) NAME,
144 #define DEF_FUNCTION_TYPE_8(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) NAME,
145 #define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
146 #define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
147 #define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
148 #define DEF_FUNCTION_TYPE_VAR_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
149 #define DEF_FUNCTION_TYPE_VAR_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
150 #define DEF_FUNCTION_TYPE_VAR_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG6) \
152 #define DEF_POINTER_TYPE(NAME, TYPE) NAME,
153 #include "builtin-types.def"
154 #undef DEF_PRIMITIVE_TYPE
155 #undef DEF_FUNCTION_TYPE_0
156 #undef DEF_FUNCTION_TYPE_1
157 #undef DEF_FUNCTION_TYPE_2
158 #undef DEF_FUNCTION_TYPE_3
159 #undef DEF_FUNCTION_TYPE_4
160 #undef DEF_FUNCTION_TYPE_5
161 #undef DEF_FUNCTION_TYPE_6
162 #undef DEF_FUNCTION_TYPE_7
163 #undef DEF_FUNCTION_TYPE_8
164 #undef DEF_FUNCTION_TYPE_VAR_0
165 #undef DEF_FUNCTION_TYPE_VAR_1
166 #undef DEF_FUNCTION_TYPE_VAR_2
167 #undef DEF_FUNCTION_TYPE_VAR_3
168 #undef DEF_FUNCTION_TYPE_VAR_4
169 #undef DEF_FUNCTION_TYPE_VAR_5
170 #undef DEF_POINTER_TYPE
174 typedef enum lto_builtin_type builtin_type
;
176 static GTY(()) tree builtin_types
[(int) BT_LAST
+ 1];
178 static GTY(()) tree string_type_node
;
179 static GTY(()) tree const_string_type_node
;
180 static GTY(()) tree wint_type_node
;
181 static GTY(()) tree intmax_type_node
;
182 static GTY(()) tree uintmax_type_node
;
183 static GTY(()) tree signed_size_type_node
;
185 /* Flags needed to process builtins.def. */
189 /* Attribute handlers. */
191 /* Handle a "noreturn" attribute; arguments as in
192 struct attribute_spec.handler. */
195 handle_noreturn_attribute (tree
*node
, tree
ARG_UNUSED (name
),
196 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
197 bool * ARG_UNUSED (no_add_attrs
))
199 tree type
= TREE_TYPE (*node
);
201 if (TREE_CODE (*node
) == FUNCTION_DECL
)
202 TREE_THIS_VOLATILE (*node
) = 1;
203 else if (TREE_CODE (type
) == POINTER_TYPE
204 && TREE_CODE (TREE_TYPE (type
)) == FUNCTION_TYPE
)
207 (build_type_variant (TREE_TYPE (type
),
208 TYPE_READONLY (TREE_TYPE (type
)), 1));
215 /* Handle a "leaf" attribute; arguments as in
216 struct attribute_spec.handler. */
219 handle_leaf_attribute (tree
*node
, tree name
,
220 tree
ARG_UNUSED (args
),
221 int ARG_UNUSED (flags
), bool *no_add_attrs
)
223 if (TREE_CODE (*node
) != FUNCTION_DECL
)
225 warning (OPT_Wattributes
, "%qE attribute ignored", name
);
226 *no_add_attrs
= true;
228 if (!TREE_PUBLIC (*node
))
230 warning (OPT_Wattributes
, "%qE attribute has no effect on unit local functions", name
);
231 *no_add_attrs
= true;
237 /* Handle a "const" attribute; arguments as in
238 struct attribute_spec.handler. */
241 handle_const_attribute (tree
*node
, tree
ARG_UNUSED (name
),
242 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
243 bool * ARG_UNUSED (no_add_attrs
))
245 tree type
= TREE_TYPE (*node
);
247 /* See FIXME comment on noreturn in c_common_attribute_table. */
248 if (TREE_CODE (*node
) == FUNCTION_DECL
)
249 TREE_READONLY (*node
) = 1;
250 else if (TREE_CODE (type
) == POINTER_TYPE
251 && TREE_CODE (TREE_TYPE (type
)) == FUNCTION_TYPE
)
254 (build_type_variant (TREE_TYPE (type
), 1,
255 TREE_THIS_VOLATILE (TREE_TYPE (type
))));
263 /* Handle a "malloc" attribute; arguments as in
264 struct attribute_spec.handler. */
267 handle_malloc_attribute (tree
*node
, tree
ARG_UNUSED (name
),
268 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
269 bool * ARG_UNUSED (no_add_attrs
))
271 if (TREE_CODE (*node
) == FUNCTION_DECL
272 && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node
))))
273 DECL_IS_MALLOC (*node
) = 1;
281 /* Handle a "pure" attribute; arguments as in
282 struct attribute_spec.handler. */
285 handle_pure_attribute (tree
*node
, tree
ARG_UNUSED (name
),
286 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
287 bool * ARG_UNUSED (no_add_attrs
))
289 if (TREE_CODE (*node
) == FUNCTION_DECL
)
290 DECL_PURE_P (*node
) = 1;
298 /* Handle a "no vops" attribute; arguments as in
299 struct attribute_spec.handler. */
302 handle_novops_attribute (tree
*node
, tree
ARG_UNUSED (name
),
303 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
304 bool *ARG_UNUSED (no_add_attrs
))
306 gcc_assert (TREE_CODE (*node
) == FUNCTION_DECL
);
307 DECL_IS_NOVOPS (*node
) = 1;
312 /* Helper for nonnull attribute handling; fetch the operand number
313 from the attribute argument list. */
316 get_nonnull_operand (tree arg_num_expr
, unsigned HOST_WIDE_INT
*valp
)
318 /* Verify the arg number is a constant. */
319 if (!cst_fits_uhwi_p (arg_num_expr
))
322 *valp
= tree_to_hwi (arg_num_expr
);
326 /* Handle the "nonnull" attribute. */
329 handle_nonnull_attribute (tree
*node
, tree
ARG_UNUSED (name
),
330 tree args
, int ARG_UNUSED (flags
),
331 bool * ARG_UNUSED (no_add_attrs
))
335 /* If no arguments are specified, all pointer arguments should be
336 non-null. Verify a full prototype is given so that the arguments
337 will have the correct types when we actually check them later. */
340 gcc_assert (prototype_p (type
));
344 /* Argument list specified. Verify that each argument number references
345 a pointer argument. */
346 for (; args
; args
= TREE_CHAIN (args
))
349 unsigned HOST_WIDE_INT arg_num
= 0, ck_num
;
351 if (!get_nonnull_operand (TREE_VALUE (args
), &arg_num
))
354 argument
= TYPE_ARG_TYPES (type
);
357 for (ck_num
= 1; ; ck_num
++)
359 if (!argument
|| ck_num
== arg_num
)
361 argument
= TREE_CHAIN (argument
);
365 && TREE_CODE (TREE_VALUE (argument
)) == POINTER_TYPE
);
373 /* Handle a "nothrow" attribute; arguments as in
374 struct attribute_spec.handler. */
377 handle_nothrow_attribute (tree
*node
, tree
ARG_UNUSED (name
),
378 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
379 bool * ARG_UNUSED (no_add_attrs
))
381 if (TREE_CODE (*node
) == FUNCTION_DECL
)
382 TREE_NOTHROW (*node
) = 1;
390 /* Handle a "sentinel" attribute. */
393 handle_sentinel_attribute (tree
*node
, tree
ARG_UNUSED (name
), tree args
,
394 int ARG_UNUSED (flags
),
395 bool * ARG_UNUSED (no_add_attrs
))
397 gcc_assert (stdarg_p (*node
));
401 tree position
= TREE_VALUE (args
);
402 gcc_assert (TREE_CODE (position
) == INTEGER_CST
);
403 if (tree_int_cst_lt (position
, integer_zero_node
))
410 /* Handle a "type_generic" attribute. */
413 handle_type_generic_attribute (tree
*node
, tree
ARG_UNUSED (name
),
414 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
415 bool * ARG_UNUSED (no_add_attrs
))
417 /* Ensure we have a function type. */
418 gcc_assert (TREE_CODE (*node
) == FUNCTION_TYPE
);
420 /* Ensure we have a variadic function. */
421 gcc_assert (!prototype_p (*node
) || stdarg_p (*node
));
426 /* Handle a "transaction_pure" attribute. */
429 handle_transaction_pure_attribute (tree
*node
, tree
ARG_UNUSED (name
),
430 tree
ARG_UNUSED (args
),
431 int ARG_UNUSED (flags
),
432 bool * ARG_UNUSED (no_add_attrs
))
434 /* Ensure we have a function type. */
435 gcc_assert (TREE_CODE (*node
) == FUNCTION_TYPE
);
440 /* Handle a "returns_twice" attribute. */
443 handle_returns_twice_attribute (tree
*node
, tree
ARG_UNUSED (name
),
444 tree
ARG_UNUSED (args
),
445 int ARG_UNUSED (flags
),
446 bool * ARG_UNUSED (no_add_attrs
))
448 gcc_assert (TREE_CODE (*node
) == FUNCTION_DECL
);
450 DECL_IS_RETURNS_TWICE (*node
) = 1;
455 /* Ignore the given attribute. Used when this attribute may be usefully
456 overridden by the target, but is not used generically. */
459 ignore_attribute (tree
* ARG_UNUSED (node
), tree
ARG_UNUSED (name
),
460 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
463 *no_add_attrs
= true;
467 /* Handle a "format" attribute; arguments as in
468 struct attribute_spec.handler. */
471 handle_format_attribute (tree
* ARG_UNUSED (node
), tree
ARG_UNUSED (name
),
472 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
475 *no_add_attrs
= true;
480 /* Handle a "format_arg" attribute; arguments as in
481 struct attribute_spec.handler. */
484 handle_format_arg_attribute (tree
* ARG_UNUSED (node
), tree
ARG_UNUSED (name
),
485 tree
ARG_UNUSED (args
), int ARG_UNUSED (flags
),
488 *no_add_attrs
= true;
493 /* Handle a "fn spec" attribute; arguments as in
494 struct attribute_spec.handler. */
497 handle_fnspec_attribute (tree
*node ATTRIBUTE_UNUSED
, tree
ARG_UNUSED (name
),
498 tree args
, int ARG_UNUSED (flags
),
499 bool *no_add_attrs ATTRIBUTE_UNUSED
)
502 && TREE_CODE (TREE_VALUE (args
)) == STRING_CST
503 && !TREE_CHAIN (args
));
507 /* Cribbed from c-common.c. */
510 def_fn_type (builtin_type def
, builtin_type ret
, bool var
, int n
, ...)
513 tree
*args
= XALLOCAVEC (tree
, n
);
518 for (i
= 0; i
< n
; ++i
)
520 builtin_type a
= (builtin_type
) va_arg (list
, int);
521 t
= builtin_types
[a
];
522 if (t
== error_mark_node
)
528 t
= builtin_types
[ret
];
529 if (t
== error_mark_node
)
532 t
= build_varargs_function_type_array (t
, n
, args
);
534 t
= build_function_type_array (t
, n
, args
);
537 builtin_types
[def
] = t
;
541 /* Used to help initialize the builtin-types.def table. When a type of
542 the correct size doesn't exist, use error_mark_node instead of NULL.
543 The later results in segfaults even when a decl using the type doesn't
547 builtin_type_for_size (int size
, bool unsignedp
)
549 tree type
= lto_type_for_size (size
, unsignedp
);
550 return type
? type
: error_mark_node
;
553 /* Support for DEF_BUILTIN. */
556 def_builtin_1 (enum built_in_function fncode
, const char *name
,
557 enum built_in_class fnclass
, tree fntype
, tree libtype
,
558 bool both_p
, bool fallback_p
, bool nonansi_p
,
559 tree fnattrs
, bool implicit_p
)
564 if (fntype
== error_mark_node
)
567 libname
= name
+ strlen ("__builtin_");
568 decl
= add_builtin_function (name
, fntype
, fncode
, fnclass
,
569 (fallback_p
? libname
: NULL
),
574 && !(nonansi_p
&& flag_no_nonansi_builtin
))
575 add_builtin_function (libname
, libtype
, fncode
, fnclass
,
578 set_builtin_decl (fncode
, decl
, implicit_p
);
582 /* Initialize the attribute table for all the supported builtins. */
585 lto_init_attributes (void)
587 /* Fill in the built_in_attributes array. */
588 #define DEF_ATTR_NULL_TREE(ENUM) \
589 built_in_attributes[(int) ENUM] = NULL_TREE;
590 #define DEF_ATTR_INT(ENUM, VALUE) \
591 built_in_attributes[(int) ENUM] = build_int_cst (NULL_TREE, VALUE);
592 #define DEF_ATTR_STRING(ENUM, VALUE) \
593 built_in_attributes[(int) ENUM] = build_string (strlen (VALUE), VALUE);
594 #define DEF_ATTR_IDENT(ENUM, STRING) \
595 built_in_attributes[(int) ENUM] = get_identifier (STRING);
596 #define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) \
597 built_in_attributes[(int) ENUM] \
598 = tree_cons (built_in_attributes[(int) PURPOSE], \
599 built_in_attributes[(int) VALUE], \
600 built_in_attributes[(int) CHAIN]);
601 #include "builtin-attrs.def"
602 #undef DEF_ATTR_NULL_TREE
604 #undef DEF_ATTR_STRING
605 #undef DEF_ATTR_IDENT
606 #undef DEF_ATTR_TREE_LIST
609 /* Create builtin types and functions. VA_LIST_REF_TYPE_NODE and
610 VA_LIST_ARG_TYPE_NODE are used in builtin-types.def. */
613 lto_define_builtins (tree va_list_ref_type_node ATTRIBUTE_UNUSED
,
614 tree va_list_arg_type_node ATTRIBUTE_UNUSED
)
616 #define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
617 builtin_types[ENUM] = VALUE;
618 #define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
619 def_fn_type (ENUM, RETURN, 0, 0);
620 #define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \
621 def_fn_type (ENUM, RETURN, 0, 1, ARG1);
622 #define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
623 def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2);
624 #define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
625 def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3);
626 #define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
627 def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4);
628 #define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
629 def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
630 #define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
632 def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
633 #define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
635 def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
636 #define DEF_FUNCTION_TYPE_8(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
638 def_fn_type (ENUM, RETURN, 0, 8, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
640 #define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
641 def_fn_type (ENUM, RETURN, 1, 0);
642 #define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
643 def_fn_type (ENUM, RETURN, 1, 1, ARG1);
644 #define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
645 def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2);
646 #define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
647 def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3);
648 #define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
649 def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4);
650 #define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
651 def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
652 #define DEF_POINTER_TYPE(ENUM, TYPE) \
653 builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]);
655 #include "builtin-types.def"
657 #undef DEF_PRIMITIVE_TYPE
658 #undef DEF_FUNCTION_TYPE_1
659 #undef DEF_FUNCTION_TYPE_2
660 #undef DEF_FUNCTION_TYPE_3
661 #undef DEF_FUNCTION_TYPE_4
662 #undef DEF_FUNCTION_TYPE_5
663 #undef DEF_FUNCTION_TYPE_6
664 #undef DEF_FUNCTION_TYPE_VAR_0
665 #undef DEF_FUNCTION_TYPE_VAR_1
666 #undef DEF_FUNCTION_TYPE_VAR_2
667 #undef DEF_FUNCTION_TYPE_VAR_3
668 #undef DEF_FUNCTION_TYPE_VAR_4
669 #undef DEF_FUNCTION_TYPE_VAR_5
670 #undef DEF_POINTER_TYPE
671 builtin_types
[(int) BT_LAST
] = NULL_TREE
;
673 lto_init_attributes ();
675 #define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P,\
676 NONANSI_P, ATTRS, IMPLICIT, COND) \
678 def_builtin_1 (ENUM, NAME, CLASS, builtin_types[(int) TYPE], \
679 builtin_types[(int) LIBTYPE], BOTH_P, FALLBACK_P, \
680 NONANSI_P, built_in_attributes[(int) ATTRS], IMPLICIT);
681 #include "builtins.def"
685 static GTY(()) tree registered_builtin_types
;
687 /* Language hooks. */
690 lto_option_lang_mask (void)
696 lto_complain_wrong_lang_p (const struct cl_option
*option ATTRIBUTE_UNUSED
)
698 /* The LTO front end inherits all the options from the first front
699 end that was used. However, not all the original front end
700 options make sense in LTO.
702 A real solution would be to filter this in collect2, but collect2
703 does not have access to all the option attributes to know what to
704 filter. So, in lto1 we silently accept inherited flags and do
710 lto_init_options_struct (struct gcc_options
*opts
)
712 /* By default, C99-like requirements for complex multiply and divide.
713 ??? Until the complex method is encoded in the IL this is the only
714 safe choice. This will pessimize Fortran code with LTO unless
715 people specify a complex method manually or use -ffast-math. */
716 opts
->x_flag_complex_method
= 2;
719 /* Handle command-line option SCODE. If the option takes an argument, it is
720 stored in ARG, which is otherwise NULL. VALUE holds either a numerical
721 argument or a binary value indicating whether the positive or negative form
722 of the option was supplied. */
724 const char *resolution_file_name
;
726 lto_handle_option (size_t scode
, const char *arg
,
727 int value ATTRIBUTE_UNUSED
, int kind ATTRIBUTE_UNUSED
,
728 location_t loc ATTRIBUTE_UNUSED
,
729 const struct cl_option_handlers
*handlers ATTRIBUTE_UNUSED
)
731 enum opt_code code
= (enum opt_code
) scode
;
736 case OPT_fresolution_
:
737 resolution_file_name
= arg
;
751 /* Perform post-option processing. Does additional initialization based on
752 command-line options. PFILENAME is the main input filename. Returns false
753 to enable subsequent back-end initialization. */
756 lto_post_options (const char **pfilename ATTRIBUTE_UNUSED
)
758 /* -fltrans and -fwpa are mutually exclusive. Check for that here. */
759 if (flag_wpa
&& flag_ltrans
)
760 error ("-fwpa and -fltrans are mutually exclusive");
764 flag_generate_lto
= 0;
766 /* During LTRANS, we are not looking at the whole program, only
767 a subset of the whole callgraph. */
768 flag_whole_program
= 0;
772 flag_generate_lto
= 1;
774 /* Excess precision other than "fast" requires front-end
776 flag_excess_precision_cmdline
= EXCESS_PRECISION_FAST
;
778 /* Initialize the compiler back end. */
782 /* Return an integer type with PRECISION bits of precision,
783 that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
786 lto_type_for_size (unsigned precision
, int unsignedp
)
788 if (precision
== TYPE_PRECISION (integer_type_node
))
789 return unsignedp
? unsigned_type_node
: integer_type_node
;
791 if (precision
== TYPE_PRECISION (signed_char_type_node
))
792 return unsignedp
? unsigned_char_type_node
: signed_char_type_node
;
794 if (precision
== TYPE_PRECISION (short_integer_type_node
))
795 return unsignedp
? short_unsigned_type_node
: short_integer_type_node
;
797 if (precision
== TYPE_PRECISION (long_integer_type_node
))
798 return unsignedp
? long_unsigned_type_node
: long_integer_type_node
;
800 if (precision
== TYPE_PRECISION (long_long_integer_type_node
))
802 ? long_long_unsigned_type_node
803 : long_long_integer_type_node
;
805 if (precision
<= TYPE_PRECISION (intQI_type_node
))
806 return unsignedp
? unsigned_intQI_type_node
: intQI_type_node
;
808 if (precision
<= TYPE_PRECISION (intHI_type_node
))
809 return unsignedp
? unsigned_intHI_type_node
: intHI_type_node
;
811 if (precision
<= TYPE_PRECISION (intSI_type_node
))
812 return unsignedp
? unsigned_intSI_type_node
: intSI_type_node
;
814 if (precision
<= TYPE_PRECISION (intDI_type_node
))
815 return unsignedp
? unsigned_intDI_type_node
: intDI_type_node
;
817 if (precision
<= TYPE_PRECISION (intTI_type_node
))
818 return unsignedp
? unsigned_intTI_type_node
: intTI_type_node
;
824 /* Return a data type that has machine mode MODE.
825 If the mode is an integer,
826 then UNSIGNEDP selects between signed and unsigned types.
827 If the mode is a fixed-point mode,
828 then UNSIGNEDP selects between saturating and nonsaturating types. */
831 lto_type_for_mode (enum machine_mode mode
, int unsigned_p
)
835 if (mode
== TYPE_MODE (integer_type_node
))
836 return unsigned_p
? unsigned_type_node
: integer_type_node
;
838 if (mode
== TYPE_MODE (signed_char_type_node
))
839 return unsigned_p
? unsigned_char_type_node
: signed_char_type_node
;
841 if (mode
== TYPE_MODE (short_integer_type_node
))
842 return unsigned_p
? short_unsigned_type_node
: short_integer_type_node
;
844 if (mode
== TYPE_MODE (long_integer_type_node
))
845 return unsigned_p
? long_unsigned_type_node
: long_integer_type_node
;
847 if (mode
== TYPE_MODE (long_long_integer_type_node
))
848 return unsigned_p
? long_long_unsigned_type_node
: long_long_integer_type_node
;
851 return unsigned_p
? unsigned_intQI_type_node
: intQI_type_node
;
854 return unsigned_p
? unsigned_intHI_type_node
: intHI_type_node
;
857 return unsigned_p
? unsigned_intSI_type_node
: intSI_type_node
;
860 return unsigned_p
? unsigned_intDI_type_node
: intDI_type_node
;
862 #if HOST_BITS_PER_WIDE_INT >= 64
863 if (mode
== TYPE_MODE (intTI_type_node
))
864 return unsigned_p
? unsigned_intTI_type_node
: intTI_type_node
;
867 if (mode
== TYPE_MODE (float_type_node
))
868 return float_type_node
;
870 if (mode
== TYPE_MODE (double_type_node
))
871 return double_type_node
;
873 if (mode
== TYPE_MODE (long_double_type_node
))
874 return long_double_type_node
;
876 if (mode
== TYPE_MODE (void_type_node
))
877 return void_type_node
;
879 if (mode
== TYPE_MODE (build_pointer_type (char_type_node
)))
881 ? make_unsigned_type (GET_MODE_PRECISION (mode
))
882 : make_signed_type (GET_MODE_PRECISION (mode
)));
884 if (mode
== TYPE_MODE (build_pointer_type (integer_type_node
)))
886 ? make_unsigned_type (GET_MODE_PRECISION (mode
))
887 : make_signed_type (GET_MODE_PRECISION (mode
)));
889 if (COMPLEX_MODE_P (mode
))
891 enum machine_mode inner_mode
;
894 if (mode
== TYPE_MODE (complex_float_type_node
))
895 return complex_float_type_node
;
896 if (mode
== TYPE_MODE (complex_double_type_node
))
897 return complex_double_type_node
;
898 if (mode
== TYPE_MODE (complex_long_double_type_node
))
899 return complex_long_double_type_node
;
901 if (mode
== TYPE_MODE (complex_integer_type_node
) && !unsigned_p
)
902 return complex_integer_type_node
;
904 inner_mode
= GET_MODE_INNER (mode
);
905 inner_type
= lto_type_for_mode (inner_mode
, unsigned_p
);
906 if (inner_type
!= NULL_TREE
)
907 return build_complex_type (inner_type
);
909 else if (VECTOR_MODE_P (mode
))
911 enum machine_mode inner_mode
= GET_MODE_INNER (mode
);
912 tree inner_type
= lto_type_for_mode (inner_mode
, unsigned_p
);
913 if (inner_type
!= NULL_TREE
)
914 return build_vector_type_for_mode (inner_type
, mode
);
917 if (mode
== TYPE_MODE (dfloat32_type_node
))
918 return dfloat32_type_node
;
919 if (mode
== TYPE_MODE (dfloat64_type_node
))
920 return dfloat64_type_node
;
921 if (mode
== TYPE_MODE (dfloat128_type_node
))
922 return dfloat128_type_node
;
924 if (ALL_SCALAR_FIXED_POINT_MODE_P (mode
))
926 if (mode
== TYPE_MODE (short_fract_type_node
))
927 return unsigned_p
? sat_short_fract_type_node
: short_fract_type_node
;
928 if (mode
== TYPE_MODE (fract_type_node
))
929 return unsigned_p
? sat_fract_type_node
: fract_type_node
;
930 if (mode
== TYPE_MODE (long_fract_type_node
))
931 return unsigned_p
? sat_long_fract_type_node
: long_fract_type_node
;
932 if (mode
== TYPE_MODE (long_long_fract_type_node
))
933 return unsigned_p
? sat_long_long_fract_type_node
934 : long_long_fract_type_node
;
936 if (mode
== TYPE_MODE (unsigned_short_fract_type_node
))
937 return unsigned_p
? sat_unsigned_short_fract_type_node
938 : unsigned_short_fract_type_node
;
939 if (mode
== TYPE_MODE (unsigned_fract_type_node
))
940 return unsigned_p
? sat_unsigned_fract_type_node
941 : unsigned_fract_type_node
;
942 if (mode
== TYPE_MODE (unsigned_long_fract_type_node
))
943 return unsigned_p
? sat_unsigned_long_fract_type_node
944 : unsigned_long_fract_type_node
;
945 if (mode
== TYPE_MODE (unsigned_long_long_fract_type_node
))
946 return unsigned_p
? sat_unsigned_long_long_fract_type_node
947 : unsigned_long_long_fract_type_node
;
949 if (mode
== TYPE_MODE (short_accum_type_node
))
950 return unsigned_p
? sat_short_accum_type_node
: short_accum_type_node
;
951 if (mode
== TYPE_MODE (accum_type_node
))
952 return unsigned_p
? sat_accum_type_node
: accum_type_node
;
953 if (mode
== TYPE_MODE (long_accum_type_node
))
954 return unsigned_p
? sat_long_accum_type_node
: long_accum_type_node
;
955 if (mode
== TYPE_MODE (long_long_accum_type_node
))
956 return unsigned_p
? sat_long_long_accum_type_node
957 : long_long_accum_type_node
;
959 if (mode
== TYPE_MODE (unsigned_short_accum_type_node
))
960 return unsigned_p
? sat_unsigned_short_accum_type_node
961 : unsigned_short_accum_type_node
;
962 if (mode
== TYPE_MODE (unsigned_accum_type_node
))
963 return unsigned_p
? sat_unsigned_accum_type_node
964 : unsigned_accum_type_node
;
965 if (mode
== TYPE_MODE (unsigned_long_accum_type_node
))
966 return unsigned_p
? sat_unsigned_long_accum_type_node
967 : unsigned_long_accum_type_node
;
968 if (mode
== TYPE_MODE (unsigned_long_long_accum_type_node
))
969 return unsigned_p
? sat_unsigned_long_long_accum_type_node
970 : unsigned_long_long_accum_type_node
;
973 return unsigned_p
? sat_qq_type_node
: qq_type_node
;
975 return unsigned_p
? sat_hq_type_node
: hq_type_node
;
977 return unsigned_p
? sat_sq_type_node
: sq_type_node
;
979 return unsigned_p
? sat_dq_type_node
: dq_type_node
;
981 return unsigned_p
? sat_tq_type_node
: tq_type_node
;
984 return unsigned_p
? sat_uqq_type_node
: uqq_type_node
;
986 return unsigned_p
? sat_uhq_type_node
: uhq_type_node
;
988 return unsigned_p
? sat_usq_type_node
: usq_type_node
;
990 return unsigned_p
? sat_udq_type_node
: udq_type_node
;
992 return unsigned_p
? sat_utq_type_node
: utq_type_node
;
995 return unsigned_p
? sat_ha_type_node
: ha_type_node
;
997 return unsigned_p
? sat_sa_type_node
: sa_type_node
;
999 return unsigned_p
? sat_da_type_node
: da_type_node
;
1001 return unsigned_p
? sat_ta_type_node
: ta_type_node
;
1003 if (mode
== UHAmode
)
1004 return unsigned_p
? sat_uha_type_node
: uha_type_node
;
1005 if (mode
== USAmode
)
1006 return unsigned_p
? sat_usa_type_node
: usa_type_node
;
1007 if (mode
== UDAmode
)
1008 return unsigned_p
? sat_uda_type_node
: uda_type_node
;
1009 if (mode
== UTAmode
)
1010 return unsigned_p
? sat_uta_type_node
: uta_type_node
;
1013 for (t
= registered_builtin_types
; t
; t
= TREE_CHAIN (t
))
1014 if (TYPE_MODE (TREE_VALUE (t
)) == mode
)
1015 return TREE_VALUE (t
);
1020 /* Return true if we are in the global binding level. */
1023 lto_global_bindings_p (void)
1025 return cfun
== NULL
;
1029 lto_set_decl_assembler_name (tree decl
)
1031 /* This is almost the same as lhd_set_decl_assembler_name, except that
1032 we need to uniquify file-scope names, even if they are not
1033 TREE_PUBLIC, to avoid conflicts between individual files. */
1036 if (TREE_PUBLIC (decl
))
1037 id
= targetm
.mangle_decl_assembler_name (decl
, DECL_NAME (decl
));
1040 const char *name
= IDENTIFIER_POINTER (DECL_NAME (decl
));
1043 ASM_FORMAT_PRIVATE_NAME (label
, name
, DECL_UID (decl
));
1044 id
= get_identifier (label
);
1047 SET_DECL_ASSEMBLER_NAME (decl
, id
);
1051 lto_pushdecl (tree t ATTRIBUTE_UNUSED
)
1053 /* Do nothing, since we get all information from DWARF and LTO
1061 /* We have our own write_globals langhook, hence the getdecls
1062 langhook shouldn't be used, except by dbxout.c, so we can't
1068 lto_write_globals (void)
1070 tree
*vec
= lto_global_var_decls
->address ();
1071 int len
= lto_global_var_decls
->length ();
1072 wrapup_global_declarations (vec
, len
);
1073 emit_debug_global_declarations (vec
, len
);
1074 vec_free (lto_global_var_decls
);
1078 lto_builtin_function (tree decl
)
1084 lto_register_builtin_type (tree type
, const char *name
)
1088 if (!TYPE_NAME (type
))
1090 decl
= build_decl (UNKNOWN_LOCATION
, TYPE_DECL
,
1091 get_identifier (name
), type
);
1092 DECL_ARTIFICIAL (decl
) = 1;
1093 TYPE_NAME (type
) = decl
;
1096 registered_builtin_types
= tree_cons (0, type
, registered_builtin_types
);
1099 /* Build nodes that would have be created by the C front-end; necessary
1100 for including builtin-types.def and ultimately builtins.def. */
1103 lto_build_c_type_nodes (void)
1105 gcc_assert (void_type_node
);
1107 void_list_node
= build_tree_list (NULL_TREE
, void_type_node
);
1108 string_type_node
= build_pointer_type (char_type_node
);
1109 const_string_type_node
1110 = build_pointer_type (build_qualified_type (char_type_node
, TYPE_QUAL_CONST
));
1112 if (strcmp (SIZE_TYPE
, "unsigned int") == 0)
1114 intmax_type_node
= integer_type_node
;
1115 uintmax_type_node
= unsigned_type_node
;
1116 signed_size_type_node
= integer_type_node
;
1118 else if (strcmp (SIZE_TYPE
, "long unsigned int") == 0)
1120 intmax_type_node
= long_integer_type_node
;
1121 uintmax_type_node
= long_unsigned_type_node
;
1122 signed_size_type_node
= long_integer_type_node
;
1124 else if (strcmp (SIZE_TYPE
, "long long unsigned int") == 0)
1126 intmax_type_node
= long_long_integer_type_node
;
1127 uintmax_type_node
= long_long_unsigned_type_node
;
1128 signed_size_type_node
= long_long_integer_type_node
;
1133 wint_type_node
= unsigned_type_node
;
1134 pid_type_node
= integer_type_node
;
1137 /* Perform LTO-specific initialization. */
1142 /* We need to generate LTO if running in WPA mode. */
1143 flag_generate_lto
= flag_wpa
;
1145 /* Create the basic integer types. */
1146 build_common_tree_nodes (flag_signed_char
, /*short_double=*/false);
1148 /* The global tree for the main identifier is filled in by
1149 language-specific front-end initialization that is not run in the
1150 LTO back-end. It appears that all languages that perform such
1151 initialization currently do so in the same way, so we do it here. */
1152 if (main_identifier_node
== NULL_TREE
)
1153 main_identifier_node
= get_identifier ("main");
1155 /* In the C++ front-end, fileptr_type_node is defined as a variant
1156 copy of of ptr_type_node, rather than ptr_node itself. The
1157 distinction should only be relevant to the front-end, so we
1158 always use the C definition here in lto1. */
1159 gcc_assert (fileptr_type_node
== ptr_type_node
);
1160 gcc_assert (TYPE_MAIN_VARIANT (fileptr_type_node
) == ptr_type_node
);
1162 ptrdiff_type_node
= integer_type_node
;
1164 lto_build_c_type_nodes ();
1165 gcc_assert (va_list_type_node
);
1167 if (TREE_CODE (va_list_type_node
) == ARRAY_TYPE
)
1169 tree x
= build_pointer_type (TREE_TYPE (va_list_type_node
));
1170 lto_define_builtins (x
, x
);
1174 lto_define_builtins (va_list_type_node
,
1175 build_reference_type (va_list_type_node
));
1178 if (flag_enable_cilkplus
)
1179 cilk_init_builtins ();
1181 targetm
.init_builtins ();
1182 build_common_builtin_nodes ();
1184 /* Assign names to the builtin types, otherwise they'll end up
1185 as __unknown__ in debug info.
1186 ??? We simply need to stop pre-seeding the streamer cache.
1187 Below is modeled after from c-common.c:c_common_nodes_and_builtins */
1188 #define NAME_TYPE(t,n) \
1190 TYPE_NAME (t) = build_decl (UNKNOWN_LOCATION, TYPE_DECL, \
1191 get_identifier (n), t)
1192 NAME_TYPE (integer_type_node
, "int");
1193 NAME_TYPE (char_type_node
, "char");
1194 NAME_TYPE (long_integer_type_node
, "long int");
1195 NAME_TYPE (unsigned_type_node
, "unsigned int");
1196 NAME_TYPE (long_unsigned_type_node
, "long unsigned int");
1197 NAME_TYPE (long_long_integer_type_node
, "long long int");
1198 NAME_TYPE (long_long_unsigned_type_node
, "long long unsigned int");
1199 NAME_TYPE (short_integer_type_node
, "short int");
1200 NAME_TYPE (short_unsigned_type_node
, "short unsigned int");
1201 if (signed_char_type_node
!= char_type_node
)
1202 NAME_TYPE (signed_char_type_node
, "signed char");
1203 if (unsigned_char_type_node
!= char_type_node
)
1204 NAME_TYPE (unsigned_char_type_node
, "unsigned char");
1205 NAME_TYPE (float_type_node
, "float");
1206 NAME_TYPE (double_type_node
, "double");
1207 NAME_TYPE (long_double_type_node
, "long double");
1208 NAME_TYPE (void_type_node
, "void");
1209 NAME_TYPE (boolean_type_node
, "bool");
1212 /* Initialize LTO-specific data structures. */
1213 vec_alloc (lto_global_var_decls
, 256);
1219 /* Initialize tree structures required by the LTO front end. */
1221 static void lto_init_ts (void)
1223 tree_contains_struct
[NAMESPACE_DECL
][TS_DECL_MINIMAL
] = 1;
1226 #undef LANG_HOOKS_NAME
1227 #define LANG_HOOKS_NAME "GNU GIMPLE"
1228 #undef LANG_HOOKS_OPTION_LANG_MASK
1229 #define LANG_HOOKS_OPTION_LANG_MASK lto_option_lang_mask
1230 #undef LANG_HOOKS_COMPLAIN_WRONG_LANG_P
1231 #define LANG_HOOKS_COMPLAIN_WRONG_LANG_P lto_complain_wrong_lang_p
1232 #undef LANG_HOOKS_INIT_OPTIONS_STRUCT
1233 #define LANG_HOOKS_INIT_OPTIONS_STRUCT lto_init_options_struct
1234 #undef LANG_HOOKS_HANDLE_OPTION
1235 #define LANG_HOOKS_HANDLE_OPTION lto_handle_option
1236 #undef LANG_HOOKS_POST_OPTIONS
1237 #define LANG_HOOKS_POST_OPTIONS lto_post_options
1238 #undef LANG_HOOKS_GET_ALIAS_SET
1239 #define LANG_HOOKS_GET_ALIAS_SET gimple_get_alias_set
1240 #undef LANG_HOOKS_TYPE_FOR_MODE
1241 #define LANG_HOOKS_TYPE_FOR_MODE lto_type_for_mode
1242 #undef LANG_HOOKS_TYPE_FOR_SIZE
1243 #define LANG_HOOKS_TYPE_FOR_SIZE lto_type_for_size
1244 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
1245 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lto_set_decl_assembler_name
1246 #undef LANG_HOOKS_GLOBAL_BINDINGS_P
1247 #define LANG_HOOKS_GLOBAL_BINDINGS_P lto_global_bindings_p
1248 #undef LANG_HOOKS_PUSHDECL
1249 #define LANG_HOOKS_PUSHDECL lto_pushdecl
1250 #undef LANG_HOOKS_GETDECLS
1251 #define LANG_HOOKS_GETDECLS lto_getdecls
1252 #undef LANG_HOOKS_WRITE_GLOBALS
1253 #define LANG_HOOKS_WRITE_GLOBALS lto_write_globals
1254 #undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
1255 #define LANG_HOOKS_REGISTER_BUILTIN_TYPE lto_register_builtin_type
1256 #undef LANG_HOOKS_BUILTIN_FUNCTION
1257 #define LANG_HOOKS_BUILTIN_FUNCTION lto_builtin_function
1258 #undef LANG_HOOKS_INIT
1259 #define LANG_HOOKS_INIT lto_init
1260 #undef LANG_HOOKS_PARSE_FILE
1261 #define LANG_HOOKS_PARSE_FILE lto_main
1262 #undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
1263 #define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
1264 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
1265 #define LANG_HOOKS_TYPES_COMPATIBLE_P NULL
1266 #undef LANG_HOOKS_EH_PERSONALITY
1267 #define LANG_HOOKS_EH_PERSONALITY lto_eh_personality
1269 /* Attribute hooks. */
1270 #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
1271 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE lto_attribute_table
1272 #undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
1273 #define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE lto_format_attribute_table
1275 #undef LANG_HOOKS_BEGIN_SECTION
1276 #define LANG_HOOKS_BEGIN_SECTION lto_obj_begin_section
1277 #undef LANG_HOOKS_APPEND_DATA
1278 #define LANG_HOOKS_APPEND_DATA lto_obj_append_data
1279 #undef LANG_HOOKS_END_SECTION
1280 #define LANG_HOOKS_END_SECTION lto_obj_end_section
1282 #undef LANG_HOOKS_INIT_TS
1283 #define LANG_HOOKS_INIT_TS lto_init_ts
1285 struct lang_hooks lang_hooks
= LANG_HOOKS_INITIALIZER
;
1287 /* Language hooks that are not part of lang_hooks. */
1290 convert (tree type ATTRIBUTE_UNUSED
, tree expr ATTRIBUTE_UNUSED
)
1295 /* Tree walking support. */
1297 static enum lto_tree_node_structure_enum
1298 lto_tree_node_structure (union lang_tree_node
*t ATTRIBUTE_UNUSED
)
1300 return TS_LTO_GENERIC
;
1304 #include "gtype-lto.h"
1305 #include "gt-lto-lto-lang.h"