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 #define INCLUDE_VECTOR
36 #include "gcc-plugin.h"
38 #include "coretypes.h"
39 #include "stringpool.h"
41 #include "gcc-interface.h"
45 #include "double-int.h"
53 #include "fold-const.h"
54 #include "stor-layout.h"
58 #include "hash-table.h"
60 #include "c-family/c-pragma.h"
62 #include "diagnostic.h"
63 #include "langhooks.h"
64 #include "langhooks-def.h"
66 #include "callbacks.hh"
67 #include "connection.hh"
68 #include "marshall.hh"
70 #include "gcc-c-interface.h"
73 using namespace cc1_plugin
;
77 // A wrapper for pushdecl that doesn't let gdb have a chance to
78 // instantiate a symbol.
81 pushdecl_safe (tree decl
)
83 void (*save
) (enum c_oracle_request
, tree identifier
);
85 save
= c_binding_oracle
;
86 c_binding_oracle
= NULL
;
88 c_binding_oracle
= save
;
94 plugin_binding_oracle (enum c_oracle_request kind
, tree identifier
)
96 enum gcc_c_oracle_request request
;
98 gcc_assert (current_context
!= NULL
);
102 case C_ORACLE_SYMBOL
:
103 request
= GCC_C_ORACLE_SYMBOL
;
106 request
= GCC_C_ORACLE_TAG
;
109 request
= GCC_C_ORACLE_LABEL
;
116 cc1_plugin::call (current_context
, "binding_oracle", &ignore
,
117 request
, IDENTIFIER_POINTER (identifier
));
121 plugin_pragma_user_expression (cpp_reader
*)
123 c_binding_oracle
= plugin_binding_oracle
;
127 plugin_init_extra_pragmas (void *, void *)
129 c_register_pragma ("GCC", "user_expression", plugin_pragma_user_expression
);
134 // Maybe rewrite a decl to its address.
136 address_rewriter (tree
*in
, int *walk_subtrees
, void *arg
)
138 plugin_context
*ctx
= (plugin_context
*) arg
;
140 if (!DECL_P (*in
) || DECL_NAME (*in
) == NULL_TREE
)
143 decl_addr_value value
;
145 decl_addr_value
*found_value
= ctx
->address_map
.find (&value
);
146 if (found_value
!= NULL
)
148 else if (DECL_IS_UNDECLARED_BUILTIN (*in
))
152 if (!cc1_plugin::call (ctx
, "address_oracle", &address
,
153 IDENTIFIER_POINTER (DECL_NAME (*in
))))
158 // Insert the decl into the address map in case it is referenced
160 value
.address
= build_int_cst_type (ptr_type_node
, address
);
161 decl_addr_value
**slot
= ctx
->address_map
.find_slot (&value
, INSERT
);
162 gcc_assert (*slot
== NULL
);
164 = static_cast<decl_addr_value
*> (xmalloc (sizeof (decl_addr_value
)));
171 if (found_value
->address
!= error_mark_node
)
173 // We have an address for the decl, so rewrite the tree.
174 tree ptr_type
= build_pointer_type (TREE_TYPE (*in
));
175 *in
= fold_build1 (INDIRECT_REF
, TREE_TYPE (*in
),
176 fold_build1 (CONVERT_EXPR
, ptr_type
,
177 found_value
->address
));
185 // When generating code for gdb, we want to be able to use absolute
186 // addresses to refer to otherwise external objects that gdb knows
187 // about. gdb passes in these addresses when building decls, and then
188 // before gimplification we go through the trees, rewriting uses to
189 // the equivalent of "*(TYPE *) ADDR".
191 rewrite_decls_to_addresses (void *function_in
, void *)
193 tree function
= (tree
) function_in
;
195 // Do nothing if we're not in gdb.
196 if (current_context
== NULL
)
199 walk_tree (&DECL_SAVED_TREE (function
), address_rewriter
, current_context
,
206 plugin_build_decl (cc1_plugin::connection
*self
,
208 enum gcc_c_symbol_kind sym_kind
,
209 gcc_type sym_type_in
,
210 const char *substitution_name
,
212 const char *filename
,
213 unsigned int line_number
)
215 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
216 tree identifier
= get_identifier (name
);
219 tree sym_type
= convert_in (sym_type_in
);
223 case GCC_C_SYMBOL_FUNCTION
:
224 code
= FUNCTION_DECL
;
227 case GCC_C_SYMBOL_VARIABLE
:
231 case GCC_C_SYMBOL_TYPEDEF
:
235 case GCC_C_SYMBOL_LABEL
:
236 // FIXME: we aren't ready to handle labels yet.
237 // It isn't clear how to translate them properly
238 // and in any case a "goto" isn't likely to work.
239 return convert_out (error_mark_node
);
245 location_t loc
= ctx
->get_location_t (filename
, line_number
);
247 decl
= build_decl (loc
, code
, identifier
, sym_type
);
248 TREE_USED (decl
) = 1;
249 TREE_ADDRESSABLE (decl
) = 1;
251 if (sym_kind
!= GCC_C_SYMBOL_TYPEDEF
)
253 decl_addr_value value
;
255 DECL_EXTERNAL (decl
) = 1;
257 if (substitution_name
!= NULL
)
259 // If the translator gave us a name without a binding,
260 // we can just substitute error_mark_node, since we know the
261 // translator will be reporting an error anyhow.
263 = lookup_name (get_identifier (substitution_name
));
264 if (value
.address
== NULL_TREE
)
265 value
.address
= error_mark_node
;
268 value
.address
= build_int_cst_type (ptr_type_node
, address
);
269 decl_addr_value
**slot
= ctx
->address_map
.find_slot (&value
, INSERT
);
270 gcc_assert (*slot
== NULL
);
272 = static_cast<decl_addr_value
*> (xmalloc (sizeof (decl_addr_value
)));
276 return convert_out (ctx
->preserve (decl
));
280 plugin_bind (cc1_plugin::connection
*,
281 gcc_decl decl_in
, int is_global
)
283 tree decl
= convert_in (decl_in
);
284 c_bind (DECL_SOURCE_LOCATION (decl
), decl
, is_global
);
285 rest_of_decl_compilation (decl
, is_global
, 0);
290 plugin_tagbind (cc1_plugin::connection
*self
,
291 const char *name
, gcc_type tagged_type
,
292 const char *filename
, unsigned int line_number
)
294 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
295 tree t
= convert_in (tagged_type
), x
;
296 c_pushtag (ctx
->get_location_t (filename
, line_number
),
297 get_identifier (name
), t
);
299 /* Propagate the newly-added type name so that previously-created
300 variant types are not disconnected from their main variants. */
301 for (x
= TYPE_MAIN_VARIANT (t
); x
; x
= TYPE_NEXT_VARIANT (x
))
302 TYPE_NAME (x
) = TYPE_NAME (t
);
308 plugin_build_pointer_type (cc1_plugin::connection
*,
311 // No need to preserve a pointer type as the base type is preserved.
312 return convert_out (build_pointer_type (convert_in (base_type
)));
315 // TYPE_NAME needs to be a valid pointer, even if there is no name available.
318 build_anonymous_node (enum tree_code code
)
320 tree node
= make_node (code
);
321 tree type_decl
= build_decl (input_location
, TYPE_DECL
, NULL_TREE
, node
);
322 TYPE_NAME (node
) = type_decl
;
323 TYPE_STUB_DECL (node
) = type_decl
;
328 plugin_build_record_type (cc1_plugin::connection
*self
)
330 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
331 return convert_out (ctx
->preserve (build_anonymous_node (RECORD_TYPE
)));
335 plugin_build_union_type (cc1_plugin::connection
*self
)
337 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
338 return convert_out (ctx
->preserve (build_anonymous_node (UNION_TYPE
)));
342 plugin_build_add_field (cc1_plugin::connection
*,
343 gcc_type record_or_union_type_in
,
344 const char *field_name
,
345 gcc_type field_type_in
,
346 unsigned long bitsize
,
347 unsigned long bitpos
)
349 tree record_or_union_type
= convert_in (record_or_union_type_in
);
350 tree field_type
= convert_in (field_type_in
);
352 gcc_assert (TREE_CODE (record_or_union_type
) == RECORD_TYPE
353 || TREE_CODE (record_or_union_type
) == UNION_TYPE
);
355 /* Note that gdb does not preserve the location of field decls, so
356 we can't provide a decent location here. */
357 tree decl
= build_decl (BUILTINS_LOCATION
, FIELD_DECL
,
358 get_identifier (field_name
), field_type
);
359 DECL_FIELD_CONTEXT (decl
) = record_or_union_type
;
361 if (TREE_CODE (field_type
) == INTEGER_TYPE
362 && TYPE_PRECISION (field_type
) != bitsize
)
364 DECL_BIT_FIELD_TYPE (decl
) = field_type
;
366 = c_build_bitfield_integer_type (bitsize
, TYPE_UNSIGNED (field_type
));
369 SET_DECL_MODE (decl
, TYPE_MODE (TREE_TYPE (decl
)));
371 // There's no way to recover this from DWARF.
372 SET_DECL_OFFSET_ALIGN (decl
, TYPE_PRECISION (pointer_sized_int_node
));
374 tree pos
= bitsize_int (bitpos
);
375 pos_from_bit (&DECL_FIELD_OFFSET (decl
), &DECL_FIELD_BIT_OFFSET (decl
),
376 DECL_OFFSET_ALIGN (decl
), pos
);
378 DECL_SIZE (decl
) = bitsize_int (bitsize
);
379 DECL_SIZE_UNIT (decl
) = size_int ((bitsize
+ BITS_PER_UNIT
- 1)
382 DECL_CHAIN (decl
) = TYPE_FIELDS (record_or_union_type
);
383 TYPE_FIELDS (record_or_union_type
) = decl
;
389 plugin_finish_record_with_alignment (cc1_plugin::connection
*,
390 gcc_type record_or_union_type_in
,
391 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
);
411 align
= TYPE_PRECISION (pointer_sized_int_node
);
413 SET_TYPE_ALIGN (record_or_union_type
, align
);
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_finish_record_or_union (cc1_plugin::connection
*conn
,
446 gcc_type record_or_union_type_in
,
447 unsigned long size_in_bytes
)
449 return plugin_finish_record_with_alignment (conn
, record_or_union_type_in
,
454 plugin_build_enum_type (cc1_plugin::connection
*self
,
455 gcc_type underlying_int_type_in
)
457 tree underlying_int_type
= convert_in (underlying_int_type_in
);
459 if (underlying_int_type
== error_mark_node
)
460 return convert_out (error_mark_node
);
462 tree result
= build_anonymous_node (ENUMERAL_TYPE
);
464 TYPE_PRECISION (result
) = TYPE_PRECISION (underlying_int_type
);
465 TYPE_UNSIGNED (result
) = TYPE_UNSIGNED (underlying_int_type
);
466 ENUM_UNDERLYING_TYPE (result
) = underlying_int_type
;
468 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
469 return convert_out (ctx
->preserve (result
));
473 plugin_build_add_enum_constant (cc1_plugin::connection
*,
474 gcc_type enum_type_in
,
478 tree cst
, decl
, cons
;
479 tree enum_type
= convert_in (enum_type_in
);
481 gcc_assert (TREE_CODE (enum_type
) == ENUMERAL_TYPE
);
483 cst
= build_int_cst (enum_type
, value
);
484 /* Note that gdb does not preserve the location of enum constants,
485 so we can't provide a decent location here. */
486 decl
= build_decl (BUILTINS_LOCATION
, CONST_DECL
,
487 get_identifier (name
), enum_type
);
488 DECL_INITIAL (decl
) = cst
;
489 pushdecl_safe (decl
);
491 cons
= tree_cons (DECL_NAME (decl
), cst
, TYPE_VALUES (enum_type
));
492 TYPE_VALUES (enum_type
) = cons
;
498 plugin_finish_enum_type (cc1_plugin::connection
*,
499 gcc_type enum_type_in
)
501 tree enum_type
= convert_in (enum_type_in
);
502 tree minnode
, maxnode
, iter
;
504 iter
= TYPE_VALUES (enum_type
);
505 minnode
= maxnode
= TREE_VALUE (iter
);
506 for (iter
= TREE_CHAIN (iter
);
508 iter
= TREE_CHAIN (iter
))
510 tree value
= TREE_VALUE (iter
);
511 if (tree_int_cst_lt (maxnode
, value
))
513 if (tree_int_cst_lt (value
, minnode
))
516 TYPE_MIN_VALUE (enum_type
) = minnode
;
517 TYPE_MAX_VALUE (enum_type
) = maxnode
;
519 layout_type (enum_type
);
525 plugin_build_function_type (cc1_plugin::connection
*self
,
526 gcc_type return_type_in
,
527 const struct gcc_type_array
*argument_types_in
,
530 tree return_type
= convert_in (return_type_in
);
533 std::vector
<tree
> argument_types (argument_types_in
->n_elements
);
534 for (int i
= 0; i
< argument_types_in
->n_elements
; ++i
)
535 argument_types
[i
] = convert_in (argument_types_in
->elements
[i
]);
538 result
= build_varargs_function_type_array (return_type
,
539 argument_types_in
->n_elements
,
540 argument_types
.data ());
542 result
= build_function_type_array (return_type
,
543 argument_types_in
->n_elements
,
544 argument_types
.data ());
546 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
547 return convert_out (ctx
->preserve (result
));
550 /* Return a builtin type associated with BUILTIN_NAME. */
553 safe_lookup_builtin_type (const char *builtin_name
)
555 tree result
= NULL_TREE
;
560 result
= identifier_global_value (get_identifier (builtin_name
));
565 gcc_assert (TREE_CODE (result
) == TYPE_DECL
);
566 result
= TREE_TYPE (result
);
567 return TREE_CODE (result
) == ERROR_MARK
? nullptr : result
;
571 plugin_int_check (cc1_plugin::connection
*self
,
572 int is_unsigned
, unsigned long size_in_bytes
,
575 if (result
== NULL_TREE
)
576 result
= error_mark_node
;
579 gcc_assert (!TYPE_UNSIGNED (result
) == !is_unsigned
);
580 gcc_assert (TREE_CODE (TYPE_SIZE (result
)) == INTEGER_CST
);
581 gcc_assert (TYPE_PRECISION (result
) == BITS_PER_UNIT
* size_in_bytes
);
583 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
584 ctx
->preserve (result
);
586 return convert_out (result
);
590 plugin_int_type_v0 (cc1_plugin::connection
*self
,
591 int is_unsigned
, unsigned long size_in_bytes
)
593 tree result
= c_common_type_for_size (BITS_PER_UNIT
* size_in_bytes
,
596 return plugin_int_check (self
, is_unsigned
, size_in_bytes
, result
);
600 plugin_int_type (cc1_plugin::connection
*self
,
601 int is_unsigned
, unsigned long size_in_bytes
,
602 const char *builtin_name
)
604 if (builtin_name
!= nullptr)
606 tree result
= safe_lookup_builtin_type (builtin_name
);
607 gcc_assert (!result
|| TREE_CODE (result
) == INTEGER_TYPE
);
608 if (result
!= nullptr)
609 return plugin_int_check (self
, is_unsigned
, size_in_bytes
, result
);
611 return plugin_int_type_v0 (self
, is_unsigned
, size_in_bytes
);
615 plugin_char_type (cc1_plugin::connection
*)
617 return convert_out (char_type_node
);
621 plugin_float_type_v0 (cc1_plugin::connection
*,
622 unsigned long size_in_bytes
)
624 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (float_type_node
))
625 return convert_out (float_type_node
);
626 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (double_type_node
))
627 return convert_out (double_type_node
);
628 if (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (long_double_type_node
))
629 return convert_out (long_double_type_node
);
630 return convert_out (error_mark_node
);
634 plugin_float_type (cc1_plugin::connection
*self
,
635 unsigned long size_in_bytes
,
636 const char *builtin_name
)
639 return plugin_float_type_v0 (self
, size_in_bytes
);
641 tree result
= safe_lookup_builtin_type (builtin_name
);
644 return plugin_float_type_v0 (self
, size_in_bytes
);
646 gcc_assert (SCALAR_FLOAT_TYPE_P (result
));
647 gcc_assert (BITS_PER_UNIT
* size_in_bytes
== TYPE_PRECISION (result
));
649 return convert_out (result
);
653 plugin_void_type (cc1_plugin::connection
*)
655 return convert_out (void_type_node
);
659 plugin_bool_type (cc1_plugin::connection
*)
661 return convert_out (boolean_type_node
);
665 plugin_build_array_type (cc1_plugin::connection
*self
,
666 gcc_type element_type_in
, int num_elements
)
668 tree element_type
= convert_in (element_type_in
);
671 if (num_elements
== -1)
672 result
= build_array_type (element_type
, NULL_TREE
);
674 result
= build_array_type_nelts (element_type
, num_elements
);
676 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
677 return convert_out (ctx
->preserve (result
));
681 plugin_build_vla_array_type (cc1_plugin::connection
*self
,
682 gcc_type element_type_in
,
683 const char *upper_bound_name
)
685 tree element_type
= convert_in (element_type_in
);
686 tree upper_bound
= lookup_name (get_identifier (upper_bound_name
));
687 tree range
= build_index_type (upper_bound
);
689 tree result
= build_array_type (element_type
, range
);
690 C_TYPE_VARIABLE_SIZE (result
) = 1;
692 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
693 return convert_out (ctx
->preserve (result
));
697 plugin_build_qualified_type (cc1_plugin::connection
*,
698 gcc_type unqualified_type_in
,
699 enum gcc_qualifiers qualifiers
)
701 tree unqualified_type
= convert_in (unqualified_type_in
);
704 if ((qualifiers
& GCC_QUALIFIER_CONST
) != 0)
705 quals
|= TYPE_QUAL_CONST
;
706 if ((qualifiers
& GCC_QUALIFIER_VOLATILE
) != 0)
707 quals
|= TYPE_QUAL_VOLATILE
;
708 if ((qualifiers
& GCC_QUALIFIER_RESTRICT
) != 0)
709 quals
|= TYPE_QUAL_RESTRICT
;
711 return convert_out (build_qualified_type (unqualified_type
, quals
));
715 plugin_build_complex_type (cc1_plugin::connection
*self
,
718 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
719 return convert_out (ctx
->preserve (build_complex_type (convert_in (base_type
))));
723 plugin_build_vector_type (cc1_plugin::connection
*self
,
724 gcc_type base_type
, int nunits
)
726 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
727 return convert_out (ctx
->preserve (build_vector_type (convert_in (base_type
),
732 plugin_build_constant (cc1_plugin::connection
*self
, gcc_type type_in
,
733 const char *name
, unsigned long value
,
734 const char *filename
, unsigned int line_number
)
736 plugin_context
*ctx
= static_cast<plugin_context
*> (self
);
738 tree type
= convert_in (type_in
);
740 cst
= build_int_cst (type
, value
);
741 decl
= build_decl (ctx
->get_location_t (filename
, line_number
),
742 CONST_DECL
, get_identifier (name
), type
);
743 DECL_INITIAL (decl
) = cst
;
744 pushdecl_safe (decl
);
750 plugin_error (cc1_plugin::connection
*,
753 error ("%s", message
);
754 return convert_out (error_mark_node
);
760 #pragma GCC visibility push(default)
764 plugin_init (struct plugin_name_args
*plugin_info
,
765 struct plugin_gcc_version
*)
767 generic_plugin_init (plugin_info
, GCC_C_FE_VERSION_2
);
769 register_callback (plugin_info
->base_name
, PLUGIN_PRAGMAS
,
770 plugin_init_extra_pragmas
, NULL
);
771 register_callback (plugin_info
->base_name
, PLUGIN_PRE_GENERICIZE
,
772 rewrite_decls_to_addresses
, NULL
);
774 #define GCC_METHOD0(R, N) \
776 cc1_plugin::callback_ftype *fun \
777 = cc1_plugin::invoker<R>::invoke<plugin_ ## N>; \
778 current_context->add_callback (# N, fun); \
780 #define GCC_METHOD1(R, N, A) \
782 cc1_plugin::callback_ftype *fun \
783 = cc1_plugin::invoker<R, A>::invoke<plugin_ ## N>; \
784 current_context->add_callback (# N, fun); \
786 #define GCC_METHOD2(R, N, A, B) \
788 cc1_plugin::callback_ftype *fun \
789 = cc1_plugin::invoker<R, A, B>::invoke<plugin_ ## N>; \
790 current_context->add_callback (# N, fun); \
792 #define GCC_METHOD3(R, N, A, B, C) \
794 cc1_plugin::callback_ftype *fun \
795 = cc1_plugin::invoker<R, A, B, C>::invoke<plugin_ ## N>; \
796 current_context->add_callback (# N, fun); \
798 #define GCC_METHOD4(R, N, A, B, C, D) \
800 cc1_plugin::callback_ftype *fun \
801 = cc1_plugin::invoker<R, A, B, C, \
802 D>::invoke<plugin_ ## N>; \
803 current_context->add_callback (# N, fun); \
805 #define GCC_METHOD5(R, N, A, B, C, D, E) \
807 cc1_plugin::callback_ftype *fun \
808 = cc1_plugin::invoker<R, A, B, C, D, \
809 E>::invoke<plugin_ ## N>; \
810 current_context->add_callback (# N, fun); \
812 #define GCC_METHOD7(R, N, A, B, C, D, E, F, G) \
814 cc1_plugin::callback_ftype *fun \
815 = cc1_plugin::invoker<R, A, B, C, D, \
816 E, F, G>::invoke<plugin_ ## N>; \
817 current_context->add_callback (# N, fun); \
820 #include "gcc-c-fe.def"