blob: db385c6371e390029a13e1bd89ad38c04c51fbfe [file] [log] [blame]
Daniel Dunbarfcdd8fe2008-10-04 19:21:03 +00001//===---- 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
19namespace clang {
20 class Action;
Ted Kremenek4726d032009-03-23 22:28:25 +000021 class Parser;
Daniel Dunbarfcdd8fe2008-10-04 19:21:03 +000022
23class PragmaPackHandler : public PragmaHandler {
24 Action &Actions;
25public:
Mike Stump1eb44332009-09-09 15:08:12 +000026 PragmaPackHandler(const IdentifierInfo *N, Action &A) : PragmaHandler(N),
Daniel Dunbarfcdd8fe2008-10-04 19:21:03 +000027 Actions(A) {}
Mike Stump1eb44332009-09-09 15:08:12 +000028
29 virtual void HandlePragma(Preprocessor &PP, Token &FirstToken);
Daniel Dunbarfcdd8fe2008-10-04 19:21:03 +000030};
Mike Stump1eb44332009-09-09 15:08:12 +000031
Ted Kremenek4726d032009-03-23 22:28:25 +000032class PragmaUnusedHandler : public PragmaHandler {
33 Action &Actions;
34 Parser &parser;
35public:
36 PragmaUnusedHandler(const IdentifierInfo *N, Action &A, Parser& p)
37 : PragmaHandler(N), Actions(A), parser(p) {}
Mike Stump1eb44332009-09-09 15:08:12 +000038
39 virtual void HandlePragma(Preprocessor &PP, Token &FirstToken);
40};
Daniel Dunbarfcdd8fe2008-10-04 19:21:03 +000041
Eli Friedman99914792009-06-05 00:49:58 +000042class PragmaWeakHandler : public PragmaHandler {
43 Action &Actions;
44public:
45 PragmaWeakHandler(const IdentifierInfo *N, Action &A)
46 : PragmaHandler(N), Actions(A) {}
Mike Stump1eb44332009-09-09 15:08:12 +000047
48 virtual void HandlePragma(Preprocessor &PP, Token &FirstToken);
Eli Friedman99914792009-06-05 00:49:58 +000049};
50
Daniel Dunbarfcdd8fe2008-10-04 19:21:03 +000051} // end namespace clang
52
53#endif