1 /* Library interface to C front end
2 Copyright (C) 2014-2024 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
);
457 ENUM_UNDERLYING_TYPE (result
) = underlying_int_type
;
459 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
460 return convert_out (ctx
->preserve (result
));
464 plugin_build_add_enum_constant (cc1_plugin::connection
*,
465 gcc_type enum_type_in
,
469 tree cst
, decl
, cons
;
470 tree enum_type
= convert_in (enum_type_in
);
472 gcc_assert (TREE_CODE (enum_type
) == ENUMERAL_TYPE
);
474 cst
= build_int_cst (enum_type
, value
);
475 /* Note that gdb does not preserve the location of enum constants,
476 so we can't provide a decent location here. */
477 decl
= build_decl (BUILTINS_LOCATION
, CONST_DECL
,
478 get_identifier (name
), enum_type
);
479 DECL_INITIAL (decl
) = cst
;
480 pushdecl_safe (decl
);
482 cons
= tree_cons (DECL_NAME (decl
), cst
, TYPE_VALUES (enum_type
));
483 TYPE_VALUES (enum_type
) = cons
;
489 plugin_finish_enum_type (cc1_plugin::connection
*,
490 gcc_type enum_type_in
)
492 tree enum_type
= convert_in (enum_type_in
);
493 tree minnode
, maxnode
, iter
;
495 iter
= TYPE_VALUES (enum_type
);
496 minnode
= maxnode
= TREE_VALUE (iter
);
497 for (iter
= TREE_CHAIN (iter
);
499 iter
= TREE_CHAIN (iter
))
501 tree value
= TREE_VALUE (iter
);
502 if (tree_int_cst_lt (maxnode
, value
))
504 if (tree_int_cst_lt (value
, minnode
))
507 TYPE_MIN_VALUE (enum_type
) = minnode
;
508 TYPE_MAX_VALUE (enum_type
) = maxnode
;
510 layout_type (enum_type
);
516 plugin_build_function_type (cc1_plugin::connection
*self
,
517 gcc_type return_type_in
,
518 const struct gcc_type_array
*argument_types_in
,
521 tree return_type
= convert_in (return_type_in
);
524 std::vector
<tree
> argument_types (argument_types_in
->n_elements
);
525 for (int i
= 0; i
< argument_types_in
->n_elements
; ++i
)
526 argument_types
[i
] = convert_in (argument_types_in
->elements
[i
]);
529 result
= build_varargs_function_type_array (return_type
,
530 argument_types_in
->n_elements
,
531 argument_types
.data ());
533 result
= build_function_type_array (return_type
,
534 argument_types_in
->n_elements
,
535 argument_types
.data ());
537 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
538 return convert_out (ctx
->preserve (result
));
541 /* Return a builtin type associated with BUILTIN_NAME. */
544 safe_lookup_builtin_type (const char *builtin_name
)
546 tree result
= NULL_TREE
;
551 result
= identifier_global_value (get_identifier (builtin_name
));
556 gcc_assert (TREE_CODE (result
) == TYPE_DECL
);
557 result
= TREE_TYPE (result
);
562 plugin_int_check (cc1_plugin::connection
*self
,
563 int is_unsigned
, unsigned long size_in_bytes
,
566 if (result
== NULL_TREE
)
567 result
= error_mark_node
;
570 gcc_assert (!TYPE_UNSIGNED (result
) == !is_unsigned
);
571 gcc_assert (TREE_CODE (TYPE_SIZE (result
)) == INTEGER_CST
);
572 gcc_assert (TYPE_PRECISION (result
) == BITS_PER_UNIT
* size_in_bytes
);
574 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
575 ctx
->preserve (result
);
577 return convert_out (result
);
581 plugin_int_type_v0 (cc1_plugin::connection
*self
,
582 int is_unsigned
, unsigned long size_in_bytes
)
584 tree result
= c_common_type_for_size (BITS_PER_UNIT
* size_in_bytes
,
587 return plugin_int_check (self
, is_unsigned
, size_in_bytes
, result
);
591 plugin_int_type (cc1_plugin::connection
*self
,
592 int is_unsigned
, unsigned long size_in_bytes
,
593 const char *builtin_name
)
596 return plugin_int_type_v0 (self
, is_unsigned
, size_in_bytes
);
598 tree result
= safe_lookup_builtin_type (builtin_name
);
599 gcc_assert (!result
|| TREE_CODE (result
) == INTEGER_TYPE
);
601 return plugin_int_check (self
, is_unsigned
, size_in_bytes
, result
);
605 plugin_char_type (cc1_plugin::connection
*)
607 return convert_out (char_type_node
);
611 plugin_float_type_v0 (cc1_plugin::connection
*,
612 unsigned long size_in_bytes
)
614 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (float_type_node
))
615 return convert_out (float_type_node
);
616 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (double_type_node
))
617 return convert_out (double_type_node
);
618 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (long_double_type_node
))
619 return convert_out (long_double_type_node
);
620 return convert_out (error_mark_node
);
624 plugin_float_type (cc1_plugin::connection
*self
,
625 unsigned long size_in_bytes
,
626 const char *builtin_name
)
629 return plugin_float_type_v0 (self
, size_in_bytes
);
631 tree result
= safe_lookup_builtin_type (builtin_name
);
634 return convert_out (error_mark_node
);
636 gcc_assert (SCALAR_FLOAT_TYPE_P (result
));
637 gcc_assert (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (result
));
639 return convert_out (result
);
643 plugin_void_type (cc1_plugin::connection
*)
645 return convert_out (void_type_node
);
649 plugin_bool_type (cc1_plugin::connection
*)
651 return convert_out (boolean_type_node
);
655 plugin_build_array_type (cc1_plugin::connection
*self
,
656 gcc_type element_type_in
, int num_elements
)
658 tree element_type
= convert_in (element_type_in
);
661 if (num_elements
== -1)
662 result
= build_array_type (element_type
, NULL_TREE
);
664 result
= build_array_type_nelts (element_type
, num_elements
);
666 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
667 return convert_out (ctx
->preserve (result
));
671 plugin_build_vla_array_type (cc1_plugin::connection
*self
,
672 gcc_type element_type_in
,
673 const char *upper_bound_name
)
675 tree element_type
= convert_in (element_type_in
);
676 tree upper_bound
= lookup_name (get_identifier (upper_bound_name
));
677 tree range
= build_index_type (upper_bound
);
679 tree result
= build_array_type (element_type
, range
);
680 C_TYPE_VARIABLE_SIZE (result
) = 1;
682 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
683 return convert_out (ctx
->preserve (result
));
687 plugin_build_qualified_type (cc1_plugin::connection
*,
688 gcc_type unqualified_type_in
,
689 enum gcc_qualifiers qualifiers
)
691 tree unqualified_type
= convert_in (unqualified_type_in
);
694 if ((qualifiers
& GCC_QUALIFIER_CONST
) != 0)
695 quals
|= TYPE_QUAL_CONST
;
696 if ((qualifiers
& GCC_QUALIFIER_VOLATILE
) != 0)
697 quals
|= TYPE_QUAL_VOLATILE
;
698 if ((qualifiers
& GCC_QUALIFIER_RESTRICT
) != 0)
699 quals
|= TYPE_QUAL_RESTRICT
;
701 return convert_out (build_qualified_type (unqualified_type
, quals
));
705 plugin_build_complex_type (cc1_plugin::connection
*self
,
708 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
709 return convert_out (ctx
->preserve (build_complex_type (convert_in (base_type
))));
713 plugin_build_vector_type (cc1_plugin::connection
*self
,
714 gcc_type base_type
, int nunits
)
716 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
717 return convert_out (ctx
->preserve (build_vector_type (convert_in (base_type
),
722 plugin_build_constant (cc1_plugin::connection
*self
, gcc_type type_in
,
723 const char *name
, unsigned long value
,
724 const char *filename
, unsigned int line_number
)
726 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
728 tree type
= convert_in (type_in
);
730 cst
= build_int_cst (type
, value
);
731 decl
= build_decl (ctx
->get_location_t (filename
, line_number
),
732 CONST_DECL
, get_identifier (name
), type
);
733 DECL_INITIAL (decl
) = cst
;
734 pushdecl_safe (decl
);
740 plugin_error (cc1_plugin::connection
*,
743 error ("%s", message
);
744 return convert_out (error_mark_node
);
750 #pragma GCC visibility push(default)
754 plugin_init (struct plugin_name_args
*plugin_info
,
755 struct plugin_gcc_version
*)
757 generic_plugin_init (plugin_info
, GCC_C_FE_VERSION_1
);
759 register_callback (plugin_info
->base_name
, PLUGIN_PRAGMAS
,
760 plugin_init_extra_pragmas
, NULL
);
761 register_callback (plugin_info
->base_name
, PLUGIN_PRE_GENERICIZE
,
762 rewrite_decls_to_addresses
, NULL
);
764 #define GCC_METHOD0(R, N) \
766 cc1_plugin::callback_ftype *fun \
767 = cc1_plugin::invoker<R>::invoke<plugin_ ## N>; \
768 current_context->add_callback (# N, fun); \
770 #define GCC_METHOD1(R, N, A) \
772 cc1_plugin::callback_ftype *fun \
773 = cc1_plugin::invoker<R, A>::invoke<plugin_ ## N>; \
774 current_context->add_callback (# N, fun); \
776 #define GCC_METHOD2(R, N, A, B) \
778 cc1_plugin::callback_ftype *fun \
779 = cc1_plugin::invoker<R, A, B>::invoke<plugin_ ## N>; \
780 current_context->add_callback (# N, fun); \
782 #define GCC_METHOD3(R, N, A, B, C) \
784 cc1_plugin::callback_ftype *fun \
785 = cc1_plugin::invoker<R, A, B, C>::invoke<plugin_ ## N>; \
786 current_context->add_callback (# N, fun); \
788 #define GCC_METHOD4(R, N, A, B, C, D) \
790 cc1_plugin::callback_ftype *fun \
791 = cc1_plugin::invoker<R, A, B, C, \
792 D>::invoke<plugin_ ## N>; \
793 current_context->add_callback (# N, fun); \
795 #define GCC_METHOD5(R, N, A, B, C, D, E) \
797 cc1_plugin::callback_ftype *fun \
798 = cc1_plugin::invoker<R, A, B, C, D, \
799 E>::invoke<plugin_ ## N>; \
800 current_context->add_callback (# N, fun); \
802 #define GCC_METHOD7(R, N, A, B, C, D, E, F, G) \
804 cc1_plugin::callback_ftype *fun \
805 = cc1_plugin::invoker<R, A, B, C, D, \
806 E, F, G>::invoke<plugin_ ## N>; \
807 current_context->add_callback (# N, fun); \
810 #include "gcc-c-fe.def"