1 /* Library interface to C front end
2 Copyright (C) 2014-2023 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #include <cc1plugin-config.h>
24 #undef PACKAGE_TARNAME
25 #undef PACKAGE_VERSION
27 #include "../gcc/config.h"
31 #undef PACKAGE_TARNAME
32 #undef PACKAGE_VERSION
34 #define INCLUDE_MEMORY
35 #include "gcc-plugin.h"
37 #include "coretypes.h"
38 #include "stringpool.h"
40 #include "gcc-interface.h"
44 #include "double-int.h"
52 #include "fold-const.h"
53 #include "stor-layout.h"
57 #include "hash-table.h"
59 #include "c-family/c-pragma.h"
61 #include "diagnostic.h"
62 #include "langhooks.h"
63 #include "langhooks-def.h"
65 #include "callbacks.hh"
66 #include "connection.hh"
67 #include "marshall.hh"
69 #include "gcc-c-interface.h"
74 using namespace cc1_plugin
;
78 // A wrapper for pushdecl that doesn't let gdb have a chance to
79 // instantiate a symbol.
82 pushdecl_safe (tree decl
)
84 void (*save
) (enum c_oracle_request
, tree identifier
);
86 save
= c_binding_oracle
;
87 c_binding_oracle
= NULL
;
89 c_binding_oracle
= save
;
95 plugin_binding_oracle (enum c_oracle_request kind
, tree identifier
)
97 enum gcc_c_oracle_request request
;
99 gcc_assert (current_context
!= NULL
);
103 case C_ORACLE_SYMBOL
:
104 request
= GCC_C_ORACLE_SYMBOL
;
107 request
= GCC_C_ORACLE_TAG
;
110 request
= GCC_C_ORACLE_LABEL
;
117 cc1_plugin::call (current_context
, "binding_oracle", &ignore
,
118 request
, IDENTIFIER_POINTER (identifier
));
122 plugin_pragma_user_expression (cpp_reader
*)
124 c_binding_oracle
= plugin_binding_oracle
;
128 plugin_init_extra_pragmas (void *, void *)
130 c_register_pragma ("GCC", "user_expression", plugin_pragma_user_expression
);
135 // Maybe rewrite a decl to its address.
137 address_rewriter (tree
*in
, int *walk_subtrees
, void *arg
)
139 plugin_context
*ctx
= (plugin_context
*) arg
;
141 if (!DECL_P (*in
) || DECL_NAME (*in
) == NULL_TREE
)
144 decl_addr_value value
;
146 decl_addr_value
*found_value
= ctx
->address_map
.find (&value
);
147 if (found_value
!= NULL
)
149 else if (DECL_IS_UNDECLARED_BUILTIN (*in
))
153 if (!cc1_plugin::call (ctx
, "address_oracle", &address
,
154 IDENTIFIER_POINTER (DECL_NAME (*in
))))
159 // Insert the decl into the address map in case it is referenced
161 value
.address
= build_int_cst_type (ptr_type_node
, address
);
162 decl_addr_value
**slot
= ctx
->address_map
.find_slot (&value
, INSERT
);
163 gcc_assert (*slot
== NULL
);
165 = static_cast<decl_addr_value
*> (xmalloc (sizeof (decl_addr_value
)));
172 if (found_value
->address
!= error_mark_node
)
174 // We have an address for the decl, so rewrite the tree.
175 tree ptr_type
= build_pointer_type (TREE_TYPE (*in
));
176 *in
= fold_build1 (INDIRECT_REF
, TREE_TYPE (*in
),
177 fold_build1 (CONVERT_EXPR
, ptr_type
,
178 found_value
->address
));
186 // When generating code for gdb, we want to be able to use absolute
187 // addresses to refer to otherwise external objects that gdb knows
188 // about. gdb passes in these addresses when building decls, and then
189 // before gimplification we go through the trees, rewriting uses to
190 // the equivalent of "*(TYPE *) ADDR".
192 rewrite_decls_to_addresses (void *function_in
, void *)
194 tree function
= (tree
) function_in
;
196 // Do nothing if we're not in gdb.
197 if (current_context
== NULL
)
200 walk_tree (&DECL_SAVED_TREE (function
), address_rewriter
, current_context
,
207 plugin_build_decl (cc1_plugin::connection
*self
,
209 enum gcc_c_symbol_kind sym_kind
,
210 gcc_type sym_type_in
,
211 const char *substitution_name
,
213 const char *filename
,
214 unsigned int line_number
)
216 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
217 tree identifier
= get_identifier (name
);
220 tree sym_type
= convert_in (sym_type_in
);
224 case GCC_C_SYMBOL_FUNCTION
:
225 code
= FUNCTION_DECL
;
228 case GCC_C_SYMBOL_VARIABLE
:
232 case GCC_C_SYMBOL_TYPEDEF
:
236 case GCC_C_SYMBOL_LABEL
:
237 // FIXME: we aren't ready to handle labels yet.
238 // It isn't clear how to translate them properly
239 // and in any case a "goto" isn't likely to work.
240 return convert_out (error_mark_node
);
246 location_t loc
= ctx
->get_location_t (filename
, line_number
);
248 decl
= build_decl (loc
, code
, identifier
, sym_type
);
249 TREE_USED (decl
) = 1;
250 TREE_ADDRESSABLE (decl
) = 1;
252 if (sym_kind
!= GCC_C_SYMBOL_TYPEDEF
)
254 decl_addr_value value
;
256 DECL_EXTERNAL (decl
) = 1;
258 if (substitution_name
!= NULL
)
260 // If the translator gave us a name without a binding,
261 // we can just substitute error_mark_node, since we know the
262 // translator will be reporting an error anyhow.
264 = lookup_name (get_identifier (substitution_name
));
265 if (value
.address
== NULL_TREE
)
266 value
.address
= error_mark_node
;
269 value
.address
= build_int_cst_type (ptr_type_node
, address
);
270 decl_addr_value
**slot
= ctx
->address_map
.find_slot (&value
, INSERT
);
271 gcc_assert (*slot
== NULL
);
273 = static_cast<decl_addr_value
*> (xmalloc (sizeof (decl_addr_value
)));
277 return convert_out (ctx
->preserve (decl
));
281 plugin_bind (cc1_plugin::connection
*,
282 gcc_decl decl_in
, int is_global
)
284 tree decl
= convert_in (decl_in
);
285 c_bind (DECL_SOURCE_LOCATION (decl
), decl
, is_global
);
286 rest_of_decl_compilation (decl
, is_global
, 0);
291 plugin_tagbind (cc1_plugin::connection
*self
,
292 const char *name
, gcc_type tagged_type
,
293 const char *filename
, unsigned int line_number
)
295 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
296 tree t
= convert_in (tagged_type
), x
;
297 c_pushtag (ctx
->get_location_t (filename
, line_number
),
298 get_identifier (name
), t
);
300 /* Propagate the newly-added type name so that previously-created
301 variant types are not disconnected from their main variants. */
302 for (x
= TYPE_MAIN_VARIANT (t
); x
; x
= TYPE_NEXT_VARIANT (x
))
303 TYPE_NAME (x
) = TYPE_NAME (t
);
309 plugin_build_pointer_type (cc1_plugin::connection
*,
312 // No need to preserve a pointer type as the base type is preserved.
313 return convert_out (build_pointer_type (convert_in (base_type
)));
316 // TYPE_NAME needs to be a valid pointer, even if there is no name available.
319 build_anonymous_node (enum tree_code code
)
321 tree node
= make_node (code
);
322 tree type_decl
= build_decl (input_location
, TYPE_DECL
, NULL_TREE
, node
);
323 TYPE_NAME (node
) = type_decl
;
324 TYPE_STUB_DECL (node
) = type_decl
;
329 plugin_build_record_type (cc1_plugin::connection
*self
)
331 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
332 return convert_out (ctx
->preserve (build_anonymous_node (RECORD_TYPE
)));
336 plugin_build_union_type (cc1_plugin::connection
*self
)
338 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
339 return convert_out (ctx
->preserve (build_anonymous_node (UNION_TYPE
)));
343 plugin_build_add_field (cc1_plugin::connection
*,
344 gcc_type record_or_union_type_in
,
345 const char *field_name
,
346 gcc_type field_type_in
,
347 unsigned long bitsize
,
348 unsigned long bitpos
)
350 tree record_or_union_type
= convert_in (record_or_union_type_in
);
351 tree field_type
= convert_in (field_type_in
);
353 gcc_assert (TREE_CODE (record_or_union_type
) == RECORD_TYPE
354 || TREE_CODE (record_or_union_type
) == UNION_TYPE
);
356 /* Note that gdb does not preserve the location of field decls, so
357 we can't provide a decent location here. */
358 tree decl
= build_decl (BUILTINS_LOCATION
, FIELD_DECL
,
359 get_identifier (field_name
), field_type
);
360 DECL_FIELD_CONTEXT (decl
) = record_or_union_type
;
362 if (TREE_CODE (field_type
) == INTEGER_TYPE
363 && TYPE_PRECISION (field_type
) != bitsize
)
365 DECL_BIT_FIELD_TYPE (decl
) = field_type
;
367 = c_build_bitfield_integer_type (bitsize
, TYPE_UNSIGNED (field_type
));
370 SET_DECL_MODE (decl
, TYPE_MODE (TREE_TYPE (decl
)));
372 // There's no way to recover this from DWARF.
373 SET_DECL_OFFSET_ALIGN (decl
, TYPE_PRECISION (pointer_sized_int_node
));
375 tree pos
= bitsize_int (bitpos
);
376 pos_from_bit (&DECL_FIELD_OFFSET (decl
), &DECL_FIELD_BIT_OFFSET (decl
),
377 DECL_OFFSET_ALIGN (decl
), pos
);
379 DECL_SIZE (decl
) = bitsize_int (bitsize
);
380 DECL_SIZE_UNIT (decl
) = size_int ((bitsize
+ BITS_PER_UNIT
- 1)
383 DECL_CHAIN (decl
) = TYPE_FIELDS (record_or_union_type
);
384 TYPE_FIELDS (record_or_union_type
) = decl
;
390 plugin_finish_record_or_union (cc1_plugin::connection
*,
391 gcc_type record_or_union_type_in
,
392 unsigned long size_in_bytes
)
394 tree record_or_union_type
= convert_in (record_or_union_type_in
);
396 gcc_assert (TREE_CODE (record_or_union_type
) == RECORD_TYPE
397 || TREE_CODE (record_or_union_type
) == UNION_TYPE
);
399 /* We built the field list in reverse order, so fix it now. */
400 TYPE_FIELDS (record_or_union_type
)
401 = nreverse (TYPE_FIELDS (record_or_union_type
));
403 if (TREE_CODE (record_or_union_type
) == UNION_TYPE
)
405 /* Unions can just be handled by the generic code. */
406 layout_type (record_or_union_type
);
410 // FIXME there's no way to get this from DWARF,
411 // or even, it seems, a particularly good way to deduce it.
412 SET_TYPE_ALIGN (record_or_union_type
,
413 TYPE_PRECISION (pointer_sized_int_node
));
415 TYPE_SIZE (record_or_union_type
) = bitsize_int (size_in_bytes
417 TYPE_SIZE_UNIT (record_or_union_type
) = size_int (size_in_bytes
);
419 compute_record_mode (record_or_union_type
);
420 finish_bitfield_layout (record_or_union_type
);
421 // FIXME we have no idea about TYPE_PACKED
424 tree t
= record_or_union_type
, x
;
425 for (x
= TYPE_MAIN_VARIANT (t
); x
; x
= TYPE_NEXT_VARIANT (x
))
427 /* Like finish_struct, update the qualified variant types. */
428 TYPE_FIELDS (x
) = TYPE_FIELDS (t
);
429 TYPE_LANG_SPECIFIC (x
) = TYPE_LANG_SPECIFIC (t
);
430 C_TYPE_FIELDS_READONLY (x
) = C_TYPE_FIELDS_READONLY (t
);
431 C_TYPE_FIELDS_VOLATILE (x
) = C_TYPE_FIELDS_VOLATILE (t
);
432 C_TYPE_VARIABLE_SIZE (x
) = C_TYPE_VARIABLE_SIZE (t
);
433 /* We copy these fields too. */
434 SET_TYPE_ALIGN (x
, TYPE_ALIGN (t
));
435 TYPE_SIZE (x
) = TYPE_SIZE (t
);
436 TYPE_SIZE_UNIT (x
) = TYPE_SIZE_UNIT (t
);
437 if (x
!= record_or_union_type
)
438 compute_record_mode (x
);
445 plugin_build_enum_type (cc1_plugin::connection
*self
,
446 gcc_type underlying_int_type_in
)
448 tree underlying_int_type
= convert_in (underlying_int_type_in
);
450 if (underlying_int_type
== error_mark_node
)
451 return convert_out (error_mark_node
);
453 tree result
= build_anonymous_node (ENUMERAL_TYPE
);
455 TYPE_PRECISION (result
) = TYPE_PRECISION (underlying_int_type
);
456 TYPE_UNSIGNED (result
) = TYPE_UNSIGNED (underlying_int_type
);
458 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
459 return convert_out (ctx
->preserve (result
));
463 plugin_build_add_enum_constant (cc1_plugin::connection
*,
464 gcc_type enum_type_in
,
468 tree cst
, decl
, cons
;
469 tree enum_type
= convert_in (enum_type_in
);
471 gcc_assert (TREE_CODE (enum_type
) == ENUMERAL_TYPE
);
473 cst
= build_int_cst (enum_type
, value
);
474 /* Note that gdb does not preserve the location of enum constants,
475 so we can't provide a decent location here. */
476 decl
= build_decl (BUILTINS_LOCATION
, CONST_DECL
,
477 get_identifier (name
), enum_type
);
478 DECL_INITIAL (decl
) = cst
;
479 pushdecl_safe (decl
);
481 cons
= tree_cons (DECL_NAME (decl
), cst
, TYPE_VALUES (enum_type
));
482 TYPE_VALUES (enum_type
) = cons
;
488 plugin_finish_enum_type (cc1_plugin::connection
*,
489 gcc_type enum_type_in
)
491 tree enum_type
= convert_in (enum_type_in
);
492 tree minnode
, maxnode
, iter
;
494 iter
= TYPE_VALUES (enum_type
);
495 minnode
= maxnode
= TREE_VALUE (iter
);
496 for (iter
= TREE_CHAIN (iter
);
498 iter
= TREE_CHAIN (iter
))
500 tree value
= TREE_VALUE (iter
);
501 if (tree_int_cst_lt (maxnode
, value
))
503 if (tree_int_cst_lt (value
, minnode
))
506 TYPE_MIN_VALUE (enum_type
) = minnode
;
507 TYPE_MAX_VALUE (enum_type
) = maxnode
;
509 layout_type (enum_type
);
515 plugin_build_function_type (cc1_plugin::connection
*self
,
516 gcc_type return_type_in
,
517 const struct gcc_type_array
*argument_types_in
,
520 tree return_type
= convert_in (return_type_in
);
523 std::vector
<tree
> argument_types (argument_types_in
->n_elements
);
524 for (int i
= 0; i
< argument_types_in
->n_elements
; ++i
)
525 argument_types
[i
] = convert_in (argument_types_in
->elements
[i
]);
528 result
= build_varargs_function_type_array (return_type
,
529 argument_types_in
->n_elements
,
530 argument_types
.data ());
532 result
= build_function_type_array (return_type
,
533 argument_types_in
->n_elements
,
534 argument_types
.data ());
536 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
537 return convert_out (ctx
->preserve (result
));
540 /* Return a builtin type associated with BUILTIN_NAME. */
543 safe_lookup_builtin_type (const char *builtin_name
)
545 tree result
= NULL_TREE
;
550 result
= identifier_global_value (get_identifier (builtin_name
));
555 gcc_assert (TREE_CODE (result
) == TYPE_DECL
);
556 result
= TREE_TYPE (result
);
561 plugin_int_check (cc1_plugin::connection
*self
,
562 int is_unsigned
, unsigned long size_in_bytes
,
565 if (result
== NULL_TREE
)
566 result
= error_mark_node
;
569 gcc_assert (!TYPE_UNSIGNED (result
) == !is_unsigned
);
570 gcc_assert (TREE_CODE (TYPE_SIZE (result
)) == INTEGER_CST
);
571 gcc_assert (TYPE_PRECISION (result
) == BITS_PER_UNIT
* size_in_bytes
);
573 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
574 ctx
->preserve (result
);
576 return convert_out (result
);
580 plugin_int_type_v0 (cc1_plugin::connection
*self
,
581 int is_unsigned
, unsigned long size_in_bytes
)
583 tree result
= c_common_type_for_size (BITS_PER_UNIT
* size_in_bytes
,
586 return plugin_int_check (self
, is_unsigned
, size_in_bytes
, result
);
590 plugin_int_type (cc1_plugin::connection
*self
,
591 int is_unsigned
, unsigned long size_in_bytes
,
592 const char *builtin_name
)
595 return plugin_int_type_v0 (self
, is_unsigned
, size_in_bytes
);
597 tree result
= safe_lookup_builtin_type (builtin_name
);
598 gcc_assert (!result
|| TREE_CODE (result
) == INTEGER_TYPE
);
600 return plugin_int_check (self
, is_unsigned
, size_in_bytes
, result
);
604 plugin_char_type (cc1_plugin::connection
*)
606 return convert_out (char_type_node
);
610 plugin_float_type_v0 (cc1_plugin::connection
*,
611 unsigned long size_in_bytes
)
613 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (float_type_node
))
614 return convert_out (float_type_node
);
615 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (double_type_node
))
616 return convert_out (double_type_node
);
617 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (long_double_type_node
))
618 return convert_out (long_double_type_node
);
619 return convert_out (error_mark_node
);
623 plugin_float_type (cc1_plugin::connection
*self
,
624 unsigned long size_in_bytes
,
625 const char *builtin_name
)
628 return plugin_float_type_v0 (self
, size_in_bytes
);
630 tree result
= safe_lookup_builtin_type (builtin_name
);
633 return convert_out (error_mark_node
);
635 gcc_assert (TREE_CODE (result
) == REAL_TYPE
);
636 gcc_assert (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (result
));
638 return convert_out (result
);
642 plugin_void_type (cc1_plugin::connection
*)
644 return convert_out (void_type_node
);
648 plugin_bool_type (cc1_plugin::connection
*)
650 return convert_out (boolean_type_node
);
654 plugin_build_array_type (cc1_plugin::connection
*self
,
655 gcc_type element_type_in
, int num_elements
)
657 tree element_type
= convert_in (element_type_in
);
660 if (num_elements
== -1)
661 result
= build_array_type (element_type
, NULL_TREE
);
663 result
= build_array_type_nelts (element_type
, num_elements
);
665 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
666 return convert_out (ctx
->preserve (result
));
670 plugin_build_vla_array_type (cc1_plugin::connection
*self
,
671 gcc_type element_type_in
,
672 const char *upper_bound_name
)
674 tree element_type
= convert_in (element_type_in
);
675 tree upper_bound
= lookup_name (get_identifier (upper_bound_name
));
676 tree range
= build_index_type (upper_bound
);
678 tree result
= build_array_type (element_type
, range
);
679 C_TYPE_VARIABLE_SIZE (result
) = 1;
681 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
682 return convert_out (ctx
->preserve (result
));
686 plugin_build_qualified_type (cc1_plugin::connection
*,
687 gcc_type unqualified_type_in
,
688 enum gcc_qualifiers qualifiers
)
690 tree unqualified_type
= convert_in (unqualified_type_in
);
693 if ((qualifiers
& GCC_QUALIFIER_CONST
) != 0)
694 quals
|= TYPE_QUAL_CONST
;
695 if ((qualifiers
& GCC_QUALIFIER_VOLATILE
) != 0)
696 quals
|= TYPE_QUAL_VOLATILE
;
697 if ((qualifiers
& GCC_QUALIFIER_RESTRICT
) != 0)
698 quals
|= TYPE_QUAL_RESTRICT
;
700 return convert_out (build_qualified_type (unqualified_type
, quals
));
704 plugin_build_complex_type (cc1_plugin::connection
*self
,
707 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
708 return convert_out (ctx
->preserve (build_complex_type (convert_in (base_type
))));
712 plugin_build_vector_type (cc1_plugin::connection
*self
,
713 gcc_type base_type
, int nunits
)
715 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
716 return convert_out (ctx
->preserve (build_vector_type (convert_in (base_type
),
721 plugin_build_constant (cc1_plugin::connection
*self
, gcc_type type_in
,
722 const char *name
, unsigned long value
,
723 const char *filename
, unsigned int line_number
)
725 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
727 tree type
= convert_in (type_in
);
729 cst
= build_int_cst (type
, value
);
730 decl
= build_decl (ctx
->get_location_t (filename
, line_number
),
731 CONST_DECL
, get_identifier (name
), type
);
732 DECL_INITIAL (decl
) = cst
;
733 pushdecl_safe (decl
);
739 plugin_error (cc1_plugin::connection
*,
742 error ("%s", message
);
743 return convert_out (error_mark_node
);
749 #pragma GCC visibility push(default)
753 plugin_init (struct plugin_name_args
*plugin_info
,
754 struct plugin_gcc_version
*)
756 generic_plugin_init (plugin_info
, GCC_C_FE_VERSION_1
);
758 register_callback (plugin_info
->base_name
, PLUGIN_PRAGMAS
,
759 plugin_init_extra_pragmas
, NULL
);
760 register_callback (plugin_info
->base_name
, PLUGIN_PRE_GENERICIZE
,
761 rewrite_decls_to_addresses
, NULL
);
763 #define GCC_METHOD0(R, N) \
765 cc1_plugin::callback_ftype *fun \
766 = cc1_plugin::invoker<R>::invoke<plugin_ ## N>; \
767 current_context->add_callback (# N, fun); \
769 #define GCC_METHOD1(R, N, A) \
771 cc1_plugin::callback_ftype *fun \
772 = cc1_plugin::invoker<R, A>::invoke<plugin_ ## N>; \
773 current_context->add_callback (# N, fun); \
775 #define GCC_METHOD2(R, N, A, B) \
777 cc1_plugin::callback_ftype *fun \
778 = cc1_plugin::invoker<R, A, B>::invoke<plugin_ ## N>; \
779 current_context->add_callback (# N, fun); \
781 #define GCC_METHOD3(R, N, A, B, C) \
783 cc1_plugin::callback_ftype *fun \
784 = cc1_plugin::invoker<R, A, B, C>::invoke<plugin_ ## N>; \
785 current_context->add_callback (# N, fun); \
787 #define GCC_METHOD4(R, N, A, B, C, D) \
789 cc1_plugin::callback_ftype *fun \
790 = cc1_plugin::invoker<R, A, B, C, \
791 D>::invoke<plugin_ ## N>; \
792 current_context->add_callback (# N, fun); \
794 #define GCC_METHOD5(R, N, A, B, C, D, E) \
796 cc1_plugin::callback_ftype *fun \
797 = cc1_plugin::invoker<R, A, B, C, D, \
798 E>::invoke<plugin_ ## N>; \
799 current_context->add_callback (# N, fun); \
801 #define GCC_METHOD7(R, N, A, B, C, D, E, F, G) \
803 cc1_plugin::callback_ftype *fun \
804 = cc1_plugin::invoker<R, A, B, C, D, \
805 E, F, G>::invoke<plugin_ ## N>; \
806 current_context->add_callback (# N, fun); \
809 #include "gcc-c-fe.def"