1 /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
2 Copyright (C) 1992-2019 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/>. */
22 #include "coretypes.h"
24 #include "function.h" /* For cfun. */
27 #include "tm_p.h" /* For REGISTER_TARGET_PRAGMAS. */
28 #include "stringpool.h"
30 #include "diagnostic.h"
36 #include "opt-suggestions.h"
38 #define GCC_BAD(gmsgid) \
39 do { warning (OPT_Wpragmas, gmsgid); return; } while (0)
40 #define GCC_BAD2(gmsgid, arg) \
41 do { warning (OPT_Wpragmas, gmsgid, arg); return; } while (0)
43 struct GTY(()) align_stack
{
46 struct align_stack
* prev
;
49 static GTY(()) struct align_stack
* alignment_stack
;
51 static void handle_pragma_pack (cpp_reader
*);
53 /* If we have a "global" #pragma pack(<n>) in effect when the first
54 #pragma pack(push,<n>) is encountered, this stores the value of
55 maximum_field_alignment in effect. When the final pop_alignment()
56 happens, we restore the value to this, not to a value of 0 for
57 maximum_field_alignment. Value is in bits. */
58 static int default_alignment
;
59 #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \
60 ? &default_alignment \
61 : &alignment_stack->alignment) = (ALIGN))
63 static void push_alignment (int, tree
);
64 static void pop_alignment (tree
);
66 /* Push an alignment value onto the stack. */
68 push_alignment (int alignment
, tree id
)
70 align_stack
* entry
= ggc_alloc
<align_stack
> ();
72 entry
->alignment
= alignment
;
74 entry
->prev
= alignment_stack
;
76 /* The current value of maximum_field_alignment is not necessarily
77 0 since there may be a #pragma pack(<n>) in effect; remember it
78 so that we can restore it after the final #pragma pop(). */
79 if (alignment_stack
== NULL
)
80 default_alignment
= maximum_field_alignment
;
82 alignment_stack
= entry
;
84 maximum_field_alignment
= alignment
;
87 /* Undo a push of an alignment onto the stack. */
89 pop_alignment (tree id
)
93 if (alignment_stack
== NULL
)
94 GCC_BAD ("%<#pragma pack (pop)%> encountered without matching "
95 "%<#pragma pack (push)%>");
97 /* If we got an identifier, strip away everything above the target
98 entry so that the next step will restore the state just below it. */
101 for (entry
= alignment_stack
; entry
; entry
= entry
->prev
)
104 alignment_stack
= entry
;
108 warning (OPT_Wpragmas
,
109 "%<#pragma pack(pop, %E)%> encountered without matching "
110 "%<#pragma pack(push, %E)%>"
114 entry
= alignment_stack
->prev
;
116 maximum_field_alignment
= entry
? entry
->alignment
: default_alignment
;
118 alignment_stack
= entry
;
125 #pragma pack (push, N)
126 #pragma pack (push, ID)
127 #pragma pack (push, ID, N)
129 #pragma pack (pop, ID) */
131 handle_pragma_pack (cpp_reader
* ARG_UNUSED (dummy
))
135 enum cpp_ttype token
;
136 enum { set
, push
, pop
} action
;
138 if (pragma_lex (&x
) != CPP_OPEN_PAREN
)
139 GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
141 token
= pragma_lex (&x
);
142 if (token
== CPP_CLOSE_PAREN
)
145 align
= initial_max_fld_align
;
147 else if (token
== CPP_NUMBER
)
149 if (TREE_CODE (x
) != INTEGER_CST
)
150 GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
151 align
= TREE_INT_CST_LOW (x
);
153 if (pragma_lex (&x
) != CPP_CLOSE_PAREN
)
154 GCC_BAD ("malformed %<#pragma pack%> - ignored");
156 else if (token
== CPP_NAME
)
158 #define GCC_BAD_ACTION do { if (action != pop) \
159 GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
161 GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
164 const char *op
= IDENTIFIER_POINTER (x
);
165 if (!strcmp (op
, "push"))
167 else if (!strcmp (op
, "pop"))
170 GCC_BAD2 ("unknown action %qE for %<#pragma pack%> - ignored", x
);
172 while ((token
= pragma_lex (&x
)) == CPP_COMMA
)
174 token
= pragma_lex (&x
);
175 if (token
== CPP_NAME
&& id
== 0)
179 else if (token
== CPP_NUMBER
&& action
== push
&& align
== -1)
181 if (TREE_CODE (x
) != INTEGER_CST
)
182 GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
183 align
= TREE_INT_CST_LOW (x
);
191 if (token
!= CPP_CLOSE_PAREN
)
193 #undef GCC_BAD_ACTION
196 GCC_BAD ("malformed %<#pragma pack%> - ignored");
198 if (pragma_lex (&x
) != CPP_EOF
)
199 warning (OPT_Wpragmas
, "junk at end of %<#pragma pack%>");
201 if (flag_pack_struct
)
202 GCC_BAD ("%<#pragma pack%> has no effect with %<-fpack-struct%> - ignored");
213 align
*= BITS_PER_UNIT
;
218 align
= maximum_field_alignment
;
223 GCC_BAD2 ("alignment must be a small power of two, not %d", align
);
228 case set
: SET_GLOBAL_ALIGNMENT (align
); break;
229 case push
: push_alignment (align
, id
); break;
230 case pop
: pop_alignment (id
); break;
234 struct GTY(()) pending_weak
241 static GTY(()) vec
<pending_weak
, va_gc
> *pending_weaks
;
243 static void apply_pragma_weak (tree
, tree
);
244 static void handle_pragma_weak (cpp_reader
*);
247 apply_pragma_weak (tree decl
, tree value
)
251 value
= build_string (IDENTIFIER_LENGTH (value
),
252 IDENTIFIER_POINTER (value
));
253 decl_attributes (&decl
, build_tree_list (get_identifier ("alias"),
254 build_tree_list (NULL
, value
)),
258 if (SUPPORTS_WEAK
&& DECL_EXTERNAL (decl
) && TREE_USED (decl
)
259 && !DECL_WEAK (decl
) /* Don't complain about a redundant #pragma. */
260 && DECL_ASSEMBLER_NAME_SET_P (decl
)
261 && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl
)))
262 warning (OPT_Wpragmas
, "applying %<#pragma weak %+D%> after first use "
263 "results in unspecified behavior", decl
);
269 maybe_apply_pragma_weak (tree decl
)
275 /* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
277 /* No weak symbols pending, take the short-cut. */
278 if (vec_safe_is_empty (pending_weaks
))
280 /* If it's not visible outside this file, it doesn't matter whether
282 if (!DECL_EXTERNAL (decl
) && !TREE_PUBLIC (decl
))
284 /* If it's not a function or a variable, it can't be weak.
285 FIXME: what kinds of things are visible outside this file but
286 aren't functions or variables? Should this be an assert instead? */
287 if (!VAR_OR_FUNCTION_DECL_P (decl
))
290 if (DECL_ASSEMBLER_NAME_SET_P (decl
))
291 id
= DECL_ASSEMBLER_NAME (decl
);
294 id
= DECL_ASSEMBLER_NAME (decl
);
295 SET_DECL_ASSEMBLER_NAME (decl
, NULL_TREE
);
298 FOR_EACH_VEC_ELT (*pending_weaks
, i
, pe
)
301 apply_pragma_weak (decl
, pe
->value
);
302 pending_weaks
->unordered_remove (i
);
307 /* Process all "#pragma weak A = B" directives where we have not seen
310 maybe_apply_pending_pragma_weaks (void)
312 tree alias_id
, id
, decl
;
317 if (vec_safe_is_empty (pending_weaks
))
320 FOR_EACH_VEC_ELT (*pending_weaks
, i
, pe
)
328 target
= symtab_node::get_for_asmname (id
);
329 decl
= build_decl (UNKNOWN_LOCATION
,
330 target
? TREE_CODE (target
->decl
) : FUNCTION_DECL
,
331 alias_id
, default_function_type
);
333 DECL_ARTIFICIAL (decl
) = 1;
334 TREE_PUBLIC (decl
) = 1;
335 DECL_WEAK (decl
) = 1;
337 TREE_STATIC (decl
) = 1;
340 error ("%q+D aliased to undefined symbol %qE",
345 assemble_alias (decl
, id
);
349 /* #pragma weak name [= value] */
351 handle_pragma_weak (cpp_reader
* ARG_UNUSED (dummy
))
353 tree name
, value
, x
, decl
;
358 if (pragma_lex (&name
) != CPP_NAME
)
359 GCC_BAD ("malformed %<#pragma weak%>, ignored");
363 if (pragma_lex (&value
) != CPP_NAME
)
364 GCC_BAD ("%<malformed #pragma weak%>, ignored");
368 warning (OPT_Wpragmas
, "junk at end of %<#pragma weak%>");
370 decl
= identifier_global_value (name
);
371 if (decl
&& DECL_P (decl
))
373 if (!VAR_OR_FUNCTION_DECL_P (decl
))
374 GCC_BAD2 ("%<#pragma weak%> declaration of %q+D not allowed,"
376 apply_pragma_weak (decl
, value
);
379 DECL_EXTERNAL (decl
) = 0;
381 TREE_STATIC (decl
) = 1;
382 assemble_alias (decl
, value
);
387 pending_weak pe
= {name
, value
};
388 vec_safe_push (pending_weaks
, pe
);
392 static enum scalar_storage_order_kind global_sso
;
395 maybe_apply_pragma_scalar_storage_order (tree type
)
397 if (global_sso
== SSO_NATIVE
)
400 gcc_assert (RECORD_OR_UNION_TYPE_P (type
));
402 if (lookup_attribute ("scalar_storage_order", TYPE_ATTRIBUTES (type
)))
405 if (global_sso
== SSO_BIG_ENDIAN
)
406 TYPE_REVERSE_STORAGE_ORDER (type
) = !BYTES_BIG_ENDIAN
;
407 else if (global_sso
== SSO_LITTLE_ENDIAN
)
408 TYPE_REVERSE_STORAGE_ORDER (type
) = BYTES_BIG_ENDIAN
;
414 handle_pragma_scalar_storage_order (cpp_reader
*ARG_UNUSED(dummy
))
416 const char *kind_string
;
417 enum cpp_ttype token
;
420 if (BYTES_BIG_ENDIAN
!= WORDS_BIG_ENDIAN
)
422 error ("%<scalar_storage_order%> is not supported because endianness "
427 if (c_dialect_cxx ())
429 if (warn_unknown_pragmas
> in_system_header_at (input_location
))
430 warning (OPT_Wunknown_pragmas
,
431 "%<#pragma scalar_storage_order%> is not supported for C++");
435 token
= pragma_lex (&x
);
436 if (token
!= CPP_NAME
)
437 GCC_BAD ("missing [big-endian|little-endian|default] after %<#pragma scalar_storage_order%>");
438 kind_string
= IDENTIFIER_POINTER (x
);
439 if (strcmp (kind_string
, "default") == 0)
440 global_sso
= default_sso
;
441 else if (strcmp (kind_string
, "big") == 0)
442 global_sso
= SSO_BIG_ENDIAN
;
443 else if (strcmp (kind_string
, "little") == 0)
444 global_sso
= SSO_LITTLE_ENDIAN
;
446 GCC_BAD ("expected [big-endian|little-endian|default] after %<#pragma scalar_storage_order%>");
449 /* GCC supports two #pragma directives for renaming the external
450 symbol associated with a declaration (DECL_ASSEMBLER_NAME), for
451 compatibility with the Solaris and VMS system headers. GCC also
452 has its own notation for this, __asm__("name") annotations.
454 Corner cases of these features and their interaction:
456 1) Both pragmas silently apply only to declarations with external
457 linkage (that is, TREE_PUBLIC || DECL_EXTERNAL). Asm labels
458 do not have this restriction.
460 2) In C++, both #pragmas silently apply only to extern "C" declarations.
461 Asm labels do not have this restriction.
463 3) If any of the three ways of changing DECL_ASSEMBLER_NAME is
464 applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the
465 new name is different, a warning issues and the name does not change.
467 4) The "source name" for #pragma redefine_extname is the DECL_NAME,
468 *not* the DECL_ASSEMBLER_NAME.
470 5) If #pragma extern_prefix is in effect and a declaration occurs
471 with an __asm__ name, the #pragma extern_prefix is silently
472 ignored for that declaration.
474 6) If #pragma extern_prefix and #pragma redefine_extname apply to
475 the same declaration, whichever triggered first wins, and a warning
476 is issued. (We would like to have #pragma redefine_extname always
477 win, but it can appear either before or after the declaration, and
478 if it appears afterward, we have no way of knowing whether a modified
479 DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.) */
481 struct GTY(()) pending_redefinition
{
487 static GTY(()) vec
<pending_redefinition
, va_gc
> *pending_redefine_extname
;
489 static void handle_pragma_redefine_extname (cpp_reader
*);
491 /* #pragma redefine_extname oldname newname */
493 handle_pragma_redefine_extname (cpp_reader
* ARG_UNUSED (dummy
))
495 tree oldname
, newname
, decls
, x
;
499 if (pragma_lex (&oldname
) != CPP_NAME
)
500 GCC_BAD ("malformed %<#pragma redefine_extname%>, ignored");
501 if (pragma_lex (&newname
) != CPP_NAME
)
502 GCC_BAD ("malformed %<#pragma redefine_extname%>, ignored");
505 warning (OPT_Wpragmas
, "junk at end of %<#pragma redefine_extname%>");
508 for (decls
= c_linkage_bindings (oldname
);
512 if (TREE_CODE (decls
) == TREE_LIST
)
514 decl
= TREE_VALUE (decls
);
515 decls
= TREE_CHAIN (decls
);
523 if ((TREE_PUBLIC (decl
) || DECL_EXTERNAL (decl
))
524 && VAR_OR_FUNCTION_DECL_P (decl
))
527 if (DECL_ASSEMBLER_NAME_SET_P (decl
))
529 const char *name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
530 name
= targetm
.strip_name_encoding (name
);
532 if (!id_equal (newname
, name
))
533 warning (OPT_Wpragmas
, "%<#pragma redefine_extname%> "
534 "ignored due to conflict with previous rename");
537 symtab
->change_decl_assembler_name (decl
, newname
);
542 /* We have to add this to the rename list even if there's already
543 a global value that doesn't meet the above criteria, because in
544 C++ "struct foo {...};" puts "foo" in the current namespace but
545 does *not* conflict with a subsequent declaration of a function
546 or variable foo. See g++.dg/other/pragma-re-2.C. */
547 add_to_renaming_pragma_list (oldname
, newname
);
550 /* This is called from here and from ia64-c.c. */
552 add_to_renaming_pragma_list (tree oldname
, tree newname
)
555 pending_redefinition
*p
;
557 FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname
, ix
, p
)
558 if (oldname
== p
->oldname
)
560 if (p
->newname
!= newname
)
561 warning (OPT_Wpragmas
, "%<#pragma redefine_extname%> ignored due to "
562 "conflict with previous %<#pragma redefine_extname%>");
566 pending_redefinition e
= {oldname
, newname
};
567 vec_safe_push (pending_redefine_extname
, e
);
570 /* The current prefix set by #pragma extern_prefix. */
571 GTY(()) tree pragma_extern_prefix
;
573 /* Hook from the front ends to apply the results of one of the preceding
574 pragmas that rename variables. */
577 maybe_apply_renaming_pragma (tree decl
, tree asmname
)
580 pending_redefinition
*p
;
582 /* The renaming pragmas are only applied to declarations with
584 if (!VAR_OR_FUNCTION_DECL_P (decl
)
585 || (!TREE_PUBLIC (decl
) && !DECL_EXTERNAL (decl
))
586 || !has_c_linkage (decl
))
589 /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
590 but we may warn about a rename that conflicts. */
591 if (DECL_ASSEMBLER_NAME_SET_P (decl
))
593 const char *oldname
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
594 oldname
= targetm
.strip_name_encoding (oldname
);
596 if (asmname
&& strcmp (TREE_STRING_POINTER (asmname
), oldname
))
597 warning (OPT_Wpragmas
, "%<asm%> declaration ignored due to "
598 "conflict with previous rename");
600 /* Take any pending redefine_extname off the list. */
601 FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname
, ix
, p
)
602 if (DECL_NAME (decl
) == p
->oldname
)
604 /* Only warn if there is a conflict. */
605 if (!id_equal (p
->newname
, oldname
))
606 warning (OPT_Wpragmas
, "%<#pragma redefine_extname%> ignored "
607 "due to conflict with previous rename");
609 pending_redefine_extname
->unordered_remove (ix
);
615 /* Find out if we have a pending #pragma redefine_extname. */
616 FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname
, ix
, p
)
617 if (DECL_NAME (decl
) == p
->oldname
)
619 tree newname
= p
->newname
;
620 pending_redefine_extname
->unordered_remove (ix
);
622 /* If we already have an asmname, #pragma redefine_extname is
623 ignored (with a warning if it conflicts). */
626 if (strcmp (TREE_STRING_POINTER (asmname
),
627 IDENTIFIER_POINTER (newname
)) != 0)
628 warning (OPT_Wpragmas
, "%<#pragma redefine_extname%> ignored "
629 "due to conflict with %<asm%> declaration");
633 /* Otherwise we use what we've got; #pragma extern_prefix is
635 return build_string (IDENTIFIER_LENGTH (newname
),
636 IDENTIFIER_POINTER (newname
));
639 /* If we've got an asmname, #pragma extern_prefix is silently ignored. */
643 /* If #pragma extern_prefix is in effect, apply it. */
644 if (pragma_extern_prefix
)
646 const char *prefix
= TREE_STRING_POINTER (pragma_extern_prefix
);
647 size_t plen
= TREE_STRING_LENGTH (pragma_extern_prefix
) - 1;
649 const char *id
= IDENTIFIER_POINTER (DECL_NAME (decl
));
650 size_t ilen
= IDENTIFIER_LENGTH (DECL_NAME (decl
));
652 char *newname
= (char *) alloca (plen
+ ilen
+ 1);
654 memcpy (newname
, prefix
, plen
);
655 memcpy (newname
+ plen
, id
, ilen
+ 1);
657 return build_string (plen
+ ilen
, newname
);
665 static void handle_pragma_visibility (cpp_reader
*);
667 static vec
<int> visstack
;
669 /* Push the visibility indicated by STR onto the top of the #pragma
670 visibility stack. KIND is 0 for #pragma GCC visibility, 1 for
671 C++ namespace with visibility attribute and 2 for C++ builtin
672 ABI namespace. push_visibility/pop_visibility calls must have
673 matching KIND, it is not allowed to push visibility using one
674 KIND and pop using a different one. */
677 push_visibility (const char *str
, int kind
)
679 visstack
.safe_push (((int) default_visibility
) | (kind
<< 8));
680 if (!strcmp (str
, "default"))
681 default_visibility
= VISIBILITY_DEFAULT
;
682 else if (!strcmp (str
, "internal"))
683 default_visibility
= VISIBILITY_INTERNAL
;
684 else if (!strcmp (str
, "hidden"))
685 default_visibility
= VISIBILITY_HIDDEN
;
686 else if (!strcmp (str
, "protected"))
687 default_visibility
= VISIBILITY_PROTECTED
;
689 GCC_BAD ("%<#pragma GCC visibility push()%> must specify %<default%>, "
690 "%<internal%>, %<hidden%> or %<protected%>");
691 visibility_options
.inpragma
= 1;
694 /* Pop a level of the #pragma visibility stack. Return true if
698 pop_visibility (int kind
)
700 if (!visstack
.length ())
702 if ((visstack
.last () >> 8) != kind
)
705 = (enum symbol_visibility
) (visstack
.pop () & 0xff);
706 visibility_options
.inpragma
707 = visstack
.length () != 0;
711 /* Sets the default visibility for symbols to something other than that
712 specified on the command line. */
715 handle_pragma_visibility (cpp_reader
*dummy ATTRIBUTE_UNUSED
)
717 /* Form is #pragma GCC visibility push(hidden)|pop */
719 enum cpp_ttype token
;
720 enum { bad
, push
, pop
} action
= bad
;
722 token
= pragma_lex (&x
);
723 if (token
== CPP_NAME
)
725 const char *op
= IDENTIFIER_POINTER (x
);
726 if (!strcmp (op
, "push"))
728 else if (!strcmp (op
, "pop"))
732 GCC_BAD ("%<#pragma GCC visibility%> must be followed by %<push%> "
738 if (! pop_visibility (0))
739 GCC_BAD ("no matching push for %<#pragma GCC visibility pop%>");
743 if (pragma_lex (&x
) != CPP_OPEN_PAREN
)
744 GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
745 token
= pragma_lex (&x
);
746 if (token
!= CPP_NAME
)
747 GCC_BAD ("malformed %<#pragma GCC visibility push%>");
749 push_visibility (IDENTIFIER_POINTER (x
), 0);
750 if (pragma_lex (&x
) != CPP_CLOSE_PAREN
)
751 GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
754 if (pragma_lex (&x
) != CPP_EOF
)
755 warning (OPT_Wpragmas
, "junk at end of %<#pragma GCC visibility%>");
759 handle_pragma_diagnostic(cpp_reader
*ARG_UNUSED(dummy
))
763 enum cpp_ttype token
= pragma_lex (&x
, &loc
);
764 if (token
!= CPP_NAME
)
766 warning_at (loc
, OPT_Wpragmas
,
767 "missing [error|warning|ignored|push|pop]"
768 " after %<#pragma GCC diagnostic%>");
773 const char *kind_string
= IDENTIFIER_POINTER (x
);
774 if (strcmp (kind_string
, "error") == 0)
776 else if (strcmp (kind_string
, "warning") == 0)
778 else if (strcmp (kind_string
, "ignored") == 0)
780 else if (strcmp (kind_string
, "push") == 0)
782 diagnostic_push_diagnostics (global_dc
, input_location
);
785 else if (strcmp (kind_string
, "pop") == 0)
787 diagnostic_pop_diagnostics (global_dc
, input_location
);
792 warning_at (loc
, OPT_Wpragmas
,
793 "expected [error|warning|ignored|push|pop]"
794 " after %<#pragma GCC diagnostic%>");
798 token
= pragma_lex (&x
, &loc
);
799 if (token
!= CPP_STRING
)
801 warning_at (loc
, OPT_Wpragmas
,
802 "missing option after %<#pragma GCC diagnostic%> kind");
806 const char *option_string
= TREE_STRING_POINTER (x
);
807 unsigned int lang_mask
= c_common_option_lang_mask () | CL_COMMON
;
808 /* option_string + 1 to skip the initial '-' */
809 unsigned int option_index
= find_opt (option_string
+ 1, lang_mask
);
810 if (option_index
== OPT_SPECIAL_unknown
)
813 const char *hint
= op
.suggest_option (option_string
+ 1);
815 warning_at (loc
, OPT_Wpragmas
,
816 "unknown option after %<#pragma GCC diagnostic%> kind;"
817 " did you mean %<-%s%>", hint
);
819 warning_at (loc
, OPT_Wpragmas
,
820 "unknown option after %<#pragma GCC diagnostic%> kind");
824 else if (!(cl_options
[option_index
].flags
& CL_WARNING
))
826 warning_at (loc
, OPT_Wpragmas
,
827 "%qs is not an option that controls warnings", option_string
);
830 else if (!(cl_options
[option_index
].flags
& lang_mask
))
832 char *ok_langs
= write_langs (cl_options
[option_index
].flags
);
833 char *bad_lang
= write_langs (c_common_option_lang_mask ());
834 warning_at (loc
, OPT_Wpragmas
,
835 "option %qs is valid for %s but not for %s",
836 option_string
, ok_langs
, bad_lang
);
842 struct cl_option_handlers handlers
;
843 set_default_handlers (&handlers
, NULL
);
844 const char *arg
= NULL
;
845 if (cl_options
[option_index
].flags
& CL_JOINED
)
846 arg
= option_string
+ 1 + cl_options
[option_index
].opt_len
;
847 /* FIXME: input_location isn't the best location here, but it is
848 what we used to do here before and changing it breaks e.g.
849 PR69543 and PR69558. */
850 control_warning_option (option_index
, (int) kind
,
851 arg
, kind
!= DK_IGNORED
,
852 input_location
, lang_mask
, &handlers
,
853 &global_options
, &global_options_set
,
857 /* Parse #pragma GCC target (xxx) to set target specific options. */
859 handle_pragma_target(cpp_reader
*ARG_UNUSED(dummy
))
861 enum cpp_ttype token
;
863 bool close_paren_needed_p
= false;
867 error ("%<#pragma GCC option%> is not allowed inside functions");
871 token
= pragma_lex (&x
);
872 if (token
== CPP_OPEN_PAREN
)
874 close_paren_needed_p
= true;
875 token
= pragma_lex (&x
);
878 if (token
!= CPP_STRING
)
880 GCC_BAD ("%<#pragma GCC option%> is not a string");
884 /* Strings are user options. */
887 tree args
= NULL_TREE
;
891 /* Build up the strings now as a tree linked list. Skip empty
893 if (TREE_STRING_LENGTH (x
) > 0)
894 args
= tree_cons (NULL_TREE
, x
, args
);
896 token
= pragma_lex (&x
);
897 while (token
== CPP_COMMA
)
898 token
= pragma_lex (&x
);
900 while (token
== CPP_STRING
);
902 if (close_paren_needed_p
)
904 if (token
== CPP_CLOSE_PAREN
)
905 token
= pragma_lex (&x
);
907 GCC_BAD ("%<#pragma GCC target (string [,string]...)%> does "
908 "not have a final %<)%>");
911 if (token
!= CPP_EOF
)
913 error ("%<#pragma GCC target%> string is badly formed");
917 /* put arguments in the order the user typed them. */
918 args
= nreverse (args
);
920 if (targetm
.target_option
.pragma_parse (args
, NULL_TREE
))
921 current_target_pragma
= chainon (current_target_pragma
, args
);
925 /* Handle #pragma GCC optimize to set optimization options. */
927 handle_pragma_optimize (cpp_reader
*ARG_UNUSED(dummy
))
929 enum cpp_ttype token
;
931 bool close_paren_needed_p
= false;
932 tree optimization_previous_node
= optimization_current_node
;
936 error ("%<#pragma GCC optimize%> is not allowed inside functions");
940 token
= pragma_lex (&x
);
941 if (token
== CPP_OPEN_PAREN
)
943 close_paren_needed_p
= true;
944 token
= pragma_lex (&x
);
947 if (token
!= CPP_STRING
&& token
!= CPP_NUMBER
)
949 GCC_BAD ("%<#pragma GCC optimize%> is not a string or number");
953 /* Strings/numbers are user options. */
956 tree args
= NULL_TREE
;
960 /* Build up the numbers/strings now as a list. */
961 if (token
!= CPP_STRING
|| TREE_STRING_LENGTH (x
) > 0)
962 args
= tree_cons (NULL_TREE
, x
, args
);
964 token
= pragma_lex (&x
);
965 while (token
== CPP_COMMA
)
966 token
= pragma_lex (&x
);
968 while (token
== CPP_STRING
|| token
== CPP_NUMBER
);
970 if (close_paren_needed_p
)
972 if (token
== CPP_CLOSE_PAREN
)
973 token
= pragma_lex (&x
);
975 GCC_BAD ("%<#pragma GCC optimize (string [,string]...)%> does "
976 "not have a final %<)%>");
979 if (token
!= CPP_EOF
)
981 error ("%<#pragma GCC optimize%> string is badly formed");
985 /* put arguments in the order the user typed them. */
986 args
= nreverse (args
);
988 parse_optimize_options (args
, false);
989 current_optimize_pragma
= chainon (current_optimize_pragma
, args
);
990 optimization_current_node
= build_optimization_node (&global_options
);
991 c_cpp_builtins_optimize_pragma (parse_in
,
992 optimization_previous_node
,
993 optimization_current_node
);
997 /* Stack of the #pragma GCC options created with #pragma GCC push_option. Save
998 both the binary representation of the options and the TREE_LIST of
999 strings that will be added to the function's attribute list. */
1000 struct GTY(()) opt_stack
{
1001 struct opt_stack
*prev
;
1003 tree target_strings
;
1004 tree optimize_binary
;
1005 tree optimize_strings
;
1008 static GTY(()) struct opt_stack
* options_stack
;
1010 /* Handle #pragma GCC push_options to save the current target and optimization
1014 handle_pragma_push_options (cpp_reader
*ARG_UNUSED(dummy
))
1016 enum cpp_ttype token
;
1019 token
= pragma_lex (&x
);
1020 if (token
!= CPP_EOF
)
1022 warning (OPT_Wpragmas
, "junk at end of %<#pragma push_options%>");
1026 opt_stack
*p
= ggc_alloc
<opt_stack
> ();
1027 p
->prev
= options_stack
;
1030 /* Save optimization and target flags in binary format. */
1031 p
->optimize_binary
= build_optimization_node (&global_options
);
1032 p
->target_binary
= build_target_option_node (&global_options
);
1034 /* Save optimization and target flags in string list format. */
1035 p
->optimize_strings
= copy_list (current_optimize_pragma
);
1036 p
->target_strings
= copy_list (current_target_pragma
);
1039 /* Handle #pragma GCC pop_options to restore the current target and
1040 optimization options from a previous push_options. */
1043 handle_pragma_pop_options (cpp_reader
*ARG_UNUSED(dummy
))
1045 enum cpp_ttype token
;
1049 token
= pragma_lex (&x
);
1050 if (token
!= CPP_EOF
)
1052 warning (OPT_Wpragmas
, "junk at end of %<#pragma pop_options%>");
1056 if (! options_stack
)
1058 warning (OPT_Wpragmas
,
1059 "%<#pragma GCC pop_options%> without a corresponding "
1060 "%<#pragma GCC push_options%>");
1065 options_stack
= p
->prev
;
1067 if (p
->target_binary
!= target_option_current_node
)
1069 (void) targetm
.target_option
.pragma_parse (NULL_TREE
, p
->target_binary
);
1070 target_option_current_node
= p
->target_binary
;
1073 if (p
->optimize_binary
!= optimization_current_node
)
1075 tree old_optimize
= optimization_current_node
;
1076 cl_optimization_restore (&global_options
,
1077 TREE_OPTIMIZATION (p
->optimize_binary
));
1078 c_cpp_builtins_optimize_pragma (parse_in
, old_optimize
,
1079 p
->optimize_binary
);
1080 optimization_current_node
= p
->optimize_binary
;
1083 current_target_pragma
= p
->target_strings
;
1084 current_optimize_pragma
= p
->optimize_strings
;
1087 /* Handle #pragma GCC reset_options to restore the current target and
1088 optimization options to the original options used on the command line. */
1091 handle_pragma_reset_options (cpp_reader
*ARG_UNUSED(dummy
))
1093 enum cpp_ttype token
;
1095 tree new_optimize
= optimization_default_node
;
1096 tree new_target
= target_option_default_node
;
1098 token
= pragma_lex (&x
);
1099 if (token
!= CPP_EOF
)
1101 warning (OPT_Wpragmas
, "junk at end of %<#pragma reset_options%>");
1105 if (new_target
!= target_option_current_node
)
1107 (void) targetm
.target_option
.pragma_parse (NULL_TREE
, new_target
);
1108 target_option_current_node
= new_target
;
1111 if (new_optimize
!= optimization_current_node
)
1113 tree old_optimize
= optimization_current_node
;
1114 cl_optimization_restore (&global_options
,
1115 TREE_OPTIMIZATION (new_optimize
));
1116 c_cpp_builtins_optimize_pragma (parse_in
, old_optimize
, new_optimize
);
1117 optimization_current_node
= new_optimize
;
1120 current_target_pragma
= NULL_TREE
;
1121 current_optimize_pragma
= NULL_TREE
;
1124 /* Print a plain user-specified message. */
1127 handle_pragma_message (cpp_reader
*ARG_UNUSED(dummy
))
1129 enum cpp_ttype token
;
1130 tree x
, message
= 0;
1132 token
= pragma_lex (&x
);
1133 if (token
== CPP_OPEN_PAREN
)
1135 token
= pragma_lex (&x
);
1136 if (token
== CPP_STRING
)
1139 GCC_BAD ("expected a string after %<#pragma message%>");
1140 if (pragma_lex (&x
) != CPP_CLOSE_PAREN
)
1141 GCC_BAD ("malformed %<#pragma message%>, ignored");
1143 else if (token
== CPP_STRING
)
1146 GCC_BAD ("expected a string after %<#pragma message%>");
1148 gcc_assert (message
);
1150 if (pragma_lex (&x
) != CPP_EOF
)
1151 warning (OPT_Wpragmas
, "junk at end of %<#pragma message%>");
1153 if (TREE_STRING_LENGTH (message
) > 1)
1154 inform (input_location
, "%<#pragma message: %s%>",
1155 TREE_STRING_POINTER (message
));
1158 /* Mark whether the current location is valid for a STDC pragma. */
1160 static bool valid_location_for_stdc_pragma
;
1163 mark_valid_location_for_stdc_pragma (bool flag
)
1165 valid_location_for_stdc_pragma
= flag
;
1168 /* Return true if the current location is valid for a STDC pragma. */
1171 valid_location_for_stdc_pragma_p (void)
1173 return valid_location_for_stdc_pragma
;
1176 enum pragma_switch_t
{ PRAGMA_ON
, PRAGMA_OFF
, PRAGMA_DEFAULT
, PRAGMA_BAD
};
1178 /* A STDC pragma must appear outside of external declarations or
1179 preceding all explicit declarations and statements inside a compound
1180 statement; its behavior is undefined if used in any other context.
1181 It takes a switch of ON, OFF, or DEFAULT. */
1183 static enum pragma_switch_t
1184 handle_stdc_pragma (const char *pname
)
1188 enum pragma_switch_t ret
;
1190 if (!valid_location_for_stdc_pragma_p ())
1192 warning (OPT_Wpragmas
, "invalid location for %<pragma %s%>, ignored",
1197 if (pragma_lex (&t
) != CPP_NAME
)
1199 warning (OPT_Wpragmas
, "malformed %<#pragma %s%>, ignored", pname
);
1203 arg
= IDENTIFIER_POINTER (t
);
1205 if (!strcmp (arg
, "ON"))
1207 else if (!strcmp (arg
, "OFF"))
1209 else if (!strcmp (arg
, "DEFAULT"))
1210 ret
= PRAGMA_DEFAULT
;
1213 warning (OPT_Wpragmas
, "malformed %<#pragma %s%>, ignored", pname
);
1217 if (pragma_lex (&t
) != CPP_EOF
)
1219 warning (OPT_Wpragmas
, "junk at end of %<#pragma %s%>", pname
);
1226 /* #pragma STDC FLOAT_CONST_DECIMAL64 ON
1227 #pragma STDC FLOAT_CONST_DECIMAL64 OFF
1228 #pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT */
1231 handle_pragma_float_const_decimal64 (cpp_reader
*ARG_UNUSED (dummy
))
1233 if (c_dialect_cxx ())
1235 if (warn_unknown_pragmas
> in_system_header_at (input_location
))
1236 warning (OPT_Wunknown_pragmas
,
1237 "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
1242 if (!targetm
.decimal_float_supported_p ())
1244 if (warn_unknown_pragmas
> in_system_header_at (input_location
))
1245 warning (OPT_Wunknown_pragmas
,
1246 "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
1251 pedwarn (input_location
, OPT_Wpedantic
,
1252 "ISO C does not support %<#pragma STDC FLOAT_CONST_DECIMAL64%>");
1254 switch (handle_stdc_pragma ("STDC FLOAT_CONST_DECIMAL64"))
1257 set_float_const_decimal64 ();
1260 case PRAGMA_DEFAULT
:
1261 clear_float_const_decimal64 ();
1268 /* A vector of registered pragma callbacks, which is never freed. */
1270 static vec
<internal_pragma_handler
> registered_pragmas
;
1272 struct pragma_ns_name
1279 static vec
<pragma_ns_name
> registered_pp_pragmas
;
1281 struct omp_pragma_def
{ const char *name
; unsigned int id
; };
1282 static const struct omp_pragma_def oacc_pragmas
[] = {
1283 { "atomic", PRAGMA_OACC_ATOMIC
},
1284 { "cache", PRAGMA_OACC_CACHE
},
1285 { "data", PRAGMA_OACC_DATA
},
1286 { "declare", PRAGMA_OACC_DECLARE
},
1287 { "enter", PRAGMA_OACC_ENTER_DATA
},
1288 { "exit", PRAGMA_OACC_EXIT_DATA
},
1289 { "host_data", PRAGMA_OACC_HOST_DATA
},
1290 { "kernels", PRAGMA_OACC_KERNELS
},
1291 { "loop", PRAGMA_OACC_LOOP
},
1292 { "parallel", PRAGMA_OACC_PARALLEL
},
1293 { "routine", PRAGMA_OACC_ROUTINE
},
1294 { "update", PRAGMA_OACC_UPDATE
},
1295 { "wait", PRAGMA_OACC_WAIT
}
1297 static const struct omp_pragma_def omp_pragmas
[] = {
1298 { "atomic", PRAGMA_OMP_ATOMIC
},
1299 { "barrier", PRAGMA_OMP_BARRIER
},
1300 { "cancel", PRAGMA_OMP_CANCEL
},
1301 { "cancellation", PRAGMA_OMP_CANCELLATION_POINT
},
1302 { "critical", PRAGMA_OMP_CRITICAL
},
1303 { "depobj", PRAGMA_OMP_DEPOBJ
},
1304 { "end", PRAGMA_OMP_END_DECLARE_TARGET
},
1305 { "flush", PRAGMA_OMP_FLUSH
},
1306 { "master", PRAGMA_OMP_MASTER
},
1307 { "requires", PRAGMA_OMP_REQUIRES
},
1308 { "section", PRAGMA_OMP_SECTION
},
1309 { "sections", PRAGMA_OMP_SECTIONS
},
1310 { "single", PRAGMA_OMP_SINGLE
},
1311 { "task", PRAGMA_OMP_TASK
},
1312 { "taskgroup", PRAGMA_OMP_TASKGROUP
},
1313 { "taskwait", PRAGMA_OMP_TASKWAIT
},
1314 { "taskyield", PRAGMA_OMP_TASKYIELD
},
1315 { "threadprivate", PRAGMA_OMP_THREADPRIVATE
}
1317 static const struct omp_pragma_def omp_pragmas_simd
[] = {
1318 { "declare", PRAGMA_OMP_DECLARE
},
1319 { "distribute", PRAGMA_OMP_DISTRIBUTE
},
1320 { "for", PRAGMA_OMP_FOR
},
1321 { "ordered", PRAGMA_OMP_ORDERED
},
1322 { "parallel", PRAGMA_OMP_PARALLEL
},
1323 { "simd", PRAGMA_OMP_SIMD
},
1324 { "target", PRAGMA_OMP_TARGET
},
1325 { "taskloop", PRAGMA_OMP_TASKLOOP
},
1326 { "teams", PRAGMA_OMP_TEAMS
},
1330 c_pp_lookup_pragma (unsigned int id
, const char **space
, const char **name
)
1332 const int n_oacc_pragmas
= sizeof (oacc_pragmas
) / sizeof (*oacc_pragmas
);
1333 const int n_omp_pragmas
= sizeof (omp_pragmas
) / sizeof (*omp_pragmas
);
1334 const int n_omp_pragmas_simd
= sizeof (omp_pragmas_simd
)
1335 / sizeof (*omp_pragmas
);
1338 for (i
= 0; i
< n_oacc_pragmas
; ++i
)
1339 if (oacc_pragmas
[i
].id
== id
)
1342 *name
= oacc_pragmas
[i
].name
;
1346 for (i
= 0; i
< n_omp_pragmas
; ++i
)
1347 if (omp_pragmas
[i
].id
== id
)
1350 *name
= omp_pragmas
[i
].name
;
1354 for (i
= 0; i
< n_omp_pragmas_simd
; ++i
)
1355 if (omp_pragmas_simd
[i
].id
== id
)
1358 *name
= omp_pragmas_simd
[i
].name
;
1362 if (id
>= PRAGMA_FIRST_EXTERNAL
1363 && (id
< PRAGMA_FIRST_EXTERNAL
+ registered_pp_pragmas
.length ()))
1365 *space
= registered_pp_pragmas
[id
- PRAGMA_FIRST_EXTERNAL
].space
;
1366 *name
= registered_pp_pragmas
[id
- PRAGMA_FIRST_EXTERNAL
].name
;
1373 /* Front-end wrappers for pragma registration to avoid dragging
1374 cpplib.h in almost everywhere. */
1377 c_register_pragma_1 (const char *space
, const char *name
,
1378 internal_pragma_handler ihandler
, bool allow_expansion
)
1382 if (flag_preprocess_only
)
1384 pragma_ns_name ns_name
;
1386 if (!allow_expansion
)
1389 ns_name
.space
= space
;
1390 ns_name
.name
= name
;
1391 registered_pp_pragmas
.safe_push (ns_name
);
1392 id
= registered_pp_pragmas
.length ();
1393 id
+= PRAGMA_FIRST_EXTERNAL
- 1;
1397 registered_pragmas
.safe_push (ihandler
);
1398 id
= registered_pragmas
.length ();
1399 id
+= PRAGMA_FIRST_EXTERNAL
- 1;
1401 /* The C front end allocates 8 bits in c_token. The C++ front end
1402 keeps the pragma kind in the form of INTEGER_CST, so no small
1403 limit applies. At present this is sufficient. */
1404 gcc_assert (id
< 256);
1407 cpp_register_deferred_pragma (parse_in
, space
, name
, id
,
1408 allow_expansion
, false);
1411 /* Register a C pragma handler, using a space and a name. It disallows pragma
1412 expansion (if you want it, use c_register_pragma_with_expansion instead). */
1414 c_register_pragma (const char *space
, const char *name
,
1415 pragma_handler_1arg handler
)
1417 internal_pragma_handler ihandler
;
1419 ihandler
.handler
.handler_1arg
= handler
;
1420 ihandler
.extra_data
= false;
1421 ihandler
.data
= NULL
;
1422 c_register_pragma_1 (space
, name
, ihandler
, false);
1425 /* Register a C pragma handler, using a space and a name, it also carries an
1426 extra data field which can be used by the handler. It disallows pragma
1427 expansion (if you want it, use c_register_pragma_with_expansion_and_data
1430 c_register_pragma_with_data (const char *space
, const char *name
,
1431 pragma_handler_2arg handler
, void * data
)
1433 internal_pragma_handler ihandler
;
1435 ihandler
.handler
.handler_2arg
= handler
;
1436 ihandler
.extra_data
= true;
1437 ihandler
.data
= data
;
1438 c_register_pragma_1 (space
, name
, ihandler
, false);
1441 /* Register a C pragma handler, using a space and a name. It allows pragma
1442 expansion as in the following example:
1445 #pragma count (NUMBER)
1447 Name expansion is still disallowed. */
1449 c_register_pragma_with_expansion (const char *space
, const char *name
,
1450 pragma_handler_1arg handler
)
1452 internal_pragma_handler ihandler
;
1454 ihandler
.handler
.handler_1arg
= handler
;
1455 ihandler
.extra_data
= false;
1456 ihandler
.data
= NULL
;
1457 c_register_pragma_1 (space
, name
, ihandler
, true);
1460 /* Register a C pragma handler, using a space and a name, it also carries an
1461 extra data field which can be used by the handler. It allows pragma
1462 expansion as in the following example:
1465 #pragma count (NUMBER)
1467 Name expansion is still disallowed. */
1469 c_register_pragma_with_expansion_and_data (const char *space
, const char *name
,
1470 pragma_handler_2arg handler
,
1473 internal_pragma_handler ihandler
;
1475 ihandler
.handler
.handler_2arg
= handler
;
1476 ihandler
.extra_data
= true;
1477 ihandler
.data
= data
;
1478 c_register_pragma_1 (space
, name
, ihandler
, true);
1482 c_invoke_pragma_handler (unsigned int id
)
1484 internal_pragma_handler
*ihandler
;
1485 pragma_handler_1arg handler_1arg
;
1486 pragma_handler_2arg handler_2arg
;
1488 id
-= PRAGMA_FIRST_EXTERNAL
;
1489 ihandler
= ®istered_pragmas
[id
];
1490 if (ihandler
->extra_data
)
1492 handler_2arg
= ihandler
->handler
.handler_2arg
;
1493 handler_2arg (parse_in
, ihandler
->data
);
1497 handler_1arg
= ihandler
->handler
.handler_1arg
;
1498 handler_1arg (parse_in
);
1502 /* Set up front-end pragmas. */
1508 const int n_oacc_pragmas
1509 = sizeof (oacc_pragmas
) / sizeof (*oacc_pragmas
);
1512 for (i
= 0; i
< n_oacc_pragmas
; ++i
)
1513 cpp_register_deferred_pragma (parse_in
, "acc", oacc_pragmas
[i
].name
,
1514 oacc_pragmas
[i
].id
, true, true);
1519 const int n_omp_pragmas
= sizeof (omp_pragmas
) / sizeof (*omp_pragmas
);
1522 for (i
= 0; i
< n_omp_pragmas
; ++i
)
1523 cpp_register_deferred_pragma (parse_in
, "omp", omp_pragmas
[i
].name
,
1524 omp_pragmas
[i
].id
, true, true);
1526 if (flag_openmp
|| flag_openmp_simd
)
1528 const int n_omp_pragmas_simd
= sizeof (omp_pragmas_simd
)
1529 / sizeof (*omp_pragmas
);
1532 for (i
= 0; i
< n_omp_pragmas_simd
; ++i
)
1533 cpp_register_deferred_pragma (parse_in
, "omp", omp_pragmas_simd
[i
].name
,
1534 omp_pragmas_simd
[i
].id
, true, true);
1537 if (!flag_preprocess_only
)
1538 cpp_register_deferred_pragma (parse_in
, "GCC", "pch_preprocess",
1539 PRAGMA_GCC_PCH_PREPROCESS
, false, false);
1541 if (!flag_preprocess_only
)
1542 cpp_register_deferred_pragma (parse_in
, "GCC", "ivdep", PRAGMA_IVDEP
, false,
1545 if (!flag_preprocess_only
)
1546 cpp_register_deferred_pragma (parse_in
, "GCC", "unroll", PRAGMA_UNROLL
,
1549 #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
1550 c_register_pragma_with_expansion (0, "pack", handle_pragma_pack
);
1552 c_register_pragma (0, "pack", handle_pragma_pack
);
1554 c_register_pragma (0, "weak", handle_pragma_weak
);
1556 c_register_pragma ("GCC", "visibility", handle_pragma_visibility
);
1558 c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic
);
1559 c_register_pragma ("GCC", "target", handle_pragma_target
);
1560 c_register_pragma ("GCC", "optimize", handle_pragma_optimize
);
1561 c_register_pragma ("GCC", "push_options", handle_pragma_push_options
);
1562 c_register_pragma ("GCC", "pop_options", handle_pragma_pop_options
);
1563 c_register_pragma ("GCC", "reset_options", handle_pragma_reset_options
);
1565 c_register_pragma ("STDC", "FLOAT_CONST_DECIMAL64",
1566 handle_pragma_float_const_decimal64
);
1568 c_register_pragma_with_expansion (0, "redefine_extname",
1569 handle_pragma_redefine_extname
);
1571 c_register_pragma_with_expansion (0, "message", handle_pragma_message
);
1573 #ifdef REGISTER_TARGET_PRAGMAS
1574 REGISTER_TARGET_PRAGMAS ();
1577 global_sso
= default_sso
;
1578 c_register_pragma (0, "scalar_storage_order",
1579 handle_pragma_scalar_storage_order
);
1581 /* Allow plugins to register their own pragmas. */
1582 invoke_plugin_callbacks (PLUGIN_PRAGMAS
, NULL
);
1585 #include "gt-c-family-c-pragma.h"