]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c-pragma.h
* MAINTAINERS: Update my email address.
[thirdparty/gcc.git] / gcc / c-pragma.h
CommitLineData
3d6f7931 1/* Pragma related interfaces.
9dcd6f09 2 Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
a25a8f3b 3 2007, 2008 Free Software Foundation, Inc.
3d6f7931 4
1322177d 5This file is part of GCC.
3d6f7931 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9dcd6f09 9Software Foundation; either version 3, or (at your option) any later
1322177d 10version.
3d6f7931 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
3d6f7931
MM
16
17You should have received a copy of the GNU General Public License
9dcd6f09
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
3d6f7931 20
88657302
RH
21#ifndef GCC_C_PRAGMA_H
22#define GCC_C_PRAGMA_H
f09db6e0 23
f4086145
BI
24#include <cpplib.h> /* For enum cpp_ttype. */
25
bc4071dd 26/* Pragma identifiers built in to the front end parsers. Identifiers
c0220ea4 27 for ancillary handlers will follow these. */
bc4071dd
RH
28typedef enum pragma_kind {
29 PRAGMA_NONE = 0,
30
953ff289
DN
31 PRAGMA_OMP_ATOMIC,
32 PRAGMA_OMP_BARRIER,
33 PRAGMA_OMP_CRITICAL,
34 PRAGMA_OMP_FLUSH,
35 PRAGMA_OMP_FOR,
36 PRAGMA_OMP_MASTER,
37 PRAGMA_OMP_ORDERED,
38 PRAGMA_OMP_PARALLEL,
39 PRAGMA_OMP_PARALLEL_FOR,
40 PRAGMA_OMP_PARALLEL_SECTIONS,
41 PRAGMA_OMP_SECTION,
42 PRAGMA_OMP_SECTIONS,
43 PRAGMA_OMP_SINGLE,
44 PRAGMA_OMP_THREADPRIVATE,
45
bc4071dd
RH
46 PRAGMA_GCC_PCH_PREPROCESS,
47
48 PRAGMA_FIRST_EXTERNAL
49} pragma_kind;
50
566c6181
ZW
51
52/* All clauses defined by OpenMP 2.5.
53 Used internally by both C and C++ parsers. */
54typedef enum pragma_omp_clause {
55 PRAGMA_OMP_CLAUSE_NONE = 0,
56
57 PRAGMA_OMP_CLAUSE_COPYIN,
58 PRAGMA_OMP_CLAUSE_COPYPRIVATE,
59 PRAGMA_OMP_CLAUSE_DEFAULT,
60 PRAGMA_OMP_CLAUSE_FIRSTPRIVATE,
61 PRAGMA_OMP_CLAUSE_IF,
62 PRAGMA_OMP_CLAUSE_LASTPRIVATE,
63 PRAGMA_OMP_CLAUSE_NOWAIT,
64 PRAGMA_OMP_CLAUSE_NUM_THREADS,
65 PRAGMA_OMP_CLAUSE_ORDERED,
66 PRAGMA_OMP_CLAUSE_PRIVATE,
67 PRAGMA_OMP_CLAUSE_REDUCTION,
68 PRAGMA_OMP_CLAUSE_SCHEDULE,
69 PRAGMA_OMP_CLAUSE_SHARED
70} pragma_omp_clause;
81a75f0f 71
81a75f0f
NB
72extern struct cpp_reader* parse_in;
73
daefd78b 74#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
3d6f7931 75
1e0343dd 76#ifdef HANDLE_SYSV_PRAGMA
e2af664c
NC
77/* We always support #pragma pack for SYSV pragmas. */
78#ifndef HANDLE_PRAGMA_PACK
79#define HANDLE_PRAGMA_PACK 1
80#endif
81#endif /* HANDLE_SYSV_PRAGMA */
82
83
84#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
85/* If we are supporting #pragma pack(push... then we automatically
86 support #pragma pack(<n>) */
87#define HANDLE_PRAGMA_PACK 1
e2af664c
NC
88#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
89
d7afec4b
ND
90/* It's safe to always leave visibility pragma enabled as if
91 visibility is not supported on the host OS platform the
92 statements are ignored. */
93#define HANDLE_PRAGMA_VISIBILITY 1
0ed5edac
JM
94extern void push_visibility (const char *);
95extern void pop_visibility (void);
d7afec4b 96
5055d3a3 97extern void init_pragma (void);
f09db6e0 98
bc4071dd
RH
99/* Front-end wrappers for pragma registration. */
100typedef void (*pragma_handler)(struct cpp_reader *);
101extern void c_register_pragma (const char *, const char *, pragma_handler);
b5b3e36a 102extern void c_register_pragma_with_expansion (const char *, const char *,
bc4071dd
RH
103 pragma_handler);
104extern void c_invoke_pragma_handler (unsigned int);
105
5055d3a3 106extern void maybe_apply_pragma_weak (tree);
86f029aa 107extern void maybe_apply_pending_pragma_weaks (void);
5055d3a3
AJ
108extern tree maybe_apply_renaming_pragma (tree, tree);
109extern void add_to_renaming_pragma_list (tree, tree);
ecb0eece 110
75ce3d48 111extern enum cpp_ttype pragma_lex (tree *);
bc4071dd 112
46c2514e
TT
113/* Flags for use with c_lex_with_flags. The values here were picked
114 so that 0 means to translate and join strings. */
115#define C_LEX_STRING_NO_TRANSLATE 1 /* Do not lex strings into
116 execution character set. */
117#define C_LEX_RAW_STRINGS 2 /* Return raw strings -- no
118 concatenation, no
119 translation. */
120
bc4071dd
RH
121/* This is not actually available to pragma parsers. It's merely a
122 convenient location to declare this function for c-lex, after
123 having enum cpp_ttype declared. */
46c2514e
TT
124extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *,
125 int);
c162c75e 126
a25a8f3b
JJ
127extern void c_pp_lookup_pragma (unsigned int, const char **, const char **);
128
88657302 129#endif /* GCC_C_PRAGMA_H */