/* Pragma related interfaces.
Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2008 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
#ifndef GCC_C_PRAGMA_H
#define GCC_C_PRAGMA_H
-#include <cpplib.h> /* For enum cpp_ttype. */
+#include "cpplib.h" /* For enum cpp_ttype. */
/* Pragma identifiers built in to the front end parsers. Identifiers
for ancillary handlers will follow these. */
PRAGMA_OMP_SINGLE,
PRAGMA_OMP_TASK,
PRAGMA_OMP_TASKWAIT,
+ PRAGMA_OMP_TASKYIELD,
PRAGMA_OMP_THREADPRIVATE,
PRAGMA_GCC_PCH_PREPROCESS,
PRAGMA_OMP_CLAUSE_REDUCTION,
PRAGMA_OMP_CLAUSE_SCHEDULE,
PRAGMA_OMP_CLAUSE_SHARED,
- PRAGMA_OMP_CLAUSE_UNTIED
+ PRAGMA_OMP_CLAUSE_UNTIED,
+ PRAGMA_OMP_CLAUSE_FINAL,
+ PRAGMA_OMP_CLAUSE_MERGEABLE
} pragma_omp_clause;
extern struct cpp_reader* parse_in;
-#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
-
-#ifdef HANDLE_SYSV_PRAGMA
-/* We always support #pragma pack for SYSV pragmas. */
-#ifndef HANDLE_PRAGMA_PACK
-#define HANDLE_PRAGMA_PACK 1
-#endif
-#endif /* HANDLE_SYSV_PRAGMA */
-
-
-#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
-/* If we are supporting #pragma pack(push... then we automatically
- support #pragma pack(<n>) */
-#define HANDLE_PRAGMA_PACK 1
-#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
-
/* It's safe to always leave visibility pragma enabled as if
visibility is not supported on the host OS platform the
statements are ignored. */
-#define HANDLE_PRAGMA_VISIBILITY 1
extern void push_visibility (const char *, int);
extern bool pop_visibility (int);
extern void init_pragma (void);
/* Front-end wrappers for pragma registration. */
-typedef void (*pragma_handler)(struct cpp_reader *);
-extern void c_register_pragma (const char *, const char *, pragma_handler);
-extern void c_register_pragma_with_expansion (const char *, const char *,
- pragma_handler);
+typedef void (*pragma_handler_1arg)(struct cpp_reader *);
+/* A second pragma handler, which adds a void * argument allowing to pass extra
+ data to the handler. */
+typedef void (*pragma_handler_2arg)(struct cpp_reader *, void *);
+
+/* This union allows to abstract the different handlers. */
+union gen_pragma_handler {
+ pragma_handler_1arg handler_1arg;
+ pragma_handler_2arg handler_2arg;
+};
+/* Internally used to keep the data of the handler. */
+struct internal_pragma_handler_d {
+ union gen_pragma_handler handler;
+ /* Permits to know if handler is a pragma_handler_1arg (extra_data is false)
+ or a pragma_handler_2arg (extra_data is true). */
+ bool extra_data;
+ /* A data field which can be used when extra_data is true. */
+ void * data;
+};
+typedef struct internal_pragma_handler_d internal_pragma_handler;
+
+extern void c_register_pragma (const char *space, const char *name,
+ pragma_handler_1arg handler);
+extern void c_register_pragma_with_data (const char *space, const char *name,
+ pragma_handler_2arg handler,
+ void *data);
+
+extern void c_register_pragma_with_expansion (const char *space,
+ const char *name,
+ pragma_handler_1arg handler);
+extern void c_register_pragma_with_expansion_and_data (const char *space,
+ const char *name,
+ pragma_handler_2arg handler,
+ void *data);
extern void c_invoke_pragma_handler (unsigned int);
extern void maybe_apply_pragma_weak (tree);
extern void c_pp_lookup_pragma (unsigned int, const char **, const char **);
+extern GTY(()) tree pragma_extern_prefix;
+
#endif /* GCC_C_PRAGMA_H */