Daniel Dunbar | fcdd8fe | 2008-10-04 19:21:03 +0000 | [diff] [blame] | 1 | //===---- ParserPragmas.h - Language specific pragmas -----------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines #pragma handlers for language specific pragmas. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_CLANG_PARSE_PARSEPRAGMA_H |
| 15 | #define LLVM_CLANG_PARSE_PARSEPRAGMA_H |
| 16 | |
| 17 | #include "clang/Lex/Pragma.h" |
| 18 | |
| 19 | namespace clang { |
| 20 | class Action; |
Ted Kremenek | 4726d03 | 2009-03-23 22:28:25 +0000 | [diff] [blame] | 21 | class Parser; |
Daniel Dunbar | fcdd8fe | 2008-10-04 19:21:03 +0000 | [diff] [blame] | 22 | |
| 23 | class PragmaPackHandler : public PragmaHandler { |
| 24 | Action &Actions; |
| 25 | public: |
| 26 | PragmaPackHandler(const IdentifierInfo *N, Action &A) : PragmaHandler(N), |
| 27 | Actions(A) {} |
| 28 | |
| 29 | virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); |
| 30 | }; |
Ted Kremenek | 4726d03 | 2009-03-23 22:28:25 +0000 | [diff] [blame] | 31 | |
| 32 | class PragmaUnusedHandler : public PragmaHandler { |
| 33 | Action &Actions; |
| 34 | Parser &parser; |
| 35 | public: |
| 36 | PragmaUnusedHandler(const IdentifierInfo *N, Action &A, Parser& p) |
| 37 | : PragmaHandler(N), Actions(A), parser(p) {} |
| 38 | |
| 39 | virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); |
| 40 | }; |
Daniel Dunbar | fcdd8fe | 2008-10-04 19:21:03 +0000 | [diff] [blame] | 41 | |
Eli Friedman | 9991479 | 2009-06-05 00:49:58 +0000 | [diff] [blame] | 42 | class PragmaWeakHandler : public PragmaHandler { |
| 43 | Action &Actions; |
| 44 | public: |
| 45 | PragmaWeakHandler(const IdentifierInfo *N, Action &A) |
| 46 | : PragmaHandler(N), Actions(A) {} |
| 47 | |
| 48 | virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); |
| 49 | }; |
| 50 | |
Daniel Dunbar | fcdd8fe | 2008-10-04 19:21:03 +0000 | [diff] [blame] | 51 | } // end namespace clang |
| 52 | |
| 53 | #endif |