1 /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
2 Copyright (C) 1992-2013 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"
25 #include "function.h" /* For cfun. FIXME: Does the parser know
26 when it is inside a function, so that
27 we don't have to look at cfun? */
33 #include "tm_p.h" /* For REGISTER_TARGET_PRAGMAS (why is
34 this not a target hook?). */
37 #include "diagnostic.h"
42 #define GCC_BAD(gmsgid) \
43 do { warning (OPT_Wpragmas, gmsgid); return; } while (0)
44 #define GCC_BAD2(gmsgid, arg) \
45 do { warning (OPT_Wpragmas, gmsgid, arg); return; } while (0)
47 typedef struct GTY(()) align_stack
{
50 struct align_stack
* prev
;
53 static GTY(()) struct align_stack
* alignment_stack
;
55 static void handle_pragma_pack (cpp_reader
*);
57 /* If we have a "global" #pragma pack(<n>) in effect when the first
58 #pragma pack(push,<n>) is encountered, this stores the value of
59 maximum_field_alignment in effect. When the final pop_alignment()
60 happens, we restore the value to this, not to a value of 0 for
61 maximum_field_alignment. Value is in bits. */
62 static int default_alignment
;
63 #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \
64 ? &default_alignment \
65 : &alignment_stack->alignment) = (ALIGN))
67 static void push_alignment (int, tree
);
68 static void pop_alignment (tree
);
70 /* Push an alignment value onto the stack. */
72 push_alignment (int alignment
, tree id
)
76 entry
= ggc_alloc_align_stack ();
78 entry
->alignment
= alignment
;
80 entry
->prev
= alignment_stack
;
82 /* The current value of maximum_field_alignment is not necessarily
83 0 since there may be a #pragma pack(<n>) in effect; remember it
84 so that we can restore it after the final #pragma pop(). */
85 if (alignment_stack
== NULL
)
86 default_alignment
= maximum_field_alignment
;
88 alignment_stack
= entry
;
90 maximum_field_alignment
= alignment
;
93 /* Undo a push of an alignment onto the stack. */
95 pop_alignment (tree id
)
99 if (alignment_stack
== NULL
)
100 GCC_BAD ("#pragma pack (pop) encountered without matching #pragma pack (push)");
102 /* If we got an identifier, strip away everything above the target
103 entry so that the next step will restore the state just below it. */
106 for (entry
= alignment_stack
; entry
; entry
= entry
->prev
)
109 alignment_stack
= entry
;
113 warning (OPT_Wpragmas
, "\
114 #pragma pack(pop, %E) encountered without matching #pragma pack(push, %E)"
118 entry
= alignment_stack
->prev
;
120 maximum_field_alignment
= entry
? entry
->alignment
: default_alignment
;
122 alignment_stack
= entry
;
129 #pragma pack (push, N)
130 #pragma pack (push, ID)
131 #pragma pack (push, ID, N)
133 #pragma pack (pop, ID) */
135 handle_pragma_pack (cpp_reader
* ARG_UNUSED (dummy
))
139 enum cpp_ttype token
;
140 enum { set
, push
, pop
} action
;
142 if (pragma_lex (&x
) != CPP_OPEN_PAREN
)
143 GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
145 token
= pragma_lex (&x
);
146 if (token
== CPP_CLOSE_PAREN
)
149 align
= initial_max_fld_align
;
151 else if (token
== CPP_NUMBER
)
153 if (TREE_CODE (x
) != INTEGER_CST
)
154 GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
155 align
= TREE_INT_CST_LOW (x
);
157 if (pragma_lex (&x
) != CPP_CLOSE_PAREN
)
158 GCC_BAD ("malformed %<#pragma pack%> - ignored");
160 else if (token
== CPP_NAME
)
162 #define GCC_BAD_ACTION do { if (action != pop) \
163 GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
165 GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
168 const char *op
= IDENTIFIER_POINTER (x
);
169 if (!strcmp (op
, "push"))
171 else if (!strcmp (op
, "pop"))
174 GCC_BAD2 ("unknown action %qE for %<#pragma pack%> - ignored", x
);
176 while ((token
= pragma_lex (&x
)) == CPP_COMMA
)
178 token
= pragma_lex (&x
);
179 if (token
== CPP_NAME
&& id
== 0)
183 else if (token
== CPP_NUMBER
&& action
== push
&& align
== -1)
185 if (TREE_CODE (x
) != INTEGER_CST
)
186 GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
187 align
= TREE_INT_CST_LOW (x
);
195 if (token
!= CPP_CLOSE_PAREN
)
197 #undef GCC_BAD_ACTION
200 GCC_BAD ("malformed %<#pragma pack%> - ignored");
202 if (pragma_lex (&x
) != CPP_EOF
)
203 warning (OPT_Wpragmas
, "junk at end of %<#pragma pack%>");
205 if (flag_pack_struct
)
206 GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
217 align
*= BITS_PER_UNIT
;
222 align
= maximum_field_alignment
;
226 GCC_BAD2 ("alignment must be a small power of two, not %d", align
);
231 case set
: SET_GLOBAL_ALIGNMENT (align
); break;
232 case push
: push_alignment (align
, id
); break;
233 case pop
: pop_alignment (id
); break;
237 typedef struct GTY(()) pending_weak_d
244 static GTY(()) vec
<pending_weak
, va_gc
> *pending_weaks
;
246 static void apply_pragma_weak (tree
, tree
);
247 static void handle_pragma_weak (cpp_reader
*);
250 apply_pragma_weak (tree decl
, tree value
)
254 value
= build_string (IDENTIFIER_LENGTH (value
),
255 IDENTIFIER_POINTER (value
));
256 decl_attributes (&decl
, build_tree_list (get_identifier ("alias"),
257 build_tree_list (NULL
, value
)),
261 if (SUPPORTS_WEAK
&& DECL_EXTERNAL (decl
) && TREE_USED (decl
)
262 && !DECL_WEAK (decl
) /* Don't complain about a redundant #pragma. */
263 && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl
)))
264 warning (OPT_Wpragmas
, "applying #pragma weak %q+D after first use "
265 "results in unspecified behavior", decl
);
271 maybe_apply_pragma_weak (tree decl
)
277 /* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
279 /* No weak symbols pending, take the short-cut. */
282 /* If it's not visible outside this file, it doesn't matter whether
284 if (!DECL_EXTERNAL (decl
) && !TREE_PUBLIC (decl
))
286 /* If it's not a function or a variable, it can't be weak.
287 FIXME: what kinds of things are visible outside this file but
288 aren't functions or variables? Should this be an assert instead? */
289 if (TREE_CODE (decl
) != FUNCTION_DECL
&& TREE_CODE (decl
) != VAR_DECL
)
292 id
= DECL_ASSEMBLER_NAME (decl
);
294 FOR_EACH_VEC_ELT (*pending_weaks
, i
, pe
)
297 apply_pragma_weak (decl
, pe
->value
);
298 pending_weaks
->unordered_remove (i
);
303 /* Process all "#pragma weak A = B" directives where we have not seen
306 maybe_apply_pending_pragma_weaks (void)
308 tree alias_id
, id
, decl
;
316 FOR_EACH_VEC_ELT (*pending_weaks
, i
, pe
)
324 target
= symtab_node_for_asm (id
);
325 decl
= build_decl (UNKNOWN_LOCATION
,
326 target
? TREE_CODE (target
->decl
) : FUNCTION_DECL
,
327 alias_id
, default_function_type
);
329 DECL_ARTIFICIAL (decl
) = 1;
330 TREE_PUBLIC (decl
) = 1;
331 DECL_WEAK (decl
) = 1;
332 if (TREE_CODE (decl
) == VAR_DECL
)
333 TREE_STATIC (decl
) = 1;
336 error ("%q+D aliased to undefined symbol %qE",
341 assemble_alias (decl
, id
);
345 /* #pragma weak name [= value] */
347 handle_pragma_weak (cpp_reader
* ARG_UNUSED (dummy
))
349 tree name
, value
, x
, decl
;
354 if (pragma_lex (&name
) != CPP_NAME
)
355 GCC_BAD ("malformed #pragma weak, ignored");
359 if (pragma_lex (&value
) != CPP_NAME
)
360 GCC_BAD ("malformed #pragma weak, ignored");
364 warning (OPT_Wpragmas
, "junk at end of %<#pragma weak%>");
366 decl
= identifier_global_value (name
);
367 if (decl
&& DECL_P (decl
))
369 apply_pragma_weak (decl
, value
);
372 DECL_EXTERNAL (decl
) = 0;
373 if (TREE_CODE (decl
) == VAR_DECL
)
374 TREE_STATIC (decl
) = 1;
375 assemble_alias (decl
, value
);
380 pending_weak pe
= {name
, value
};
381 vec_safe_push (pending_weaks
, pe
);
385 /* GCC supports two #pragma directives for renaming the external
386 symbol associated with a declaration (DECL_ASSEMBLER_NAME), for
387 compatibility with the Solaris and VMS system headers. GCC also
388 has its own notation for this, __asm__("name") annotations.
390 Corner cases of these features and their interaction:
392 1) Both pragmas silently apply only to declarations with external
393 linkage (that is, TREE_PUBLIC || DECL_EXTERNAL). Asm labels
394 do not have this restriction.
396 2) In C++, both #pragmas silently apply only to extern "C" declarations.
397 Asm labels do not have this restriction.
399 3) If any of the three ways of changing DECL_ASSEMBLER_NAME is
400 applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the
401 new name is different, a warning issues and the name does not change.
403 4) The "source name" for #pragma redefine_extname is the DECL_NAME,
404 *not* the DECL_ASSEMBLER_NAME.
406 5) If #pragma extern_prefix is in effect and a declaration occurs
407 with an __asm__ name, the #pragma extern_prefix is silently
408 ignored for that declaration.
410 6) If #pragma extern_prefix and #pragma redefine_extname apply to
411 the same declaration, whichever triggered first wins, and a warning
412 is issued. (We would like to have #pragma redefine_extname always
413 win, but it can appear either before or after the declaration, and
414 if it appears afterward, we have no way of knowing whether a modified
415 DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.) */
417 typedef struct GTY(()) pending_redefinition_d
{
420 } pending_redefinition
;
423 static GTY(()) vec
<pending_redefinition
, va_gc
> *pending_redefine_extname
;
425 static void handle_pragma_redefine_extname (cpp_reader
*);
427 /* #pragma redefine_extname oldname newname */
429 handle_pragma_redefine_extname (cpp_reader
* ARG_UNUSED (dummy
))
431 tree oldname
, newname
, decls
, x
;
435 if (pragma_lex (&oldname
) != CPP_NAME
)
436 GCC_BAD ("malformed #pragma redefine_extname, ignored");
437 if (pragma_lex (&newname
) != CPP_NAME
)
438 GCC_BAD ("malformed #pragma redefine_extname, ignored");
441 warning (OPT_Wpragmas
, "junk at end of %<#pragma redefine_extname%>");
444 for (decls
= c_linkage_bindings (oldname
);
448 if (TREE_CODE (decls
) == TREE_LIST
)
450 decl
= TREE_VALUE (decls
);
451 decls
= TREE_CHAIN (decls
);
459 if ((TREE_PUBLIC (decl
) || DECL_EXTERNAL (decl
))
460 && (TREE_CODE (decl
) == FUNCTION_DECL
461 || TREE_CODE (decl
) == VAR_DECL
))
464 if (DECL_ASSEMBLER_NAME_SET_P (decl
))
466 const char *name
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
467 name
= targetm
.strip_name_encoding (name
);
469 if (strcmp (name
, IDENTIFIER_POINTER (newname
)))
470 warning (OPT_Wpragmas
, "#pragma redefine_extname ignored due to "
471 "conflict with previous rename");
474 change_decl_assembler_name (decl
, newname
);
479 /* We have to add this to the rename list even if there's already
480 a global value that doesn't meet the above criteria, because in
481 C++ "struct foo {...};" puts "foo" in the current namespace but
482 does *not* conflict with a subsequent declaration of a function
483 or variable foo. See g++.dg/other/pragma-re-2.C. */
484 add_to_renaming_pragma_list (oldname
, newname
);
487 /* This is called from here and from ia64-c.c. */
489 add_to_renaming_pragma_list (tree oldname
, tree newname
)
492 pending_redefinition
*p
;
494 FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname
, ix
, p
)
495 if (oldname
== p
->oldname
)
497 if (p
->newname
!= newname
)
498 warning (OPT_Wpragmas
, "#pragma redefine_extname ignored due to "
499 "conflict with previous #pragma redefine_extname");
503 pending_redefinition e
= {oldname
, newname
};
504 vec_safe_push (pending_redefine_extname
, e
);
507 /* The current prefix set by #pragma extern_prefix. */
508 GTY(()) tree pragma_extern_prefix
;
510 /* variables used to implement #pragma upc semantics */
511 #ifndef UPC_CMODE_STACK_INCREMENT
512 #define UPC_CMODE_STACK_INCREMENT 32
514 static int pragma_upc_permitted
;
515 static int upc_cmode
;
516 static int *upc_cmode_stack
;
517 static int upc_cmode_stack_in_use
;
518 static int upc_cmode_stack_allocated
;
520 static void init_pragma_upc (void);
521 static void handle_pragma_upc (cpp_reader
* ARG_UNUSED (dummy
));
523 /* Initialize the variables used to manage the current UPC consistency
524 mode (strict/relaxed) */
527 init_pragma_upc (void)
529 pragma_upc_permitted
= 0;
531 upc_cmode_stack
= (int *) xcalloc (UPC_CMODE_STACK_INCREMENT
,
533 upc_cmode_stack_allocated
= UPC_CMODE_STACK_INCREMENT
;
534 upc_cmode_stack_in_use
= 0;
539 * #pragma upc relaxed
540 * #pragma upc upc_code
544 handle_pragma_upc (cpp_reader
* ARG_UNUSED (dummy
))
548 enum upc_pragma_op
{p_strict
, p_relaxed
, p_upc_code
,
549 p_c_code
, p_detect_upc
, p_unknown
};
550 enum upc_pragma_op upc_pragma
= p_unknown
;
554 warning (OPT_Wpragmas
, "#pragma upc found in non-UPC source file");
561 const char *op
= IDENTIFIER_POINTER (x
);
562 if (!strcmp (op
, "strict"))
563 upc_pragma
= p_strict
;
564 else if (!strcmp (op
, "relaxed"))
565 upc_pragma
= p_relaxed
;
566 else if (!strcmp (op
, "upc_code"))
567 upc_pragma
= p_upc_code
;
568 else if (!strcmp (op
, "c_code"))
569 upc_pragma
= p_c_code
;
570 else if (!strcmp (op
, "detect_upc"))
572 const char *detect_op
;
573 upc_pragma
= p_detect_upc
;
576 GCC_BAD ("missing [suspend_insertion|resume_insertion]"
577 " after %<#pragma UPC detect_upc%>");
578 detect_op
= IDENTIFIER_POINTER (x
);
579 if (strcmp (detect_op
, "suspend_insertion") == 0)
581 else if (strcmp (detect_op
, "resume_insertion") == 0)
584 GCC_BAD ("expected [suspend_insertion|resume_insertion]"
585 " after %<#pragma UPC detect_upc%>");
588 GCC_BAD2 ("unknown action '%s' for '#pragma upc' - ignored", op
);
591 warning (OPT_Wpragmas
, "missing parameter after #pragma upc");
595 warning (OPT_Wpragmas
, "junk at end of #pragma upc");
597 if ((upc_pragma
== p_strict
) || (upc_pragma
== p_relaxed
))
599 if (pragma_upc_permitted_p ())
601 int consistency_mode
= (upc_pragma
== p_strict
);
602 set_upc_consistency_mode (consistency_mode
);
605 warning (OPT_Wpragmas
, "#pragma upc not allowed in this context");
607 else if ((upc_pragma
== p_upc_code
) || (upc_pragma
== p_c_code
))
609 compiling_upc
= (upc_pragma
== p_upc_code
);
611 else if (upc_pragma
== p_detect_upc
)
613 /* Skip: this is a Berkeley-specific pragma that requires no action. */
617 /* Set the current setting of the UPC consistency mode
618 that is in effect. */
621 set_upc_consistency_mode (int mode
)
626 /* Return the current setting of the UPC consistency mode. */
629 get_upc_consistency_mode (void)
634 /* Called from the parser just after the bracket that opens a compound
635 statement has been parsed. Set the flag that allows the pragma
639 permit_pragma_upc (void)
641 pragma_upc_permitted
= 1;
644 /* Called just before the body of a compound statement is parsed.
645 Clear the flag that allows the pragma. */
648 deny_pragma_upc (void)
650 pragma_upc_permitted
= 0;
653 /* A #pragma upc is permitted either at the outermost scope,
654 or directly after the bracket that opens a compound statement. */
657 pragma_upc_permitted_p (void)
659 return !current_function_decl
|| pragma_upc_permitted
;
662 /* Called at the beginning of every compound statement.
663 Pushes the old value of the current UPC consistency mode
667 push_upc_consistency_mode (void)
669 if (upc_cmode_stack_in_use
== upc_cmode_stack_allocated
)
671 upc_cmode_stack_allocated
+= UPC_CMODE_STACK_INCREMENT
;
672 upc_cmode_stack
= (int *) xrealloc (upc_cmode_stack
,
673 upc_cmode_stack_allocated
* sizeof (int));
675 upc_cmode_stack
[upc_cmode_stack_in_use
++] = upc_cmode
;
678 /* Called at the end of every compound statement.
679 Sets the current consistency mode to the previously saved value. */
682 pop_upc_consistency_mode (void)
684 if (upc_cmode_stack_in_use
<= 0)
686 upc_cmode
= upc_cmode_stack
[--upc_cmode_stack_in_use
];
689 static int pragma_pupc_on
;
690 static void init_pragma_pupc (void);
691 static void handle_pragma_pupc (cpp_reader
*);
693 /* Pragma pupc defaults to being on */
695 init_pragma_pupc (void)
701 get_upc_pupc_mode (void)
703 return pragma_pupc_on
;
707 disable_pupc_mode (void)
709 int old_pupc
= pragma_pupc_on
;
715 set_pupc_mode (int new_pupc
)
717 pragma_pupc_on
= new_pupc
;
725 handle_pragma_pupc (cpp_reader
*dummy ATTRIBUTE_UNUSED
)
732 const char *op
= IDENTIFIER_POINTER (x
);
733 if (!strcmp (op
, "on"))
735 else if (!strcmp (op
, "off"))
738 GCC_BAD2 ("unknown action '%s' for '#pragma pupc' - ignored", op
);
743 warning (OPT_Wpragmas
, "junk at end of #pragma pupc");
746 /* Hook from the front ends to apply the results of one of the preceding
747 pragmas that rename variables. */
750 maybe_apply_renaming_pragma (tree decl
, tree asmname
)
753 pending_redefinition
*p
;
755 /* The renaming pragmas are only applied to declarations with
757 if ((TREE_CODE (decl
) != FUNCTION_DECL
&& TREE_CODE (decl
) != VAR_DECL
)
758 || (!TREE_PUBLIC (decl
) && !DECL_EXTERNAL (decl
))
759 || !has_c_linkage (decl
))
762 /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
763 but we may warn about a rename that conflicts. */
764 if (DECL_ASSEMBLER_NAME_SET_P (decl
))
766 const char *oldname
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
767 oldname
= targetm
.strip_name_encoding (oldname
);
769 if (asmname
&& strcmp (TREE_STRING_POINTER (asmname
), oldname
))
770 warning (OPT_Wpragmas
, "asm declaration ignored due to "
771 "conflict with previous rename");
773 /* Take any pending redefine_extname off the list. */
774 FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname
, ix
, p
)
775 if (DECL_NAME (decl
) == p
->oldname
)
777 /* Only warn if there is a conflict. */
778 if (strcmp (IDENTIFIER_POINTER (p
->newname
), oldname
))
779 warning (OPT_Wpragmas
, "#pragma redefine_extname ignored due to "
780 "conflict with previous rename");
782 pending_redefine_extname
->unordered_remove (ix
);
788 /* Find out if we have a pending #pragma redefine_extname. */
789 FOR_EACH_VEC_SAFE_ELT (pending_redefine_extname
, ix
, p
)
790 if (DECL_NAME (decl
) == p
->oldname
)
792 tree newname
= p
->newname
;
793 pending_redefine_extname
->unordered_remove (ix
);
795 /* If we already have an asmname, #pragma redefine_extname is
796 ignored (with a warning if it conflicts). */
799 if (strcmp (TREE_STRING_POINTER (asmname
),
800 IDENTIFIER_POINTER (newname
)) != 0)
801 warning (OPT_Wpragmas
, "#pragma redefine_extname ignored due to "
802 "conflict with __asm__ declaration");
806 /* Otherwise we use what we've got; #pragma extern_prefix is
808 return build_string (IDENTIFIER_LENGTH (newname
),
809 IDENTIFIER_POINTER (newname
));
812 /* If we've got an asmname, #pragma extern_prefix is silently ignored. */
816 /* If #pragma extern_prefix is in effect, apply it. */
817 if (pragma_extern_prefix
)
819 const char *prefix
= TREE_STRING_POINTER (pragma_extern_prefix
);
820 size_t plen
= TREE_STRING_LENGTH (pragma_extern_prefix
) - 1;
822 const char *id
= IDENTIFIER_POINTER (DECL_NAME (decl
));
823 size_t ilen
= IDENTIFIER_LENGTH (DECL_NAME (decl
));
825 char *newname
= (char *) alloca (plen
+ ilen
+ 1);
827 memcpy (newname
, prefix
, plen
);
828 memcpy (newname
+ plen
, id
, ilen
+ 1);
830 return build_string (plen
+ ilen
, newname
);
838 static void handle_pragma_visibility (cpp_reader
*);
840 static vec
<int> visstack
;
842 /* Push the visibility indicated by STR onto the top of the #pragma
843 visibility stack. KIND is 0 for #pragma GCC visibility, 1 for
844 C++ namespace with visibility attribute and 2 for C++ builtin
845 ABI namespace. push_visibility/pop_visibility calls must have
846 matching KIND, it is not allowed to push visibility using one
847 KIND and pop using a different one. */
850 push_visibility (const char *str
, int kind
)
852 visstack
.safe_push (((int) default_visibility
) | (kind
<< 8));
853 if (!strcmp (str
, "default"))
854 default_visibility
= VISIBILITY_DEFAULT
;
855 else if (!strcmp (str
, "internal"))
856 default_visibility
= VISIBILITY_INTERNAL
;
857 else if (!strcmp (str
, "hidden"))
858 default_visibility
= VISIBILITY_HIDDEN
;
859 else if (!strcmp (str
, "protected"))
860 default_visibility
= VISIBILITY_PROTECTED
;
862 GCC_BAD ("#pragma GCC visibility push() must specify default, internal, hidden or protected");
863 visibility_options
.inpragma
= 1;
866 /* Pop a level of the #pragma visibility stack. Return true if
870 pop_visibility (int kind
)
872 if (!visstack
.length ())
874 if ((visstack
.last () >> 8) != kind
)
877 = (enum symbol_visibility
) (visstack
.pop () & 0xff);
878 visibility_options
.inpragma
879 = visstack
.length () != 0;
883 /* Sets the default visibility for symbols to something other than that
884 specified on the command line. */
887 handle_pragma_visibility (cpp_reader
*dummy ATTRIBUTE_UNUSED
)
889 /* Form is #pragma GCC visibility push(hidden)|pop */
891 enum cpp_ttype token
;
892 enum { bad
, push
, pop
} action
= bad
;
894 token
= pragma_lex (&x
);
895 if (token
== CPP_NAME
)
897 const char *op
= IDENTIFIER_POINTER (x
);
898 if (!strcmp (op
, "push"))
900 else if (!strcmp (op
, "pop"))
904 GCC_BAD ("#pragma GCC visibility must be followed by push or pop");
909 if (! pop_visibility (0))
910 GCC_BAD ("no matching push for %<#pragma GCC visibility pop%>");
914 if (pragma_lex (&x
) != CPP_OPEN_PAREN
)
915 GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
916 token
= pragma_lex (&x
);
917 if (token
!= CPP_NAME
)
918 GCC_BAD ("malformed #pragma GCC visibility push");
920 push_visibility (IDENTIFIER_POINTER (x
), 0);
921 if (pragma_lex (&x
) != CPP_CLOSE_PAREN
)
922 GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
925 if (pragma_lex (&x
) != CPP_EOF
)
926 warning (OPT_Wpragmas
, "junk at end of %<#pragma GCC visibility%>");
930 handle_pragma_diagnostic(cpp_reader
*ARG_UNUSED(dummy
))
932 const char *kind_string
, *option_string
;
933 unsigned int option_index
;
934 enum cpp_ttype token
;
937 struct cl_option_handlers handlers
;
939 token
= pragma_lex (&x
);
940 if (token
!= CPP_NAME
)
941 GCC_BAD ("missing [error|warning|ignored] after %<#pragma GCC diagnostic%>");
942 kind_string
= IDENTIFIER_POINTER (x
);
943 if (strcmp (kind_string
, "error") == 0)
945 else if (strcmp (kind_string
, "warning") == 0)
947 else if (strcmp (kind_string
, "ignored") == 0)
949 else if (strcmp (kind_string
, "push") == 0)
951 diagnostic_push_diagnostics (global_dc
, input_location
);
954 else if (strcmp (kind_string
, "pop") == 0)
956 diagnostic_pop_diagnostics (global_dc
, input_location
);
960 GCC_BAD ("expected [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>");
962 token
= pragma_lex (&x
);
963 if (token
!= CPP_STRING
)
964 GCC_BAD ("missing option after %<#pragma GCC diagnostic%> kind");
965 option_string
= TREE_STRING_POINTER (x
);
966 set_default_handlers (&handlers
);
967 for (option_index
= 0; option_index
< cl_options_count
; option_index
++)
968 if (strcmp (cl_options
[option_index
].opt_text
, option_string
) == 0)
970 control_warning_option (option_index
, (int) kind
, kind
!= DK_IGNORED
,
971 input_location
, c_family_lang_mask
, &handlers
,
972 &global_options
, &global_options_set
,
976 GCC_BAD ("unknown option after %<#pragma GCC diagnostic%> kind");
979 /* Parse #pragma GCC target (xxx) to set target specific options. */
981 handle_pragma_target(cpp_reader
*ARG_UNUSED(dummy
))
983 enum cpp_ttype token
;
985 bool close_paren_needed_p
= false;
989 error ("#pragma GCC option is not allowed inside functions");
993 token
= pragma_lex (&x
);
994 if (token
== CPP_OPEN_PAREN
)
996 close_paren_needed_p
= true;
997 token
= pragma_lex (&x
);
1000 if (token
!= CPP_STRING
)
1002 GCC_BAD ("%<#pragma GCC option%> is not a string");
1006 /* Strings are user options. */
1009 tree args
= NULL_TREE
;
1013 /* Build up the strings now as a tree linked list. Skip empty
1015 if (TREE_STRING_LENGTH (x
) > 0)
1016 args
= tree_cons (NULL_TREE
, x
, args
);
1018 token
= pragma_lex (&x
);
1019 while (token
== CPP_COMMA
)
1020 token
= pragma_lex (&x
);
1022 while (token
== CPP_STRING
);
1024 if (close_paren_needed_p
)
1026 if (token
== CPP_CLOSE_PAREN
)
1027 token
= pragma_lex (&x
);
1029 GCC_BAD ("%<#pragma GCC target (string [,string]...)%> does "
1030 "not have a final %<)%>");
1033 if (token
!= CPP_EOF
)
1035 error ("#pragma GCC target string... is badly formed");
1039 /* put arguments in the order the user typed them. */
1040 args
= nreverse (args
);
1042 if (targetm
.target_option
.pragma_parse (args
, NULL_TREE
))
1043 current_target_pragma
= args
;
1047 /* Handle #pragma GCC optimize to set optimization options. */
1049 handle_pragma_optimize (cpp_reader
*ARG_UNUSED(dummy
))
1051 enum cpp_ttype token
;
1053 bool close_paren_needed_p
= false;
1054 tree optimization_previous_node
= optimization_current_node
;
1058 error ("#pragma GCC optimize is not allowed inside functions");
1062 token
= pragma_lex (&x
);
1063 if (token
== CPP_OPEN_PAREN
)
1065 close_paren_needed_p
= true;
1066 token
= pragma_lex (&x
);
1069 if (token
!= CPP_STRING
&& token
!= CPP_NUMBER
)
1071 GCC_BAD ("%<#pragma GCC optimize%> is not a string or number");
1075 /* Strings/numbers are user options. */
1078 tree args
= NULL_TREE
;
1082 /* Build up the numbers/strings now as a list. */
1083 if (token
!= CPP_STRING
|| TREE_STRING_LENGTH (x
) > 0)
1084 args
= tree_cons (NULL_TREE
, x
, args
);
1086 token
= pragma_lex (&x
);
1087 while (token
== CPP_COMMA
)
1088 token
= pragma_lex (&x
);
1090 while (token
== CPP_STRING
|| token
== CPP_NUMBER
);
1092 if (close_paren_needed_p
)
1094 if (token
== CPP_CLOSE_PAREN
)
1095 token
= pragma_lex (&x
);
1097 GCC_BAD ("%<#pragma GCC optimize (string [,string]...)%> does "
1098 "not have a final %<)%>");
1101 if (token
!= CPP_EOF
)
1103 error ("#pragma GCC optimize string... is badly formed");
1107 /* put arguments in the order the user typed them. */
1108 args
= nreverse (args
);
1110 parse_optimize_options (args
, false);
1111 current_optimize_pragma
= chainon (current_optimize_pragma
, args
);
1112 optimization_current_node
= build_optimization_node (&global_options
);
1113 c_cpp_builtins_optimize_pragma (parse_in
,
1114 optimization_previous_node
,
1115 optimization_current_node
);
1119 /* Stack of the #pragma GCC options created with #pragma GCC push_option. Save
1120 both the binary representation of the options and the TREE_LIST of
1121 strings that will be added to the function's attribute list. */
1122 typedef struct GTY(()) opt_stack
{
1123 struct opt_stack
*prev
;
1125 tree target_strings
;
1126 tree optimize_binary
;
1127 tree optimize_strings
;
1130 static GTY(()) struct opt_stack
* options_stack
;
1132 /* Handle #pragma GCC push_options to save the current target and optimization
1136 handle_pragma_push_options (cpp_reader
*ARG_UNUSED(dummy
))
1138 enum cpp_ttype token
;
1142 token
= pragma_lex (&x
);
1143 if (token
!= CPP_EOF
)
1145 warning (OPT_Wpragmas
, "junk at end of %<#pragma push_options%>");
1149 p
= ggc_alloc_opt_stack ();
1150 p
->prev
= options_stack
;
1153 /* Save optimization and target flags in binary format. */
1154 p
->optimize_binary
= build_optimization_node (&global_options
);
1155 p
->target_binary
= build_target_option_node (&global_options
);
1157 /* Save optimization and target flags in string list format. */
1158 p
->optimize_strings
= copy_list (current_optimize_pragma
);
1159 p
->target_strings
= copy_list (current_target_pragma
);
1162 /* Handle #pragma GCC pop_options to restore the current target and
1163 optimization options from a previous push_options. */
1166 handle_pragma_pop_options (cpp_reader
*ARG_UNUSED(dummy
))
1168 enum cpp_ttype token
;
1172 token
= pragma_lex (&x
);
1173 if (token
!= CPP_EOF
)
1175 warning (OPT_Wpragmas
, "junk at end of %<#pragma pop_options%>");
1179 if (! options_stack
)
1181 warning (OPT_Wpragmas
,
1182 "%<#pragma GCC pop_options%> without a corresponding "
1183 "%<#pragma GCC push_options%>");
1188 options_stack
= p
->prev
;
1190 if (p
->target_binary
!= target_option_current_node
)
1192 (void) targetm
.target_option
.pragma_parse (NULL_TREE
, p
->target_binary
);
1193 target_option_current_node
= p
->target_binary
;
1196 if (p
->optimize_binary
!= optimization_current_node
)
1198 tree old_optimize
= optimization_current_node
;
1199 cl_optimization_restore (&global_options
,
1200 TREE_OPTIMIZATION (p
->optimize_binary
));
1201 c_cpp_builtins_optimize_pragma (parse_in
, old_optimize
,
1202 p
->optimize_binary
);
1203 optimization_current_node
= p
->optimize_binary
;
1206 current_target_pragma
= p
->target_strings
;
1207 current_optimize_pragma
= p
->optimize_strings
;
1210 /* Handle #pragma GCC reset_options to restore the current target and
1211 optimization options to the original options used on the command line. */
1214 handle_pragma_reset_options (cpp_reader
*ARG_UNUSED(dummy
))
1216 enum cpp_ttype token
;
1218 tree new_optimize
= optimization_default_node
;
1219 tree new_target
= target_option_default_node
;
1221 token
= pragma_lex (&x
);
1222 if (token
!= CPP_EOF
)
1224 warning (OPT_Wpragmas
, "junk at end of %<#pragma reset_options%>");
1228 if (new_target
!= target_option_current_node
)
1230 (void) targetm
.target_option
.pragma_parse (NULL_TREE
, new_target
);
1231 target_option_current_node
= new_target
;
1234 if (new_optimize
!= optimization_current_node
)
1236 tree old_optimize
= optimization_current_node
;
1237 cl_optimization_restore (&global_options
,
1238 TREE_OPTIMIZATION (new_optimize
));
1239 c_cpp_builtins_optimize_pragma (parse_in
, old_optimize
, new_optimize
);
1240 optimization_current_node
= new_optimize
;
1243 current_target_pragma
= NULL_TREE
;
1244 current_optimize_pragma
= NULL_TREE
;
1247 /* Print a plain user-specified message. */
1250 handle_pragma_message (cpp_reader
*ARG_UNUSED(dummy
))
1252 enum cpp_ttype token
;
1253 tree x
, message
= 0;
1255 token
= pragma_lex (&x
);
1256 if (token
== CPP_OPEN_PAREN
)
1258 token
= pragma_lex (&x
);
1259 if (token
== CPP_STRING
)
1262 GCC_BAD ("expected a string after %<#pragma message%>");
1263 if (pragma_lex (&x
) != CPP_CLOSE_PAREN
)
1264 GCC_BAD ("malformed %<#pragma message%>, ignored");
1266 else if (token
== CPP_STRING
)
1269 GCC_BAD ("expected a string after %<#pragma message%>");
1271 gcc_assert (message
);
1273 if (pragma_lex (&x
) != CPP_EOF
)
1274 warning (OPT_Wpragmas
, "junk at end of %<#pragma message%>");
1276 if (TREE_STRING_LENGTH (message
) > 1)
1277 inform (input_location
, "#pragma message: %s", TREE_STRING_POINTER (message
));
1280 /* Mark whether the current location is valid for a STDC pragma. */
1282 static bool valid_location_for_stdc_pragma
;
1285 mark_valid_location_for_stdc_pragma (bool flag
)
1287 valid_location_for_stdc_pragma
= flag
;
1290 /* Return true if the current location is valid for a STDC pragma. */
1293 valid_location_for_stdc_pragma_p (void)
1295 return valid_location_for_stdc_pragma
;
1298 enum pragma_switch_t
{ PRAGMA_ON
, PRAGMA_OFF
, PRAGMA_DEFAULT
, PRAGMA_BAD
};
1300 /* A STDC pragma must appear outside of external declarations or
1301 preceding all explicit declarations and statements inside a compound
1302 statement; its behavior is undefined if used in any other context.
1303 It takes a switch of ON, OFF, or DEFAULT. */
1305 static enum pragma_switch_t
1306 handle_stdc_pragma (const char *pname
)
1310 enum pragma_switch_t ret
;
1312 if (!valid_location_for_stdc_pragma_p ())
1314 warning (OPT_Wpragmas
, "invalid location for %<pragma %s%>, ignored",
1319 if (pragma_lex (&t
) != CPP_NAME
)
1321 warning (OPT_Wpragmas
, "malformed %<#pragma %s%>, ignored", pname
);
1325 arg
= IDENTIFIER_POINTER (t
);
1327 if (!strcmp (arg
, "ON"))
1329 else if (!strcmp (arg
, "OFF"))
1331 else if (!strcmp (arg
, "DEFAULT"))
1332 ret
= PRAGMA_DEFAULT
;
1335 warning (OPT_Wpragmas
, "malformed %<#pragma %s%>, ignored", pname
);
1339 if (pragma_lex (&t
) != CPP_EOF
)
1341 warning (OPT_Wpragmas
, "junk at end of %<#pragma %s%>", pname
);
1348 /* #pragma STDC FLOAT_CONST_DECIMAL64 ON
1349 #pragma STDC FLOAT_CONST_DECIMAL64 OFF
1350 #pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT */
1353 handle_pragma_float_const_decimal64 (cpp_reader
*ARG_UNUSED (dummy
))
1355 if (c_dialect_cxx ())
1357 if (warn_unknown_pragmas
> in_system_header
)
1358 warning (OPT_Wunknown_pragmas
,
1359 "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
1364 if (!targetm
.decimal_float_supported_p ())
1366 if (warn_unknown_pragmas
> in_system_header
)
1367 warning (OPT_Wunknown_pragmas
,
1368 "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
1373 pedwarn (input_location
, OPT_Wpedantic
,
1374 "ISO C does not support %<#pragma STDC FLOAT_CONST_DECIMAL64%>");
1376 switch (handle_stdc_pragma ("STDC FLOAT_CONST_DECIMAL64"))
1379 set_float_const_decimal64 ();
1382 case PRAGMA_DEFAULT
:
1383 clear_float_const_decimal64 ();
1390 /* A vector of registered pragma callbacks, which is never freed. */
1392 static vec
<internal_pragma_handler
> registered_pragmas
;
1401 static vec
<pragma_ns_name
> registered_pp_pragmas
;
1403 struct omp_pragma_def
{ const char *name
; unsigned int id
; };
1404 static const struct omp_pragma_def omp_pragmas
[] = {
1405 { "atomic", PRAGMA_OMP_ATOMIC
},
1406 { "barrier", PRAGMA_OMP_BARRIER
},
1407 { "cancel", PRAGMA_OMP_CANCEL
},
1408 { "cancellation", PRAGMA_OMP_CANCELLATION_POINT
},
1409 { "critical", PRAGMA_OMP_CRITICAL
},
1410 { "end", PRAGMA_OMP_END_DECLARE_TARGET
},
1411 { "flush", PRAGMA_OMP_FLUSH
},
1412 { "master", PRAGMA_OMP_MASTER
},
1413 { "ordered", PRAGMA_OMP_ORDERED
},
1414 { "section", PRAGMA_OMP_SECTION
},
1415 { "sections", PRAGMA_OMP_SECTIONS
},
1416 { "single", PRAGMA_OMP_SINGLE
},
1417 { "taskgroup", PRAGMA_OMP_TASKGROUP
},
1418 { "taskwait", PRAGMA_OMP_TASKWAIT
},
1419 { "taskyield", PRAGMA_OMP_TASKYIELD
},
1420 { "threadprivate", PRAGMA_OMP_THREADPRIVATE
}
1422 static const struct omp_pragma_def omp_pragmas_simd
[] = {
1423 { "declare", PRAGMA_OMP_DECLARE_REDUCTION
},
1424 { "distribute", PRAGMA_OMP_DISTRIBUTE
},
1425 { "for", PRAGMA_OMP_FOR
},
1426 { "parallel", PRAGMA_OMP_PARALLEL
},
1427 { "simd", PRAGMA_OMP_SIMD
},
1428 { "target", PRAGMA_OMP_TARGET
},
1429 { "task", PRAGMA_OMP_TASK
},
1430 { "teams", PRAGMA_OMP_TEAMS
},
1434 c_pp_lookup_pragma (unsigned int id
, const char **space
, const char **name
)
1436 const int n_omp_pragmas
= sizeof (omp_pragmas
) / sizeof (*omp_pragmas
);
1437 const int n_omp_pragmas_simd
= sizeof (omp_pragmas_simd
)
1438 / sizeof (*omp_pragmas
);
1441 for (i
= 0; i
< n_omp_pragmas
; ++i
)
1442 if (omp_pragmas
[i
].id
== id
)
1445 *name
= omp_pragmas
[i
].name
;
1449 for (i
= 0; i
< n_omp_pragmas_simd
; ++i
)
1450 if (omp_pragmas_simd
[i
].id
== id
)
1453 *name
= omp_pragmas_simd
[i
].name
;
1457 if (id
>= PRAGMA_FIRST_EXTERNAL
1458 && (id
< PRAGMA_FIRST_EXTERNAL
+ registered_pp_pragmas
.length ()))
1460 *space
= registered_pp_pragmas
[id
- PRAGMA_FIRST_EXTERNAL
].space
;
1461 *name
= registered_pp_pragmas
[id
- PRAGMA_FIRST_EXTERNAL
].name
;
1468 /* Front-end wrappers for pragma registration to avoid dragging
1469 cpplib.h in almost everywhere. */
1472 c_register_pragma_1 (const char *space
, const char *name
,
1473 internal_pragma_handler ihandler
, bool allow_expansion
)
1477 if (flag_preprocess_only
)
1479 pragma_ns_name ns_name
;
1481 if (!allow_expansion
)
1484 ns_name
.space
= space
;
1485 ns_name
.name
= name
;
1486 registered_pp_pragmas
.safe_push (ns_name
);
1487 id
= registered_pp_pragmas
.length ();
1488 id
+= PRAGMA_FIRST_EXTERNAL
- 1;
1492 registered_pragmas
.safe_push (ihandler
);
1493 id
= registered_pragmas
.length ();
1494 id
+= PRAGMA_FIRST_EXTERNAL
- 1;
1496 /* The C++ front end allocates 6 bits in cp_token; the C front end
1497 allocates 7 bits in c_token. At present this is sufficient. */
1498 gcc_assert (id
< 64);
1501 cpp_register_deferred_pragma (parse_in
, space
, name
, id
,
1502 allow_expansion
, false);
1505 /* Register a C pragma handler, using a space and a name. It disallows pragma
1506 expansion (if you want it, use c_register_pragma_with_expansion instead). */
1508 c_register_pragma (const char *space
, const char *name
,
1509 pragma_handler_1arg handler
)
1511 internal_pragma_handler ihandler
;
1513 ihandler
.handler
.handler_1arg
= handler
;
1514 ihandler
.extra_data
= false;
1515 ihandler
.data
= NULL
;
1516 c_register_pragma_1 (space
, name
, ihandler
, false);
1519 /* Register a C pragma handler, using a space and a name, it also carries an
1520 extra data field which can be used by the handler. It disallows pragma
1521 expansion (if you want it, use c_register_pragma_with_expansion_and_data
1524 c_register_pragma_with_data (const char *space
, const char *name
,
1525 pragma_handler_2arg handler
, void * data
)
1527 internal_pragma_handler ihandler
;
1529 ihandler
.handler
.handler_2arg
= handler
;
1530 ihandler
.extra_data
= true;
1531 ihandler
.data
= data
;
1532 c_register_pragma_1 (space
, name
, ihandler
, false);
1535 /* Register a C pragma handler, using a space and a name. It allows pragma
1536 expansion as in the following example:
1539 #pragma count (NUMBER)
1541 Name expansion is still disallowed. */
1543 c_register_pragma_with_expansion (const char *space
, const char *name
,
1544 pragma_handler_1arg handler
)
1546 internal_pragma_handler ihandler
;
1548 ihandler
.handler
.handler_1arg
= handler
;
1549 ihandler
.extra_data
= false;
1550 ihandler
.data
= NULL
;
1551 c_register_pragma_1 (space
, name
, ihandler
, true);
1554 /* Register a C pragma handler, using a space and a name, it also carries an
1555 extra data field which can be used by the handler. It allows pragma
1556 expansion as in the following example:
1559 #pragma count (NUMBER)
1561 Name expansion is still disallowed. */
1563 c_register_pragma_with_expansion_and_data (const char *space
, const char *name
,
1564 pragma_handler_2arg handler
,
1567 internal_pragma_handler ihandler
;
1569 ihandler
.handler
.handler_2arg
= handler
;
1570 ihandler
.extra_data
= true;
1571 ihandler
.data
= data
;
1572 c_register_pragma_1 (space
, name
, ihandler
, true);
1576 c_invoke_pragma_handler (unsigned int id
)
1578 internal_pragma_handler
*ihandler
;
1579 pragma_handler_1arg handler_1arg
;
1580 pragma_handler_2arg handler_2arg
;
1582 id
-= PRAGMA_FIRST_EXTERNAL
;
1583 ihandler
= ®istered_pragmas
[id
];
1584 if (ihandler
->extra_data
)
1586 handler_2arg
= ihandler
->handler
.handler_2arg
;
1587 handler_2arg (parse_in
, ihandler
->data
);
1591 handler_1arg
= ihandler
->handler
.handler_1arg
;
1592 handler_1arg (parse_in
);
1596 /* Set up front-end pragmas. */
1602 const int n_omp_pragmas
= sizeof (omp_pragmas
) / sizeof (*omp_pragmas
);
1605 for (i
= 0; i
< n_omp_pragmas
; ++i
)
1606 cpp_register_deferred_pragma (parse_in
, "omp", omp_pragmas
[i
].name
,
1607 omp_pragmas
[i
].id
, true, true);
1609 if (flag_openmp
|| flag_openmp_simd
)
1611 const int n_omp_pragmas_simd
= sizeof (omp_pragmas_simd
)
1612 / sizeof (*omp_pragmas
);
1615 for (i
= 0; i
< n_omp_pragmas_simd
; ++i
)
1616 cpp_register_deferred_pragma (parse_in
, "omp", omp_pragmas_simd
[i
].name
,
1617 omp_pragmas_simd
[i
].id
, true, true);
1620 if (!flag_preprocess_only
)
1621 cpp_register_deferred_pragma (parse_in
, "GCC", "pch_preprocess",
1622 PRAGMA_GCC_PCH_PREPROCESS
, false, false);
1624 cpp_register_deferred_pragma (parse_in
, "GCC", "ivdep", PRAGMA_IVDEP
, false,
1626 #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
1627 c_register_pragma_with_expansion (0, "pack", handle_pragma_pack
);
1629 c_register_pragma (0, "pack", handle_pragma_pack
);
1631 c_register_pragma (0, "weak", handle_pragma_weak
);
1632 c_register_pragma ("GCC", "visibility", handle_pragma_visibility
);
1634 c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic
);
1635 c_register_pragma ("GCC", "target", handle_pragma_target
);
1636 c_register_pragma ("GCC", "optimize", handle_pragma_optimize
);
1637 c_register_pragma ("GCC", "push_options", handle_pragma_push_options
);
1638 c_register_pragma ("GCC", "pop_options", handle_pragma_pop_options
);
1639 c_register_pragma ("GCC", "reset_options", handle_pragma_reset_options
);
1641 c_register_pragma ("STDC", "FLOAT_CONST_DECIMAL64",
1642 handle_pragma_float_const_decimal64
);
1644 c_register_pragma_with_expansion (0, "redefine_extname",
1645 handle_pragma_redefine_extname
);
1647 c_register_pragma_with_expansion (0, "message", handle_pragma_message
);
1651 c_register_pragma (0, "upc", handle_pragma_upc
);
1653 c_register_pragma (0, "pupc", handle_pragma_pupc
);
1654 init_pragma_pupc ();
1657 #ifdef REGISTER_TARGET_PRAGMAS
1658 REGISTER_TARGET_PRAGMAS ();
1661 /* Allow plugins to register their own pragmas. */
1662 invoke_plugin_callbacks (PLUGIN_PRAGMAS
, NULL
);
1665 #include "gt-c-family-c-pragma.h"