PR libgfortran/27107:
[official-gcc.git] / gcc / c-pragma.h
blob9a3ff976b1c1705766a17fbbe86fad619fd6f892
1 /* Pragma related interfaces.
2 Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
3 Free Software Foundation, Inc.
5 This file is part of GCC.
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.
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.
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, 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA. */
22 #ifndef GCC_C_PRAGMA_H
23 #define GCC_C_PRAGMA_H
25 #include <cpplib.h> /* For enum cpp_ttype. */
27 /* Pragma identifiers built in to the front end parsers. Identifiers
28 for ancillary handlers will follow these. */
29 typedef enum pragma_kind {
30 PRAGMA_NONE = 0,
32 PRAGMA_OMP_ATOMIC,
33 PRAGMA_OMP_BARRIER,
34 PRAGMA_OMP_CRITICAL,
35 PRAGMA_OMP_FLUSH,
36 PRAGMA_OMP_FOR,
37 PRAGMA_OMP_MASTER,
38 PRAGMA_OMP_ORDERED,
39 PRAGMA_OMP_PARALLEL,
40 PRAGMA_OMP_PARALLEL_FOR,
41 PRAGMA_OMP_PARALLEL_SECTIONS,
42 PRAGMA_OMP_SECTION,
43 PRAGMA_OMP_SECTIONS,
44 PRAGMA_OMP_SINGLE,
45 PRAGMA_OMP_THREADPRIVATE,
47 PRAGMA_GCC_PCH_PREPROCESS,
49 PRAGMA_FIRST_EXTERNAL
50 } pragma_kind;
53 /* All clauses defined by OpenMP 2.5.
54 Used internally by both C and C++ parsers. */
55 typedef enum pragma_omp_clause {
56 PRAGMA_OMP_CLAUSE_NONE = 0,
58 PRAGMA_OMP_CLAUSE_COPYIN,
59 PRAGMA_OMP_CLAUSE_COPYPRIVATE,
60 PRAGMA_OMP_CLAUSE_DEFAULT,
61 PRAGMA_OMP_CLAUSE_FIRSTPRIVATE,
62 PRAGMA_OMP_CLAUSE_IF,
63 PRAGMA_OMP_CLAUSE_LASTPRIVATE,
64 PRAGMA_OMP_CLAUSE_NOWAIT,
65 PRAGMA_OMP_CLAUSE_NUM_THREADS,
66 PRAGMA_OMP_CLAUSE_ORDERED,
67 PRAGMA_OMP_CLAUSE_PRIVATE,
68 PRAGMA_OMP_CLAUSE_REDUCTION,
69 PRAGMA_OMP_CLAUSE_SCHEDULE,
70 PRAGMA_OMP_CLAUSE_SHARED
71 } pragma_omp_clause;
73 extern struct cpp_reader* parse_in;
75 #define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
77 #ifdef HANDLE_SYSV_PRAGMA
78 /* We always support #pragma pack for SYSV pragmas. */
79 #ifndef HANDLE_PRAGMA_PACK
80 #define HANDLE_PRAGMA_PACK 1
81 #endif
82 #endif /* HANDLE_SYSV_PRAGMA */
85 #ifdef HANDLE_PRAGMA_PACK_PUSH_POP
86 /* If we are supporting #pragma pack(push... then we automatically
87 support #pragma pack(<n>) */
88 #define HANDLE_PRAGMA_PACK 1
89 #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
91 /* It's safe to always leave visibility pragma enabled as if
92 visibility is not supported on the host OS platform the
93 statements are ignored. */
94 #define HANDLE_PRAGMA_VISIBILITY 1
95 extern void push_visibility (const char *);
96 extern void pop_visibility (void);
98 extern void init_pragma (void);
100 /* Front-end wrappers for pragma registration. */
101 typedef void (*pragma_handler)(struct cpp_reader *);
102 extern void c_register_pragma (const char *, const char *, pragma_handler);
103 extern void c_register_pragma_with_expansion (const char *, const char *,
104 pragma_handler);
105 extern void c_invoke_pragma_handler (unsigned int);
107 extern void maybe_apply_pragma_weak (tree);
108 extern void maybe_apply_pending_pragma_weaks (void);
109 extern tree maybe_apply_renaming_pragma (tree, tree);
110 extern void add_to_renaming_pragma_list (tree, tree);
112 extern enum cpp_ttype pragma_lex (tree *);
114 /* This is not actually available to pragma parsers. It's merely a
115 convenient location to declare this function for c-lex, after
116 having enum cpp_ttype declared. */
117 extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *);
119 /* If 1, then lex strings into the execution character set.
120 If 0, lex strings into the host character set.
121 If -1, lex both, and chain them together, such that the former
122 is the TREE_CHAIN of the latter. */
123 extern int c_lex_string_translate;
125 /* If true, strings should be passed to the caller of c_lex completely
126 unmolested (no concatenation, no translation). */
127 extern bool c_lex_return_raw_strings;
129 #endif /* GCC_C_PRAGMA_H */