118334Speter/* Pragma related interfaces. 2169689Skan Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 390075Sobrien Free Software Foundation, Inc. 418334Speter 590075SobrienThis file is part of GCC. 618334Speter 790075SobrienGCC is free software; you can redistribute it and/or modify it under 890075Sobrienthe terms of the GNU General Public License as published by the Free 990075SobrienSoftware Foundation; either version 2, or (at your option) any later 1090075Sobrienversion. 1118334Speter 1290075SobrienGCC is distributed in the hope that it will be useful, but WITHOUT ANY 1390075SobrienWARRANTY; without even the implied warranty of MERCHANTABILITY or 1490075SobrienFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1590075Sobrienfor more details. 1618334Speter 1718334SpeterYou should have received a copy of the GNU General Public License 1890075Sobrienalong with GCC; see the file COPYING. If not, write to the Free 19169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 20169689Skan02110-1301, USA. */ 2118334Speter 2290075Sobrien#ifndef GCC_C_PRAGMA_H 2390075Sobrien#define GCC_C_PRAGMA_H 2452284Sobrien 25169689Skan#include <cpplib.h> /* For enum cpp_ttype. */ 26169689Skan 27169689Skan/* Pragma identifiers built in to the front end parsers. Identifiers 28169689Skan for ancillary handlers will follow these. */ 29169689Skantypedef enum pragma_kind { 30169689Skan PRAGMA_NONE = 0, 31169689Skan 32169689Skan PRAGMA_OMP_ATOMIC, 33169689Skan PRAGMA_OMP_BARRIER, 34169689Skan PRAGMA_OMP_CRITICAL, 35169689Skan PRAGMA_OMP_FLUSH, 36169689Skan PRAGMA_OMP_FOR, 37169689Skan PRAGMA_OMP_MASTER, 38169689Skan PRAGMA_OMP_ORDERED, 39169689Skan PRAGMA_OMP_PARALLEL, 40169689Skan PRAGMA_OMP_PARALLEL_FOR, 41169689Skan PRAGMA_OMP_PARALLEL_SECTIONS, 42169689Skan PRAGMA_OMP_SECTION, 43169689Skan PRAGMA_OMP_SECTIONS, 44169689Skan PRAGMA_OMP_SINGLE, 45169689Skan PRAGMA_OMP_THREADPRIVATE, 46169689Skan 47169689Skan PRAGMA_GCC_PCH_PREPROCESS, 48169689Skan 49169689Skan PRAGMA_FIRST_EXTERNAL 50169689Skan} pragma_kind; 51169689Skan 52117395Skan/* Cause the `yydebug' variable to be defined. */ 53117395Skan#define YYDEBUG 1 54117395Skanextern int yydebug; 55117395Skan 56117395Skanextern struct cpp_reader* parse_in; 57117395Skan 5818334Speter#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK 5918334Speter 60132718Skan#ifdef HANDLE_SYSV_PRAGMA 6152284Sobrien/* We always support #pragma pack for SYSV pragmas. */ 6252284Sobrien#ifndef HANDLE_PRAGMA_PACK 6352284Sobrien#define HANDLE_PRAGMA_PACK 1 6452284Sobrien#endif 6552284Sobrien#endif /* HANDLE_SYSV_PRAGMA */ 6652284Sobrien 6752284Sobrien 6852284Sobrien#ifdef HANDLE_PRAGMA_PACK_PUSH_POP 6952284Sobrien/* If we are supporting #pragma pack(push... then we automatically 7052284Sobrien support #pragma pack(<n>) */ 7152284Sobrien#define HANDLE_PRAGMA_PACK 1 7252284Sobrien#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */ 7352284Sobrien 74169689Skan/* It's safe to always leave visibility pragma enabled as if 75169689Skan visibility is not supported on the host OS platform the 76169689Skan statements are ignored. */ 77169689Skan#define HANDLE_PRAGMA_VISIBILITY 1 78169689Skanextern void push_visibility (const char *); 79169689Skanextern void pop_visibility (void); 80169689Skan 81132718Skanextern void init_pragma (void); 8252284Sobrien 83169689Skan/* Front-end wrappers for pragma registration. */ 84169689Skantypedef void (*pragma_handler)(struct cpp_reader *); 85169689Skanextern void c_register_pragma (const char *, const char *, pragma_handler); 86169689Skanextern void c_register_pragma_with_expansion (const char *, const char *, 87169689Skan pragma_handler); 88169689Skanextern void c_invoke_pragma_handler (unsigned int); 89169689Skan 90132718Skanextern void maybe_apply_pragma_weak (tree); 91169689Skanextern void maybe_apply_pending_pragma_weaks (void); 92132718Skanextern tree maybe_apply_renaming_pragma (tree, tree); 93132718Skanextern void add_to_renaming_pragma_list (tree, tree); 9452284Sobrien 95169689Skanextern enum cpp_ttype pragma_lex (tree *); 9652284Sobrien 97169689Skan/* This is not actually available to pragma parsers. It's merely a 98169689Skan convenient location to declare this function for c-lex, after 99169689Skan having enum cpp_ttype declared. */ 100169689Skanextern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *); 101169689Skan 102169689Skan/* If 1, then lex strings into the execution character set. 103169689Skan If 0, lex strings into the host character set. 104169689Skan If -1, lex both, and chain them together, such that the former 105169689Skan is the TREE_CHAIN of the latter. */ 106169689Skanextern int c_lex_string_translate; 107169689Skan 108169689Skan/* If true, strings should be passed to the caller of c_lex completely 109169689Skan unmolested (no concatenation, no translation). */ 110169689Skanextern bool c_lex_return_raw_strings; 111169689Skan 11290075Sobrien#endif /* GCC_C_PRAGMA_H */ 113