]> gcc.gnu.org Git - gcc.git/blob - gcc/c-family/c-pragma.c
c-pragma.h (pragma_handler_1arg, [...]): New handler.
[gcc.git] / gcc / c-family / c-pragma.c
1 /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
2 Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "tm.h"
25 #include "tree.h"
26 #include "function.h" /* For cfun. FIXME: Does the parser know
27 when it is inside a function, so that
28 we don't have to look at cfun? */
29 #include "cpplib.h"
30 #include "c-pragma.h"
31 #include "flags.h"
32 #include "c-common.h"
33 #include "output.h"
34 #include "tm_p.h" /* For REGISTER_TARGET_PRAGMAS (why is
35 this not a target hook?). */
36 #include "vec.h"
37 #include "vecprim.h"
38 #include "target.h"
39 #include "diagnostic.h"
40 #include "opts.h"
41 #include "plugin.h"
42
43 #define GCC_BAD(gmsgid) \
44 do { warning (OPT_Wpragmas, gmsgid); return; } while (0)
45 #define GCC_BAD2(gmsgid, arg) \
46 do { warning (OPT_Wpragmas, gmsgid, arg); return; } while (0)
47
48 typedef struct GTY(()) align_stack {
49 int alignment;
50 tree id;
51 struct align_stack * prev;
52 } align_stack;
53
54 static GTY(()) struct align_stack * alignment_stack;
55
56 static void handle_pragma_pack (cpp_reader *);
57
58 /* If we have a "global" #pragma pack(<n>) in effect when the first
59 #pragma pack(push,<n>) is encountered, this stores the value of
60 maximum_field_alignment in effect. When the final pop_alignment()
61 happens, we restore the value to this, not to a value of 0 for
62 maximum_field_alignment. Value is in bits. */
63 static int default_alignment;
64 #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \
65 ? &default_alignment \
66 : &alignment_stack->alignment) = (ALIGN))
67
68 static void push_alignment (int, tree);
69 static void pop_alignment (tree);
70
71 /* Push an alignment value onto the stack. */
72 static void
73 push_alignment (int alignment, tree id)
74 {
75 align_stack * entry;
76
77 entry = ggc_alloc_align_stack ();
78
79 entry->alignment = alignment;
80 entry->id = id;
81 entry->prev = alignment_stack;
82
83 /* The current value of maximum_field_alignment is not necessarily
84 0 since there may be a #pragma pack(<n>) in effect; remember it
85 so that we can restore it after the final #pragma pop(). */
86 if (alignment_stack == NULL)
87 default_alignment = maximum_field_alignment;
88
89 alignment_stack = entry;
90
91 maximum_field_alignment = alignment;
92 }
93
94 /* Undo a push of an alignment onto the stack. */
95 static void
96 pop_alignment (tree id)
97 {
98 align_stack * entry;
99
100 if (alignment_stack == NULL)
101 GCC_BAD ("#pragma pack (pop) encountered without matching #pragma pack (push)");
102
103 /* If we got an identifier, strip away everything above the target
104 entry so that the next step will restore the state just below it. */
105 if (id)
106 {
107 for (entry = alignment_stack; entry; entry = entry->prev)
108 if (entry->id == id)
109 {
110 alignment_stack = entry;
111 break;
112 }
113 if (entry == NULL)
114 warning (OPT_Wpragmas, "\
115 #pragma pack(pop, %E) encountered without matching #pragma pack(push, %E)"
116 , id, id);
117 }
118
119 entry = alignment_stack->prev;
120
121 maximum_field_alignment = entry ? entry->alignment : default_alignment;
122
123 alignment_stack = entry;
124 }
125
126 /* #pragma pack ()
127 #pragma pack (N)
128
129 #pragma pack (push)
130 #pragma pack (push, N)
131 #pragma pack (push, ID)
132 #pragma pack (push, ID, N)
133 #pragma pack (pop)
134 #pragma pack (pop, ID) */
135 static void
136 handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
137 {
138 tree x, id = 0;
139 int align = -1;
140 enum cpp_ttype token;
141 enum { set, push, pop } action;
142
143 if (pragma_lex (&x) != CPP_OPEN_PAREN)
144 GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
145
146 token = pragma_lex (&x);
147 if (token == CPP_CLOSE_PAREN)
148 {
149 action = set;
150 align = initial_max_fld_align;
151 }
152 else if (token == CPP_NUMBER)
153 {
154 if (TREE_CODE (x) != INTEGER_CST)
155 GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
156 align = TREE_INT_CST_LOW (x);
157 action = set;
158 if (pragma_lex (&x) != CPP_CLOSE_PAREN)
159 GCC_BAD ("malformed %<#pragma pack%> - ignored");
160 }
161 else if (token == CPP_NAME)
162 {
163 #define GCC_BAD_ACTION do { if (action != pop) \
164 GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
165 else \
166 GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
167 } while (0)
168
169 const char *op = IDENTIFIER_POINTER (x);
170 if (!strcmp (op, "push"))
171 action = push;
172 else if (!strcmp (op, "pop"))
173 action = pop;
174 else
175 GCC_BAD2 ("unknown action %qE for %<#pragma pack%> - ignored", x);
176
177 while ((token = pragma_lex (&x)) == CPP_COMMA)
178 {
179 token = pragma_lex (&x);
180 if (token == CPP_NAME && id == 0)
181 {
182 id = x;
183 }
184 else if (token == CPP_NUMBER && action == push && align == -1)
185 {
186 if (TREE_CODE (x) != INTEGER_CST)
187 GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
188 align = TREE_INT_CST_LOW (x);
189 if (align == -1)
190 action = set;
191 }
192 else
193 GCC_BAD_ACTION;
194 }
195
196 if (token != CPP_CLOSE_PAREN)
197 GCC_BAD_ACTION;
198 #undef GCC_BAD_ACTION
199 }
200 else
201 GCC_BAD ("malformed %<#pragma pack%> - ignored");
202
203 if (pragma_lex (&x) != CPP_EOF)
204 warning (OPT_Wpragmas, "junk at end of %<#pragma pack%>");
205
206 if (flag_pack_struct)
207 GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
208
209 if (action != pop)
210 switch (align)
211 {
212 case 0:
213 case 1:
214 case 2:
215 case 4:
216 case 8:
217 case 16:
218 align *= BITS_PER_UNIT;
219 break;
220 case -1:
221 if (action == push)
222 {
223 align = maximum_field_alignment;
224 break;
225 }
226 default:
227 GCC_BAD2 ("alignment must be a small power of two, not %d", align);
228 }
229
230 switch (action)
231 {
232 case set: SET_GLOBAL_ALIGNMENT (align); break;
233 case push: push_alignment (align, id); break;
234 case pop: pop_alignment (id); break;
235 }
236 }
237
238 typedef struct GTY(()) pending_weak_d
239 {
240 tree name;
241 tree value;
242 } pending_weak;
243
244 DEF_VEC_O(pending_weak);
245 DEF_VEC_ALLOC_O(pending_weak,gc);
246
247 static GTY(()) VEC(pending_weak,gc) *pending_weaks;
248
249 static void apply_pragma_weak (tree, tree);
250 static void handle_pragma_weak (cpp_reader *);
251
252 static void
253 apply_pragma_weak (tree decl, tree value)
254 {
255 if (value)
256 {
257 value = build_string (IDENTIFIER_LENGTH (value),
258 IDENTIFIER_POINTER (value));
259 decl_attributes (&decl, build_tree_list (get_identifier ("alias"),
260 build_tree_list (NULL, value)),
261 0);
262 }
263
264 if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
265 && !DECL_WEAK (decl) /* Don't complain about a redundant #pragma. */
266 && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
267 warning (OPT_Wpragmas, "applying #pragma weak %q+D after first use "
268 "results in unspecified behavior", decl);
269
270 declare_weak (decl);
271 }
272
273 void
274 maybe_apply_pragma_weak (tree decl)
275 {
276 tree id;
277 int i;
278 pending_weak *pe;
279
280 /* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
281
282 /* No weak symbols pending, take the short-cut. */
283 if (!pending_weaks)
284 return;
285 /* If it's not visible outside this file, it doesn't matter whether
286 it's weak. */
287 if (!DECL_EXTERNAL (decl) && !TREE_PUBLIC (decl))
288 return;
289 /* If it's not a function or a variable, it can't be weak.
290 FIXME: what kinds of things are visible outside this file but
291 aren't functions or variables? Should this be an assert instead? */
292 if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
293 return;
294
295 id = DECL_ASSEMBLER_NAME (decl);
296
297 FOR_EACH_VEC_ELT (pending_weak, pending_weaks, i, pe)
298 if (id == pe->name)
299 {
300 apply_pragma_weak (decl, pe->value);
301 VEC_unordered_remove (pending_weak, pending_weaks, i);
302 break;
303 }
304 }
305
306 /* Process all "#pragma weak A = B" directives where we have not seen
307 a decl for A. */
308 void
309 maybe_apply_pending_pragma_weaks (void)
310 {
311 tree alias_id, id, decl;
312 int i;
313 pending_weak *pe;
314
315 FOR_EACH_VEC_ELT (pending_weak, pending_weaks, i, pe)
316 {
317 alias_id = pe->name;
318 id = pe->value;
319
320 if (id == NULL)
321 continue;
322
323 decl = build_decl (UNKNOWN_LOCATION,
324 FUNCTION_DECL, alias_id, default_function_type);
325
326 DECL_ARTIFICIAL (decl) = 1;
327 TREE_PUBLIC (decl) = 1;
328 DECL_EXTERNAL (decl) = 1;
329 DECL_WEAK (decl) = 1;
330
331 assemble_alias (decl, id);
332 }
333 }
334
335 /* #pragma weak name [= value] */
336 static void
337 handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
338 {
339 tree name, value, x, decl;
340 enum cpp_ttype t;
341
342 value = 0;
343
344 if (pragma_lex (&name) != CPP_NAME)
345 GCC_BAD ("malformed #pragma weak, ignored");
346 t = pragma_lex (&x);
347 if (t == CPP_EQ)
348 {
349 if (pragma_lex (&value) != CPP_NAME)
350 GCC_BAD ("malformed #pragma weak, ignored");
351 t = pragma_lex (&x);
352 }
353 if (t != CPP_EOF)
354 warning (OPT_Wpragmas, "junk at end of %<#pragma weak%>");
355
356 decl = identifier_global_value (name);
357 if (decl && DECL_P (decl))
358 {
359 apply_pragma_weak (decl, value);
360 if (value)
361 assemble_alias (decl, value);
362 }
363 else
364 {
365 pending_weak *pe;
366 pe = VEC_safe_push (pending_weak, gc, pending_weaks, NULL);
367 pe->name = name;
368 pe->value = value;
369 }
370 }
371
372 /* GCC supports two #pragma directives for renaming the external
373 symbol associated with a declaration (DECL_ASSEMBLER_NAME), for
374 compatibility with the Solaris and Tru64 system headers. GCC also
375 has its own notation for this, __asm__("name") annotations.
376
377 Corner cases of these features and their interaction:
378
379 1) Both pragmas silently apply only to declarations with external
380 linkage (that is, TREE_PUBLIC || DECL_EXTERNAL). Asm labels
381 do not have this restriction.
382
383 2) In C++, both #pragmas silently apply only to extern "C" declarations.
384 Asm labels do not have this restriction.
385
386 3) If any of the three ways of changing DECL_ASSEMBLER_NAME is
387 applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the
388 new name is different, a warning issues and the name does not change.
389
390 4) The "source name" for #pragma redefine_extname is the DECL_NAME,
391 *not* the DECL_ASSEMBLER_NAME.
392
393 5) If #pragma extern_prefix is in effect and a declaration occurs
394 with an __asm__ name, the #pragma extern_prefix is silently
395 ignored for that declaration.
396
397 6) If #pragma extern_prefix and #pragma redefine_extname apply to
398 the same declaration, whichever triggered first wins, and a warning
399 is issued. (We would like to have #pragma redefine_extname always
400 win, but it can appear either before or after the declaration, and
401 if it appears afterward, we have no way of knowing whether a modified
402 DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.) */
403
404 typedef struct GTY(()) pending_redefinition_d {
405 tree oldname;
406 tree newname;
407 } pending_redefinition;
408
409 DEF_VEC_O(pending_redefinition);
410 DEF_VEC_ALLOC_O(pending_redefinition,gc);
411
412 static GTY(()) VEC(pending_redefinition,gc) *pending_redefine_extname;
413
414 static void handle_pragma_redefine_extname (cpp_reader *);
415
416 /* #pragma redefine_extname oldname newname */
417 static void
418 handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
419 {
420 tree oldname, newname, decl, x;
421 enum cpp_ttype t;
422
423 if (pragma_lex (&oldname) != CPP_NAME)
424 GCC_BAD ("malformed #pragma redefine_extname, ignored");
425 if (pragma_lex (&newname) != CPP_NAME)
426 GCC_BAD ("malformed #pragma redefine_extname, ignored");
427 t = pragma_lex (&x);
428 if (t != CPP_EOF)
429 warning (OPT_Wpragmas, "junk at end of %<#pragma redefine_extname%>");
430
431 decl = identifier_global_value (oldname);
432 if (decl
433 && (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
434 && (TREE_CODE (decl) == FUNCTION_DECL
435 || TREE_CODE (decl) == VAR_DECL)
436 && has_c_linkage (decl))
437 {
438 if (DECL_ASSEMBLER_NAME_SET_P (decl))
439 {
440 const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
441 name = targetm.strip_name_encoding (name);
442
443 if (strcmp (name, IDENTIFIER_POINTER (newname)))
444 warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
445 "conflict with previous rename");
446 }
447 else
448 change_decl_assembler_name (decl, newname);
449 }
450 else
451 /* We have to add this to the rename list even if there's already
452 a global value that doesn't meet the above criteria, because in
453 C++ "struct foo {...};" puts "foo" in the current namespace but
454 does *not* conflict with a subsequent declaration of a function
455 or variable foo. See g++.dg/other/pragma-re-2.C. */
456 add_to_renaming_pragma_list (oldname, newname);
457 }
458
459 /* This is called from here and from ia64.c. */
460 void
461 add_to_renaming_pragma_list (tree oldname, tree newname)
462 {
463 unsigned ix;
464 pending_redefinition *p;
465
466 FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
467 if (oldname == p->oldname)
468 {
469 if (p->newname != newname)
470 warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
471 "conflict with previous #pragma redefine_extname");
472 return;
473 }
474
475 p = VEC_safe_push (pending_redefinition, gc, pending_redefine_extname, NULL);
476 p->oldname = oldname;
477 p->newname = newname;
478 }
479
480 static GTY(()) tree pragma_extern_prefix;
481
482 /* #pragma extern_prefix "prefix" */
483 static void
484 handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
485 {
486 tree prefix, x;
487 enum cpp_ttype t;
488
489 if (pragma_lex (&prefix) != CPP_STRING)
490 GCC_BAD ("malformed #pragma extern_prefix, ignored");
491 t = pragma_lex (&x);
492 if (t != CPP_EOF)
493 warning (OPT_Wpragmas, "junk at end of %<#pragma extern_prefix%>");
494
495 if (targetm.handle_pragma_extern_prefix)
496 /* Note that the length includes the null terminator. */
497 pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL);
498 else if (warn_unknown_pragmas > in_system_header)
499 warning (OPT_Wunknown_pragmas,
500 "#pragma extern_prefix not supported on this target");
501 }
502
503 /* Hook from the front ends to apply the results of one of the preceding
504 pragmas that rename variables. */
505
506 tree
507 maybe_apply_renaming_pragma (tree decl, tree asmname)
508 {
509 unsigned ix;
510 pending_redefinition *p;
511
512 /* The renaming pragmas are only applied to declarations with
513 external linkage. */
514 if ((TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
515 || (!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl))
516 || !has_c_linkage (decl))
517 return asmname;
518
519 /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
520 but we may warn about a rename that conflicts. */
521 if (DECL_ASSEMBLER_NAME_SET_P (decl))
522 {
523 const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
524 oldname = targetm.strip_name_encoding (oldname);
525
526 if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname))
527 warning (OPT_Wpragmas, "asm declaration ignored due to "
528 "conflict with previous rename");
529
530 /* Take any pending redefine_extname off the list. */
531 FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
532 if (DECL_NAME (decl) == p->oldname)
533 {
534 /* Only warn if there is a conflict. */
535 if (strcmp (IDENTIFIER_POINTER (p->newname), oldname))
536 warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
537 "conflict with previous rename");
538
539 VEC_unordered_remove (pending_redefinition,
540 pending_redefine_extname, ix);
541 break;
542 }
543 return 0;
544 }
545
546 /* Find out if we have a pending #pragma redefine_extname. */
547 FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
548 if (DECL_NAME (decl) == p->oldname)
549 {
550 tree newname = p->newname;
551 VEC_unordered_remove (pending_redefinition,
552 pending_redefine_extname, ix);
553
554 /* If we already have an asmname, #pragma redefine_extname is
555 ignored (with a warning if it conflicts). */
556 if (asmname)
557 {
558 if (strcmp (TREE_STRING_POINTER (asmname),
559 IDENTIFIER_POINTER (newname)) != 0)
560 warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
561 "conflict with __asm__ declaration");
562 return asmname;
563 }
564
565 /* Otherwise we use what we've got; #pragma extern_prefix is
566 silently ignored. */
567 return build_string (IDENTIFIER_LENGTH (newname),
568 IDENTIFIER_POINTER (newname));
569 }
570
571 /* If we've got an asmname, #pragma extern_prefix is silently ignored. */
572 if (asmname)
573 return asmname;
574
575 /* If #pragma extern_prefix is in effect, apply it. */
576 if (pragma_extern_prefix)
577 {
578 const char *prefix = TREE_STRING_POINTER (pragma_extern_prefix);
579 size_t plen = TREE_STRING_LENGTH (pragma_extern_prefix) - 1;
580
581 const char *id = IDENTIFIER_POINTER (DECL_NAME (decl));
582 size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl));
583
584 char *newname = (char *) alloca (plen + ilen + 1);
585
586 memcpy (newname, prefix, plen);
587 memcpy (newname + plen, id, ilen + 1);
588
589 return build_string (plen + ilen, newname);
590 }
591
592 /* Nada. */
593 return 0;
594 }
595
596
597 static void handle_pragma_visibility (cpp_reader *);
598
599 static VEC (int, heap) *visstack;
600
601 /* Push the visibility indicated by STR onto the top of the #pragma
602 visibility stack. KIND is 0 for #pragma GCC visibility, 1 for
603 C++ namespace with visibility attribute and 2 for C++ builtin
604 ABI namespace. push_visibility/pop_visibility calls must have
605 matching KIND, it is not allowed to push visibility using one
606 KIND and pop using a different one. */
607
608 void
609 push_visibility (const char *str, int kind)
610 {
611 VEC_safe_push (int, heap, visstack,
612 ((int) default_visibility) | (kind << 8));
613 if (!strcmp (str, "default"))
614 default_visibility = VISIBILITY_DEFAULT;
615 else if (!strcmp (str, "internal"))
616 default_visibility = VISIBILITY_INTERNAL;
617 else if (!strcmp (str, "hidden"))
618 default_visibility = VISIBILITY_HIDDEN;
619 else if (!strcmp (str, "protected"))
620 default_visibility = VISIBILITY_PROTECTED;
621 else
622 GCC_BAD ("#pragma GCC visibility push() must specify default, internal, hidden or protected");
623 visibility_options.inpragma = 1;
624 }
625
626 /* Pop a level of the #pragma visibility stack. Return true if
627 successful. */
628
629 bool
630 pop_visibility (int kind)
631 {
632 if (!VEC_length (int, visstack))
633 return false;
634 if ((VEC_last (int, visstack) >> 8) != kind)
635 return false;
636 default_visibility
637 = (enum symbol_visibility) (VEC_pop (int, visstack) & 0xff);
638 visibility_options.inpragma
639 = VEC_length (int, visstack) != 0;
640 return true;
641 }
642
643 /* Sets the default visibility for symbols to something other than that
644 specified on the command line. */
645
646 static void
647 handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
648 {
649 /* Form is #pragma GCC visibility push(hidden)|pop */
650 tree x;
651 enum cpp_ttype token;
652 enum { bad, push, pop } action = bad;
653
654 token = pragma_lex (&x);
655 if (token == CPP_NAME)
656 {
657 const char *op = IDENTIFIER_POINTER (x);
658 if (!strcmp (op, "push"))
659 action = push;
660 else if (!strcmp (op, "pop"))
661 action = pop;
662 }
663 if (bad == action)
664 GCC_BAD ("#pragma GCC visibility must be followed by push or pop");
665 else
666 {
667 if (pop == action)
668 {
669 if (! pop_visibility (0))
670 GCC_BAD ("no matching push for %<#pragma GCC visibility pop%>");
671 }
672 else
673 {
674 if (pragma_lex (&x) != CPP_OPEN_PAREN)
675 GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
676 token = pragma_lex (&x);
677 if (token != CPP_NAME)
678 GCC_BAD ("malformed #pragma GCC visibility push");
679 else
680 push_visibility (IDENTIFIER_POINTER (x), 0);
681 if (pragma_lex (&x) != CPP_CLOSE_PAREN)
682 GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
683 }
684 }
685 if (pragma_lex (&x) != CPP_EOF)
686 warning (OPT_Wpragmas, "junk at end of %<#pragma GCC visibility%>");
687 }
688
689 static void
690 handle_pragma_diagnostic(cpp_reader *ARG_UNUSED(dummy))
691 {
692 const char *kind_string, *option_string;
693 unsigned int option_index;
694 enum cpp_ttype token;
695 diagnostic_t kind;
696 tree x;
697 struct cl_option_handlers handlers;
698
699 token = pragma_lex (&x);
700 if (token != CPP_NAME)
701 GCC_BAD ("missing [error|warning|ignored] after %<#pragma GCC diagnostic%>");
702 kind_string = IDENTIFIER_POINTER (x);
703 if (strcmp (kind_string, "error") == 0)
704 kind = DK_ERROR;
705 else if (strcmp (kind_string, "warning") == 0)
706 kind = DK_WARNING;
707 else if (strcmp (kind_string, "ignored") == 0)
708 kind = DK_IGNORED;
709 else if (strcmp (kind_string, "push") == 0)
710 {
711 diagnostic_push_diagnostics (global_dc, input_location);
712 return;
713 }
714 else if (strcmp (kind_string, "pop") == 0)
715 {
716 diagnostic_pop_diagnostics (global_dc, input_location);
717 return;
718 }
719 else
720 GCC_BAD ("expected [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>");
721
722 token = pragma_lex (&x);
723 if (token != CPP_STRING)
724 GCC_BAD ("missing option after %<#pragma GCC diagnostic%> kind");
725 option_string = TREE_STRING_POINTER (x);
726 set_default_handlers (&handlers);
727 for (option_index = 0; option_index < cl_options_count; option_index++)
728 if (strcmp (cl_options[option_index].opt_text, option_string) == 0)
729 {
730 control_warning_option (option_index, (int) kind, kind != DK_IGNORED,
731 input_location, c_family_lang_mask, &handlers,
732 &global_options, &global_options_set,
733 global_dc);
734 return;
735 }
736 GCC_BAD ("unknown option after %<#pragma GCC diagnostic%> kind");
737 }
738
739 /* Parse #pragma GCC target (xxx) to set target specific options. */
740 static void
741 handle_pragma_target(cpp_reader *ARG_UNUSED(dummy))
742 {
743 enum cpp_ttype token;
744 tree x;
745 bool close_paren_needed_p = false;
746
747 if (cfun)
748 {
749 error ("#pragma GCC option is not allowed inside functions");
750 return;
751 }
752
753 token = pragma_lex (&x);
754 if (token == CPP_OPEN_PAREN)
755 {
756 close_paren_needed_p = true;
757 token = pragma_lex (&x);
758 }
759
760 if (token != CPP_STRING)
761 {
762 GCC_BAD ("%<#pragma GCC option%> is not a string");
763 return;
764 }
765
766 /* Strings are user options. */
767 else
768 {
769 tree args = NULL_TREE;
770
771 do
772 {
773 /* Build up the strings now as a tree linked list. Skip empty
774 strings. */
775 if (TREE_STRING_LENGTH (x) > 0)
776 args = tree_cons (NULL_TREE, x, args);
777
778 token = pragma_lex (&x);
779 while (token == CPP_COMMA)
780 token = pragma_lex (&x);
781 }
782 while (token == CPP_STRING);
783
784 if (close_paren_needed_p)
785 {
786 if (token == CPP_CLOSE_PAREN)
787 token = pragma_lex (&x);
788 else
789 GCC_BAD ("%<#pragma GCC target (string [,string]...)%> does "
790 "not have a final %<)%>");
791 }
792
793 if (token != CPP_EOF)
794 {
795 error ("#pragma GCC target string... is badly formed");
796 return;
797 }
798
799 /* put arguments in the order the user typed them. */
800 args = nreverse (args);
801
802 if (targetm.target_option.pragma_parse (args, NULL_TREE))
803 current_target_pragma = args;
804 }
805 }
806
807 /* Handle #pragma GCC optimize to set optimization options. */
808 static void
809 handle_pragma_optimize (cpp_reader *ARG_UNUSED(dummy))
810 {
811 enum cpp_ttype token;
812 tree x;
813 bool close_paren_needed_p = false;
814 tree optimization_previous_node = optimization_current_node;
815
816 if (cfun)
817 {
818 error ("#pragma GCC optimize is not allowed inside functions");
819 return;
820 }
821
822 token = pragma_lex (&x);
823 if (token == CPP_OPEN_PAREN)
824 {
825 close_paren_needed_p = true;
826 token = pragma_lex (&x);
827 }
828
829 if (token != CPP_STRING && token != CPP_NUMBER)
830 {
831 GCC_BAD ("%<#pragma GCC optimize%> is not a string or number");
832 return;
833 }
834
835 /* Strings/numbers are user options. */
836 else
837 {
838 tree args = NULL_TREE;
839
840 do
841 {
842 /* Build up the numbers/strings now as a list. */
843 if (token != CPP_STRING || TREE_STRING_LENGTH (x) > 0)
844 args = tree_cons (NULL_TREE, x, args);
845
846 token = pragma_lex (&x);
847 while (token == CPP_COMMA)
848 token = pragma_lex (&x);
849 }
850 while (token == CPP_STRING || token == CPP_NUMBER);
851
852 if (close_paren_needed_p)
853 {
854 if (token == CPP_CLOSE_PAREN)
855 token = pragma_lex (&x);
856 else
857 GCC_BAD ("%<#pragma GCC optimize (string [,string]...)%> does "
858 "not have a final %<)%>");
859 }
860
861 if (token != CPP_EOF)
862 {
863 error ("#pragma GCC optimize string... is badly formed");
864 return;
865 }
866
867 /* put arguments in the order the user typed them. */
868 args = nreverse (args);
869
870 parse_optimize_options (args, false);
871 current_optimize_pragma = chainon (current_optimize_pragma, args);
872 optimization_current_node = build_optimization_node ();
873 c_cpp_builtins_optimize_pragma (parse_in,
874 optimization_previous_node,
875 optimization_current_node);
876 }
877 }
878
879 /* Stack of the #pragma GCC options created with #pragma GCC push_option. Save
880 both the binary representation of the options and the TREE_LIST of
881 strings that will be added to the function's attribute list. */
882 typedef struct GTY(()) opt_stack {
883 struct opt_stack *prev;
884 tree target_binary;
885 tree target_strings;
886 tree optimize_binary;
887 tree optimize_strings;
888 } opt_stack;
889
890 static GTY(()) struct opt_stack * options_stack;
891
892 /* Handle #pragma GCC push_options to save the current target and optimization
893 options. */
894
895 static void
896 handle_pragma_push_options (cpp_reader *ARG_UNUSED(dummy))
897 {
898 enum cpp_ttype token;
899 tree x = 0;
900 opt_stack *p;
901
902 token = pragma_lex (&x);
903 if (token != CPP_EOF)
904 {
905 warning (OPT_Wpragmas, "junk at end of %<#pragma push_options%>");
906 return;
907 }
908
909 p = ggc_alloc_opt_stack ();
910 p->prev = options_stack;
911 options_stack = p;
912
913 /* Save optimization and target flags in binary format. */
914 p->optimize_binary = build_optimization_node ();
915 p->target_binary = build_target_option_node ();
916
917 /* Save optimization and target flags in string list format. */
918 p->optimize_strings = copy_list (current_optimize_pragma);
919 p->target_strings = copy_list (current_target_pragma);
920 }
921
922 /* Handle #pragma GCC pop_options to restore the current target and
923 optimization options from a previous push_options. */
924
925 static void
926 handle_pragma_pop_options (cpp_reader *ARG_UNUSED(dummy))
927 {
928 enum cpp_ttype token;
929 tree x = 0;
930 opt_stack *p;
931
932 token = pragma_lex (&x);
933 if (token != CPP_EOF)
934 {
935 warning (OPT_Wpragmas, "junk at end of %<#pragma pop_options%>");
936 return;
937 }
938
939 if (! options_stack)
940 {
941 warning (OPT_Wpragmas,
942 "%<#pragma GCC pop_options%> without a corresponding "
943 "%<#pragma GCC push_options%>");
944 return;
945 }
946
947 p = options_stack;
948 options_stack = p->prev;
949
950 if (p->target_binary != target_option_current_node)
951 {
952 (void) targetm.target_option.pragma_parse (NULL_TREE, p->target_binary);
953 target_option_current_node = p->target_binary;
954 }
955
956 if (p->optimize_binary != optimization_current_node)
957 {
958 tree old_optimize = optimization_current_node;
959 cl_optimization_restore (&global_options,
960 TREE_OPTIMIZATION (p->optimize_binary));
961 c_cpp_builtins_optimize_pragma (parse_in, old_optimize,
962 p->optimize_binary);
963 optimization_current_node = p->optimize_binary;
964 }
965
966 current_target_pragma = p->target_strings;
967 current_optimize_pragma = p->optimize_strings;
968 }
969
970 /* Handle #pragma GCC reset_options to restore the current target and
971 optimization options to the original options used on the command line. */
972
973 static void
974 handle_pragma_reset_options (cpp_reader *ARG_UNUSED(dummy))
975 {
976 enum cpp_ttype token;
977 tree x = 0;
978 tree new_optimize = optimization_default_node;
979 tree new_target = target_option_default_node;
980
981 token = pragma_lex (&x);
982 if (token != CPP_EOF)
983 {
984 warning (OPT_Wpragmas, "junk at end of %<#pragma reset_options%>");
985 return;
986 }
987
988 if (new_target != target_option_current_node)
989 {
990 (void) targetm.target_option.pragma_parse (NULL_TREE, new_target);
991 target_option_current_node = new_target;
992 }
993
994 if (new_optimize != optimization_current_node)
995 {
996 tree old_optimize = optimization_current_node;
997 cl_optimization_restore (&global_options,
998 TREE_OPTIMIZATION (new_optimize));
999 c_cpp_builtins_optimize_pragma (parse_in, old_optimize, new_optimize);
1000 optimization_current_node = new_optimize;
1001 }
1002
1003 current_target_pragma = NULL_TREE;
1004 current_optimize_pragma = NULL_TREE;
1005 }
1006
1007 /* Print a plain user-specified message. */
1008
1009 static void
1010 handle_pragma_message (cpp_reader *ARG_UNUSED(dummy))
1011 {
1012 enum cpp_ttype token;
1013 tree x, message = 0;
1014
1015 token = pragma_lex (&x);
1016 if (token == CPP_OPEN_PAREN)
1017 {
1018 token = pragma_lex (&x);
1019 if (token == CPP_STRING)
1020 message = x;
1021 else
1022 GCC_BAD ("expected a string after %<#pragma message%>");
1023 if (pragma_lex (&x) != CPP_CLOSE_PAREN)
1024 GCC_BAD ("malformed %<#pragma message%>, ignored");
1025 }
1026 else if (token == CPP_STRING)
1027 message = x;
1028 else
1029 GCC_BAD ("expected a string after %<#pragma message%>");
1030
1031 gcc_assert (message);
1032
1033 if (pragma_lex (&x) != CPP_EOF)
1034 warning (OPT_Wpragmas, "junk at end of %<#pragma message%>");
1035
1036 if (TREE_STRING_LENGTH (message) > 1)
1037 inform (input_location, "#pragma message: %s", TREE_STRING_POINTER (message));
1038 }
1039
1040 /* Mark whether the current location is valid for a STDC pragma. */
1041
1042 static bool valid_location_for_stdc_pragma;
1043
1044 void
1045 mark_valid_location_for_stdc_pragma (bool flag)
1046 {
1047 valid_location_for_stdc_pragma = flag;
1048 }
1049
1050 /* Return true if the current location is valid for a STDC pragma. */
1051
1052 bool
1053 valid_location_for_stdc_pragma_p (void)
1054 {
1055 return valid_location_for_stdc_pragma;
1056 }
1057
1058 enum pragma_switch_t { PRAGMA_ON, PRAGMA_OFF, PRAGMA_DEFAULT, PRAGMA_BAD };
1059
1060 /* A STDC pragma must appear outside of external declarations or
1061 preceding all explicit declarations and statements inside a compound
1062 statement; its behavior is undefined if used in any other context.
1063 It takes a switch of ON, OFF, or DEFAULT. */
1064
1065 static enum pragma_switch_t
1066 handle_stdc_pragma (const char *pname)
1067 {
1068 const char *arg;
1069 tree t;
1070 enum pragma_switch_t ret;
1071
1072 if (!valid_location_for_stdc_pragma_p ())
1073 {
1074 warning (OPT_Wpragmas, "invalid location for %<pragma %s%>, ignored",
1075 pname);
1076 return PRAGMA_BAD;
1077 }
1078
1079 if (pragma_lex (&t) != CPP_NAME)
1080 {
1081 warning (OPT_Wpragmas, "malformed %<#pragma %s%>, ignored", pname);
1082 return PRAGMA_BAD;
1083 }
1084
1085 arg = IDENTIFIER_POINTER (t);
1086
1087 if (!strcmp (arg, "ON"))
1088 ret = PRAGMA_ON;
1089 else if (!strcmp (arg, "OFF"))
1090 ret = PRAGMA_OFF;
1091 else if (!strcmp (arg, "DEFAULT"))
1092 ret = PRAGMA_DEFAULT;
1093 else
1094 {
1095 warning (OPT_Wpragmas, "malformed %<#pragma %s%>, ignored", pname);
1096 return PRAGMA_BAD;
1097 }
1098
1099 if (pragma_lex (&t) != CPP_EOF)
1100 {
1101 warning (OPT_Wpragmas, "junk at end of %<#pragma %s%>", pname);
1102 return PRAGMA_BAD;
1103 }
1104
1105 return ret;
1106 }
1107
1108 /* #pragma STDC FLOAT_CONST_DECIMAL64 ON
1109 #pragma STDC FLOAT_CONST_DECIMAL64 OFF
1110 #pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT */
1111
1112 static void
1113 handle_pragma_float_const_decimal64 (cpp_reader *ARG_UNUSED (dummy))
1114 {
1115 if (c_dialect_cxx ())
1116 {
1117 if (warn_unknown_pragmas > in_system_header)
1118 warning (OPT_Wunknown_pragmas,
1119 "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
1120 " for C++");
1121 return;
1122 }
1123
1124 if (!targetm.decimal_float_supported_p ())
1125 {
1126 if (warn_unknown_pragmas > in_system_header)
1127 warning (OPT_Wunknown_pragmas,
1128 "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported"
1129 " on this target");
1130 return;
1131 }
1132
1133 pedwarn (input_location, OPT_pedantic,
1134 "ISO C does not support %<#pragma STDC FLOAT_CONST_DECIMAL64%>");
1135
1136 switch (handle_stdc_pragma ("STDC FLOAT_CONST_DECIMAL64"))
1137 {
1138 case PRAGMA_ON:
1139 set_float_const_decimal64 ();
1140 break;
1141 case PRAGMA_OFF:
1142 case PRAGMA_DEFAULT:
1143 clear_float_const_decimal64 ();
1144 break;
1145 case PRAGMA_BAD:
1146 break;
1147 }
1148 }
1149
1150 /* A vector of registered pragma callbacks, which is never freed. */
1151 DEF_VEC_O (internal_pragma_handler);
1152 DEF_VEC_ALLOC_O (internal_pragma_handler, heap);
1153
1154 static VEC(internal_pragma_handler, heap) *registered_pragmas;
1155
1156 typedef struct
1157 {
1158 const char *space;
1159 const char *name;
1160 } pragma_ns_name;
1161
1162 DEF_VEC_O (pragma_ns_name);
1163 DEF_VEC_ALLOC_O (pragma_ns_name, heap);
1164
1165 static VEC(pragma_ns_name, heap) *registered_pp_pragmas;
1166
1167 struct omp_pragma_def { const char *name; unsigned int id; };
1168 static const struct omp_pragma_def omp_pragmas[] = {
1169 { "atomic", PRAGMA_OMP_ATOMIC },
1170 { "barrier", PRAGMA_OMP_BARRIER },
1171 { "critical", PRAGMA_OMP_CRITICAL },
1172 { "flush", PRAGMA_OMP_FLUSH },
1173 { "for", PRAGMA_OMP_FOR },
1174 { "master", PRAGMA_OMP_MASTER },
1175 { "ordered", PRAGMA_OMP_ORDERED },
1176 { "parallel", PRAGMA_OMP_PARALLEL },
1177 { "section", PRAGMA_OMP_SECTION },
1178 { "sections", PRAGMA_OMP_SECTIONS },
1179 { "single", PRAGMA_OMP_SINGLE },
1180 { "task", PRAGMA_OMP_TASK },
1181 { "taskwait", PRAGMA_OMP_TASKWAIT },
1182 { "threadprivate", PRAGMA_OMP_THREADPRIVATE }
1183 };
1184
1185 void
1186 c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
1187 {
1188 const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas);
1189 int i;
1190
1191 for (i = 0; i < n_omp_pragmas; ++i)
1192 if (omp_pragmas[i].id == id)
1193 {
1194 *space = "omp";
1195 *name = omp_pragmas[i].name;
1196 return;
1197 }
1198
1199 if (id >= PRAGMA_FIRST_EXTERNAL
1200 && (id < PRAGMA_FIRST_EXTERNAL
1201 + VEC_length (pragma_ns_name, registered_pp_pragmas)))
1202 {
1203 *space = VEC_index (pragma_ns_name, registered_pp_pragmas,
1204 id - PRAGMA_FIRST_EXTERNAL)->space;
1205 *name = VEC_index (pragma_ns_name, registered_pp_pragmas,
1206 id - PRAGMA_FIRST_EXTERNAL)->name;
1207 return;
1208 }
1209
1210 gcc_unreachable ();
1211 }
1212
1213 /* Front-end wrappers for pragma registration to avoid dragging
1214 cpplib.h in almost everywhere. */
1215
1216 static void
1217 c_register_pragma_1 (const char *space, const char *name,
1218 internal_pragma_handler ihandler, bool allow_expansion)
1219 {
1220 unsigned id;
1221
1222 if (flag_preprocess_only)
1223 {
1224 pragma_ns_name ns_name;
1225
1226 if (!allow_expansion)
1227 return;
1228
1229 ns_name.space = space;
1230 ns_name.name = name;
1231 VEC_safe_push (pragma_ns_name, heap, registered_pp_pragmas, &ns_name);
1232 id = VEC_length (pragma_ns_name, registered_pp_pragmas);
1233 id += PRAGMA_FIRST_EXTERNAL - 1;
1234 }
1235 else
1236 {
1237 VEC_safe_push (internal_pragma_handler, heap, registered_pragmas,
1238 &ihandler);
1239 id = VEC_length (internal_pragma_handler, registered_pragmas);
1240 id += PRAGMA_FIRST_EXTERNAL - 1;
1241
1242 /* The C++ front end allocates 6 bits in cp_token; the C front end
1243 allocates 7 bits in c_token. At present this is sufficient. */
1244 gcc_assert (id < 64);
1245 }
1246
1247 cpp_register_deferred_pragma (parse_in, space, name, id,
1248 allow_expansion, false);
1249 }
1250
1251 /* Register a C pragma handler, using a space and a name. It disallows pragma
1252 expansion (if you want it, use c_register_pragma_with_expansion instead). */
1253 void
1254 c_register_pragma (const char *space, const char *name,
1255 pragma_handler_1arg handler)
1256 {
1257 internal_pragma_handler ihandler;
1258
1259 ihandler.handler.handler_1arg = handler;
1260 ihandler.extra_data = false;
1261 ihandler.data = NULL;
1262 c_register_pragma_1 (space, name, ihandler, false);
1263 }
1264
1265 /* Register a C pragma handler, using a space and a name, it also carries an
1266 extra data field which can be used by the handler. It disallows pragma
1267 expansion (if you want it, use c_register_pragma_with_expansion_and_data
1268 instead). */
1269 void
1270 c_register_pragma_with_data (const char *space, const char *name,
1271 pragma_handler_2arg handler, void * data)
1272 {
1273 internal_pragma_handler ihandler;
1274
1275 ihandler.handler.handler_2arg = handler;
1276 ihandler.extra_data = true;
1277 ihandler.data = data;
1278 c_register_pragma_1 (space, name, ihandler, false);
1279 }
1280
1281 /* Register a C pragma handler, using a space and a name. It allows pragma
1282 expansion as in the following example:
1283
1284 #define NUMBER 10
1285 #pragma count (NUMBER)
1286
1287 Name expansion is still disallowed. */
1288 void
1289 c_register_pragma_with_expansion (const char *space, const char *name,
1290 pragma_handler_1arg handler)
1291 {
1292 internal_pragma_handler ihandler;
1293
1294 ihandler.handler.handler_1arg = handler;
1295 ihandler.extra_data = false;
1296 ihandler.data = NULL;
1297 c_register_pragma_1 (space, name, ihandler, true);
1298 }
1299
1300 /* Register a C pragma handler, using a space and a name, it also carries an
1301 extra data field which can be used by the handler. It allows pragma
1302 expansion as in the following example:
1303
1304 #define NUMBER 10
1305 #pragma count (NUMBER)
1306
1307 Name expansion is still disallowed. */
1308 void
1309 c_register_pragma_with_expansion_and_data (const char *space, const char *name,
1310 pragma_handler_2arg handler,
1311 void *data)
1312 {
1313 internal_pragma_handler ihandler;
1314
1315 ihandler.handler.handler_2arg = handler;
1316 ihandler.extra_data = true;
1317 ihandler.data = data;
1318 c_register_pragma_1 (space, name, ihandler, true);
1319 }
1320
1321 void
1322 c_invoke_pragma_handler (unsigned int id)
1323 {
1324 internal_pragma_handler *ihandler;
1325 pragma_handler_1arg handler_1arg;
1326 pragma_handler_2arg handler_2arg;
1327
1328 id -= PRAGMA_FIRST_EXTERNAL;
1329 ihandler = VEC_index (internal_pragma_handler, registered_pragmas, id);
1330 if (ihandler->extra_data)
1331 {
1332 handler_2arg = ihandler->handler.handler_2arg;
1333 handler_2arg (parse_in, ihandler->data);
1334 }
1335 else
1336 {
1337 handler_1arg = ihandler->handler.handler_1arg;
1338 handler_1arg (parse_in);
1339 }
1340 }
1341
1342 /* Set up front-end pragmas. */
1343 void
1344 init_pragma (void)
1345 {
1346 if (flag_openmp)
1347 {
1348 const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas);
1349 int i;
1350
1351 for (i = 0; i < n_omp_pragmas; ++i)
1352 cpp_register_deferred_pragma (parse_in, "omp", omp_pragmas[i].name,
1353 omp_pragmas[i].id, true, true);
1354 }
1355
1356 if (!flag_preprocess_only)
1357 cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess",
1358 PRAGMA_GCC_PCH_PREPROCESS, false, false);
1359
1360 #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
1361 c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
1362 #else
1363 c_register_pragma (0, "pack", handle_pragma_pack);
1364 #endif
1365 c_register_pragma (0, "weak", handle_pragma_weak);
1366 c_register_pragma ("GCC", "visibility", handle_pragma_visibility);
1367
1368 c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic);
1369 c_register_pragma ("GCC", "target", handle_pragma_target);
1370 c_register_pragma ("GCC", "optimize", handle_pragma_optimize);
1371 c_register_pragma ("GCC", "push_options", handle_pragma_push_options);
1372 c_register_pragma ("GCC", "pop_options", handle_pragma_pop_options);
1373 c_register_pragma ("GCC", "reset_options", handle_pragma_reset_options);
1374
1375 c_register_pragma ("STDC", "FLOAT_CONST_DECIMAL64",
1376 handle_pragma_float_const_decimal64);
1377
1378 c_register_pragma_with_expansion (0, "redefine_extname",
1379 handle_pragma_redefine_extname);
1380 c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
1381
1382 c_register_pragma_with_expansion (0, "message", handle_pragma_message);
1383
1384 #ifdef REGISTER_TARGET_PRAGMAS
1385 REGISTER_TARGET_PRAGMAS ();
1386 #endif
1387
1388 /* Allow plugins to register their own pragmas. */
1389 invoke_plugin_callbacks (PLUGIN_PRAGMAS, NULL);
1390 }
1391
1392 #include "gt-c-family-c-pragma.h"
This page took 0.098893 seconds and 5 git commands to generate.