Document the recently added WITHOUT_SRCS variable.
[dragonfly.git] / contrib / gcc-4.0 / gcc / 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
3    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 2, 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 COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26 #include "rtl.h"
27 #include "tree.h"
28 #include "function.h"
29 #include "cpplib.h"
30 #include "c-pragma.h"
31 #include "flags.h"
32 #include "toplev.h"
33 #include "ggc.h"
34 #include "c-common.h"
35 #include "output.h"
36 #include "tm_p.h"
37 #include "target.h"
38
39 #define GCC_BAD(gmsgid) do { warning (gmsgid); return; } while (0)
40 #define GCC_BAD2(gmsgid, arg) \
41   do { warning (gmsgid, arg); return; } while (0)
42
43 typedef struct align_stack GTY(())
44 {
45   int                  alignment;
46   tree                 id;
47   struct align_stack * prev;
48 } align_stack;
49
50 static GTY(()) struct align_stack * alignment_stack;
51
52 #ifdef HANDLE_PRAGMA_PACK
53 static void handle_pragma_pack (cpp_reader *);
54
55 #ifdef HANDLE_PRAGMA_PACK_PUSH_POP
56 /* If we have a "global" #pragma pack(<n>) in effect when the first
57    #pragma pack(push,<n>) is encountered, this stores the value of 
58    maximum_field_alignment in effect.  When the final pop_alignment() 
59    happens, we restore the value to this, not to a value of 0 for
60    maximum_field_alignment.  Value is in bits.  */
61 static int default_alignment;
62 #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \
63         ? &default_alignment \
64         : &alignment_stack->alignment) = (ALIGN))
65
66 static void push_alignment (int, tree);
67 static void pop_alignment (tree);
68
69 /* Push an alignment value onto the stack.  */
70 static void
71 push_alignment (int alignment, tree id)
72 {
73   align_stack * entry;
74
75   entry = ggc_alloc (sizeof (* entry));
76
77   entry->alignment  = alignment;
78   entry->id         = id;
79   entry->prev       = alignment_stack;
80        
81   /* The current value of maximum_field_alignment is not necessarily 
82      0 since there may be a #pragma pack(<n>) in effect; remember it 
83      so that we can restore it after the final #pragma pop().  */
84   if (alignment_stack == NULL)
85     default_alignment = maximum_field_alignment;
86  
87   alignment_stack = entry;
88
89   maximum_field_alignment = alignment;
90 }
91
92 /* Undo a push of an alignment onto the stack.  */
93 static void
94 pop_alignment (tree id)
95 {
96   align_stack * entry;
97       
98   if (alignment_stack == NULL)
99     GCC_BAD ("#pragma pack (pop) encountered without matching #pragma pack (push)");
100
101   /* If we got an identifier, strip away everything above the target
102      entry so that the next step will restore the state just below it.  */
103   if (id)
104     {
105       for (entry = alignment_stack; entry; entry = entry->prev)
106         if (entry->id == id)
107           {
108             alignment_stack = entry;
109             break;
110           }
111       if (entry == NULL)
112         warning ("\
113 #pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)"
114                  , IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id));
115     }
116
117   entry = alignment_stack->prev;
118
119   maximum_field_alignment = entry ? entry->alignment : default_alignment;
120
121   alignment_stack = entry;
122 }
123 #else  /* not HANDLE_PRAGMA_PACK_PUSH_POP */
124 #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN))
125 #define push_alignment(ID, N) \
126     GCC_BAD ("#pragma pack(push[, id], <n>) is not supported on this target")
127 #define pop_alignment(ID) \
128     GCC_BAD ("#pragma pack(pop[, id], <n>) is not supported on this target")
129 #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
130
131 /* #pragma pack ()
132    #pragma pack (N)
133    
134    #pragma pack (push)
135    #pragma pack (push, N)
136    #pragma pack (push, ID)
137    #pragma pack (push, ID, N)
138    #pragma pack (pop)
139    #pragma pack (pop, ID) */
140 static void
141 handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
142 {
143   tree x, id = 0;
144   int align = -1;
145   enum cpp_ttype token;
146   enum { set, push, pop } action;
147
148   if (c_lex (&x) != CPP_OPEN_PAREN)
149     GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
150
151   token = c_lex (&x);
152   if (token == CPP_CLOSE_PAREN)
153     {
154       action = set;
155       align = initial_max_fld_align;
156     }
157   else if (token == CPP_NUMBER)
158     {
159       align = TREE_INT_CST_LOW (x);
160       action = set;
161       if (c_lex (&x) != CPP_CLOSE_PAREN)
162         GCC_BAD ("malformed %<#pragma pack%> - ignored");
163     }
164   else if (token == CPP_NAME)
165     {
166 #define GCC_BAD_ACTION do { if (action != pop) \
167           GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
168         else \
169           GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
170         } while (0)
171
172       const char *op = IDENTIFIER_POINTER (x);
173       if (!strcmp (op, "push"))
174         action = push;
175       else if (!strcmp (op, "pop"))
176         action = pop;
177       else
178         GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op);
179
180       while ((token = c_lex (&x)) == CPP_COMMA)
181         {
182           token = c_lex (&x);
183           if (token == CPP_NAME && id == 0)
184             {
185               id = x;
186             }
187           else if (token == CPP_NUMBER && action == push && align == -1)
188             {
189               align = TREE_INT_CST_LOW (x);
190               if (align == -1)
191                 action = set;
192             }
193           else
194             GCC_BAD_ACTION;
195         }
196
197       if (token != CPP_CLOSE_PAREN)
198         GCC_BAD_ACTION;
199 #undef GCC_BAD_ACTION
200     }
201   else
202     GCC_BAD ("malformed %<#pragma pack%> - ignored");
203
204   if (c_lex (&x) != CPP_EOF)
205     warning ("junk at end of %<#pragma pack%>");
206
207   if (flag_pack_struct)
208     GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
209
210   if (action != pop)
211     switch (align)
212       {
213       case 0:
214       case 1:
215       case 2:
216       case 4:
217       case 8:
218       case 16:
219         align *= BITS_PER_UNIT;
220         break;
221       case -1:
222         if (action == push)
223           {
224             align = maximum_field_alignment;
225             break;
226           }
227       default:
228         GCC_BAD2 ("alignment must be a small power of two, not %d", align);
229       }
230
231   switch (action)
232     {
233     case set:   SET_GLOBAL_ALIGNMENT (align);  break;
234     case push:  push_alignment (align, id);    break;
235     case pop:   pop_alignment (id);            break;
236     }
237 }
238 #endif  /* HANDLE_PRAGMA_PACK */
239
240 static GTY(()) tree pending_weaks;
241
242 #ifdef HANDLE_PRAGMA_WEAK
243 static void apply_pragma_weak (tree, tree);
244 static void handle_pragma_weak (cpp_reader *);
245
246 static void
247 apply_pragma_weak (tree decl, tree value)
248 {
249   if (value)
250     {
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)),
255                        0);
256     }
257
258   if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
259       && !DECL_WEAK (decl) /* Don't complain about a redundant #pragma.  */
260       && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
261     warning ("%Japplying #pragma weak %qD after first use results "
262              "in unspecified behavior", decl, decl);
263
264   declare_weak (decl);
265 }
266
267 void
268 maybe_apply_pragma_weak (tree decl)
269 {
270   tree *p, t, id;
271
272   /* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed.  */
273
274   /* No weak symbols pending, take the short-cut.  */
275   if (!pending_weaks)
276     return;
277   /* If it's not visible outside this file, it doesn't matter whether
278      it's weak.  */
279   if (!DECL_EXTERNAL (decl) && !TREE_PUBLIC (decl))
280     return;
281   /* If it's not a function or a variable, it can't be weak.
282      FIXME: what kinds of things are visible outside this file but
283      aren't functions or variables?   Should this be an assert instead?  */
284   if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
285     return;
286
287   id = DECL_ASSEMBLER_NAME (decl);
288
289   for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
290     if (id == TREE_PURPOSE (t))
291       {
292         apply_pragma_weak (decl, TREE_VALUE (t));
293         *p = TREE_CHAIN (t);
294         break;
295       }
296 }
297
298 /* Process all "#pragma weak A = B" directives where we have not seen
299    a decl for A.  */
300 void
301 maybe_apply_pending_pragma_weaks (void)
302 {
303   tree *p, t, alias_id, id, decl, *next;
304
305   for (p = &pending_weaks; (t = *p) ; p = next)
306     {
307       next = &TREE_CHAIN (t);
308       alias_id = TREE_PURPOSE (t);
309       id = TREE_VALUE (t);
310
311       if (TREE_VALUE (t) == NULL)
312         continue;
313
314       decl = build_decl (FUNCTION_DECL, alias_id, default_function_type);
315
316       DECL_ARTIFICIAL (decl) = 1;
317       TREE_PUBLIC (decl) = 1;
318       DECL_EXTERNAL (decl) = 1;
319       DECL_WEAK (decl) = 1;
320
321       assemble_alias (decl, id);
322     }
323 }
324
325 /* #pragma weak name [= value] */
326 static void
327 handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
328 {
329   tree name, value, x, decl;
330   enum cpp_ttype t;
331
332   value = 0;
333
334   if (c_lex (&name) != CPP_NAME)
335     GCC_BAD ("malformed #pragma weak, ignored");
336   t = c_lex (&x);
337   if (t == CPP_EQ)
338     {
339       if (c_lex (&value) != CPP_NAME)
340         GCC_BAD ("malformed #pragma weak, ignored");
341       t = c_lex (&x);
342     }
343   if (t != CPP_EOF)
344     warning ("junk at end of #pragma weak");
345
346   decl = identifier_global_value (name);
347   if (decl && DECL_P (decl))
348     {
349       apply_pragma_weak (decl, value);
350       if (value)
351         assemble_alias (decl, value);
352     }
353   else
354     pending_weaks = tree_cons (name, value, pending_weaks);
355 }
356 #else
357 void
358 maybe_apply_pragma_weak (tree ARG_UNUSED (decl))
359 {
360 }
361
362 void
363 maybe_apply_pending_pragma_weaks (void)
364 {
365 }
366 #endif /* HANDLE_PRAGMA_WEAK */
367
368 /* GCC supports two #pragma directives for renaming the external
369    symbol associated with a declaration (DECL_ASSEMBLER_NAME), for
370    compatibility with the Solaris and Tru64 system headers.  GCC also
371    has its own notation for this, __asm__("name") annotations.
372
373    Corner cases of these features and their interaction:
374
375    1) Both pragmas silently apply only to declarations with external
376       linkage (that is, TREE_PUBLIC || DECL_EXTERNAL).  Asm labels
377       do not have this restriction.
378
379    2) In C++, both #pragmas silently apply only to extern "C" declarations.
380       Asm labels do not have this restriction.
381
382    3) If any of the three ways of changing DECL_ASSEMBLER_NAME is
383       applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the
384       new name is different, a warning issues and the name does not change.
385
386    4) The "source name" for #pragma redefine_extname is the DECL_NAME,
387       *not* the DECL_ASSEMBLER_NAME.
388
389    5) If #pragma extern_prefix is in effect and a declaration occurs
390       with an __asm__ name, the #pragma extern_prefix is silently
391       ignored for that declaration.
392
393    6) If #pragma extern_prefix and #pragma redefine_extname apply to
394       the same declaration, whichever triggered first wins, and a warning
395       is issued.  (We would like to have #pragma redefine_extname always
396       win, but it can appear either before or after the declaration, and
397       if it appears afterward, we have no way of knowing whether a modified
398       DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.)  */
399
400 static GTY(()) tree pending_redefine_extname;
401
402 static void handle_pragma_redefine_extname (cpp_reader *);
403
404 /* #pragma redefine_extname oldname newname */
405 static void
406 handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
407 {
408   tree oldname, newname, decl, x;
409   enum cpp_ttype t;
410
411   if (c_lex (&oldname) != CPP_NAME)
412     GCC_BAD ("malformed #pragma redefine_extname, ignored");
413   if (c_lex (&newname) != CPP_NAME)
414     GCC_BAD ("malformed #pragma redefine_extname, ignored");
415   t = c_lex (&x);
416   if (t != CPP_EOF)
417     warning ("junk at end of #pragma redefine_extname");
418
419   if (!flag_mudflap && !targetm.handle_pragma_redefine_extname)
420     {
421       if (warn_unknown_pragmas > in_system_header)
422         warning ("#pragma redefine_extname not supported on this target");
423       return;
424     }
425
426   decl = identifier_global_value (oldname);
427   if (decl
428       && (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
429       && (TREE_CODE (decl) == FUNCTION_DECL
430           || TREE_CODE (decl) == VAR_DECL)
431       && has_c_linkage (decl))
432     {
433       if (DECL_ASSEMBLER_NAME_SET_P (decl))
434         {
435           const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
436           name = targetm.strip_name_encoding (name);
437
438           if (strcmp (name, IDENTIFIER_POINTER (newname)))
439             warning ("#pragma redefine_extname ignored due to conflict with "
440                      "previous rename");
441         }
442       else
443         change_decl_assembler_name (decl, newname);
444     }
445   else
446     /* We have to add this to the rename list even if there's already
447        a global value that doesn't meet the above criteria, because in
448        C++ "struct foo {...};" puts "foo" in the current namespace but
449        does *not* conflict with a subsequent declaration of a function
450        or variable foo.  See g++.dg/other/pragma-re-2.C.  */
451     add_to_renaming_pragma_list (oldname, newname);
452 }
453
454 /* This is called from here and from ia64.c.  */
455 void
456 add_to_renaming_pragma_list (tree oldname, tree newname)
457 {
458   tree previous = purpose_member (oldname, pending_redefine_extname);
459   if (previous)
460     {
461       if (TREE_VALUE (previous) != newname)
462         warning ("#pragma redefine_extname ignored due to conflict with "
463                  "previous #pragma redefine_extname");
464       return;
465     }
466   
467   pending_redefine_extname
468     = tree_cons (oldname, newname, pending_redefine_extname);
469 }
470
471 static GTY(()) tree pragma_extern_prefix;
472
473 /* #pragma extern_prefix "prefix" */
474 static void
475 handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
476 {
477   tree prefix, x;
478   enum cpp_ttype t;
479
480   if (c_lex (&prefix) != CPP_STRING)
481     GCC_BAD ("malformed #pragma extern_prefix, ignored");
482   t = c_lex (&x);
483   if (t != CPP_EOF)
484     warning ("junk at end of #pragma extern_prefix");
485
486   if (targetm.handle_pragma_extern_prefix)
487     /* Note that the length includes the null terminator.  */
488     pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL);
489   else if (warn_unknown_pragmas > in_system_header)
490     warning ("#pragma extern_prefix not supported on this target");
491 }
492
493 /* Hook from the front ends to apply the results of one of the preceding
494    pragmas that rename variables.  */
495
496 tree
497 maybe_apply_renaming_pragma (tree decl, tree asmname)
498 {
499   tree *p, t;
500
501   /* The renaming pragmas are only applied to declarations with
502      external linkage.  */
503   if ((TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
504       || (!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl))
505       || !has_c_linkage (decl))
506     return asmname;
507
508   /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
509      but we may warn about a rename that conflicts.  */
510   if (DECL_ASSEMBLER_NAME_SET_P (decl))
511     {
512       const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
513       oldname = targetm.strip_name_encoding (oldname);
514
515       if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname))
516           warning ("asm declaration ignored due to "
517                    "conflict with previous rename");
518
519       /* Take any pending redefine_extname off the list.  */
520       for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
521         if (DECL_NAME (decl) == TREE_PURPOSE (t))
522           {
523             /* Only warn if there is a conflict.  */
524             if (strcmp (IDENTIFIER_POINTER (TREE_VALUE (t)), oldname))
525               warning ("#pragma redefine_extname ignored due to "
526                        "conflict with previous rename");
527
528             *p = TREE_CHAIN (t);
529             break;
530           }
531       return 0;
532     }
533
534   /* Find out if we have a pending #pragma redefine_extname.  */
535   for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
536     if (DECL_NAME (decl) == TREE_PURPOSE (t))
537       {
538         tree newname = TREE_VALUE (t);
539         *p = TREE_CHAIN (t);
540
541         /* If we already have an asmname, #pragma redefine_extname is
542            ignored (with a warning if it conflicts).  */
543         if (asmname)
544           {
545             if (strcmp (TREE_STRING_POINTER (asmname),
546                         IDENTIFIER_POINTER (newname)) != 0)
547               warning ("#pragma redefine_extname ignored due to "
548                        "conflict with __asm__ declaration");
549             return asmname;
550           }
551
552         /* Otherwise we use what we've got; #pragma extern_prefix is
553            silently ignored.  */
554         return build_string (IDENTIFIER_LENGTH (newname),
555                              IDENTIFIER_POINTER (newname));
556       }
557
558   /* If we've got an asmname, #pragma extern_prefix is silently ignored.  */
559   if (asmname)
560     return asmname;
561
562   /* If #pragma extern_prefix is in effect, apply it.  */
563   if (pragma_extern_prefix)
564     {
565       const char *prefix = TREE_STRING_POINTER (pragma_extern_prefix);
566       size_t plen = TREE_STRING_LENGTH (pragma_extern_prefix) - 1;
567
568       const char *id = IDENTIFIER_POINTER (DECL_NAME (decl));
569       size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl));
570         
571       char *newname = (char *) alloca (plen + ilen + 1);
572
573       memcpy (newname,        prefix, plen);
574       memcpy (newname + plen, id, ilen + 1);
575
576       return build_string (plen + ilen, newname);
577     }
578
579   /* Nada.  */
580   return 0;
581 }
582
583
584 #ifdef HANDLE_PRAGMA_VISIBILITY
585 static void handle_pragma_visibility (cpp_reader *);
586
587 /* Sets the default visibility for symbols to something other than that
588    specified on the command line.  */
589 static void
590 handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
591 { /* Form is #pragma GCC visibility push(hidden)|pop */
592   static int visstack [16], visidx;
593   tree x;
594   enum cpp_ttype token;
595   enum { bad, push, pop } action = bad;
596  
597   token = c_lex (&x);
598   if (token == CPP_NAME)
599     {
600       const char *op = IDENTIFIER_POINTER (x);
601       if (!strcmp (op, "push"))
602         action = push;
603       else if (!strcmp (op, "pop"))
604         action = pop;
605     }
606   if (bad == action)
607     GCC_BAD ("#pragma GCC visibility must be followed by push or pop");
608   else
609     {
610       if (pop == action)
611         {
612           if (!visidx)
613             {
614               GCC_BAD ("No matching push for %<#pragma GCC visibility pop%>");
615             }
616           else
617             {
618               default_visibility = visstack[--visidx];
619               visibility_options.inpragma = (visidx>0);
620             }
621         }
622       else
623         {
624           if (c_lex (&x) != CPP_OPEN_PAREN)
625             GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
626           token = c_lex (&x);
627           if (token != CPP_NAME)
628             {
629               GCC_BAD ("malformed #pragma GCC visibility push");
630             }
631           else if (visidx >= 16)
632             {
633               GCC_BAD ("No more than sixteen #pragma GCC visibility pushes allowed at once");
634             }
635           else
636             {
637               const char *str = IDENTIFIER_POINTER (x);
638               visstack[visidx++] = default_visibility;
639               if (!strcmp (str, "default"))
640                 default_visibility = VISIBILITY_DEFAULT;
641               else if (!strcmp (str, "internal"))
642                 default_visibility = VISIBILITY_INTERNAL;
643               else if (!strcmp (str, "hidden"))
644                 default_visibility = VISIBILITY_HIDDEN;  
645               else if (!strcmp (str, "protected"))
646                 default_visibility = VISIBILITY_PROTECTED;
647               else
648                 {
649                   GCC_BAD ("#pragma GCC visibility push() must specify default, internal, hidden or protected");
650                 }
651               visibility_options.inpragma = 1;
652             }
653           if (c_lex (&x) != CPP_CLOSE_PAREN)
654             GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
655         }
656     }
657   if (c_lex (&x) != CPP_EOF)
658     warning ("junk at end of %<#pragma GCC visibility%>");
659 }
660
661 #endif
662
663 /* Front-end wrappers for pragma registration to avoid dragging
664    cpplib.h in almost everywhere.  */
665 void
666 c_register_pragma (const char *space, const char *name,
667                    void (*handler) (struct cpp_reader *))
668 {
669   cpp_register_pragma (parse_in, space, name, handler, 0);
670 }
671
672 void
673 c_register_pragma_with_expansion (const char *space, const char *name,
674                                   void (*handler) (struct cpp_reader *))
675 {
676   cpp_register_pragma (parse_in, space, name, handler, 1);
677 }
678
679 /* Set up front-end pragmas.  */
680 void
681 init_pragma (void)
682 {
683 #ifdef HANDLE_PRAGMA_PACK
684 #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
685   c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
686 #else
687   c_register_pragma (0, "pack", handle_pragma_pack);
688 #endif
689 #endif
690 #ifdef HANDLE_PRAGMA_WEAK
691   c_register_pragma (0, "weak", handle_pragma_weak);
692 #endif
693 #ifdef HANDLE_PRAGMA_VISIBILITY
694   c_register_pragma ("GCC", "visibility", handle_pragma_visibility);
695 #endif
696
697   c_register_pragma (0, "redefine_extname", handle_pragma_redefine_extname);
698   c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
699
700   c_register_pragma ("GCC", "pch_preprocess", c_common_pch_pragma);
701
702 #ifdef REGISTER_TARGET_PRAGMAS
703   REGISTER_TARGET_PRAGMAS ();
704 #endif
705 }
706
707 #include "gt-c-pragma.h"