• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Sema;
21   class Parser;
22 
23 class PragmaAlignHandler : public PragmaHandler {
24 public:
PragmaAlignHandler()25   explicit PragmaAlignHandler() : PragmaHandler("align") {}
26 
27   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
28                             Token &FirstToken);
29 };
30 
31 class PragmaGCCVisibilityHandler : public PragmaHandler {
32 public:
PragmaGCCVisibilityHandler()33   explicit PragmaGCCVisibilityHandler() : PragmaHandler("visibility") {}
34 
35   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
36                             Token &FirstToken);
37 };
38 
39 class PragmaOptionsHandler : public PragmaHandler {
40 public:
PragmaOptionsHandler()41   explicit PragmaOptionsHandler() : PragmaHandler("options") {}
42 
43   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
44                             Token &FirstToken);
45 };
46 
47 class PragmaPackHandler : public PragmaHandler {
48 public:
PragmaPackHandler()49   explicit PragmaPackHandler() : PragmaHandler("pack") {}
50 
51   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
52                             Token &FirstToken);
53 };
54 
55 class PragmaMSStructHandler : public PragmaHandler {
56 public:
PragmaMSStructHandler()57   explicit PragmaMSStructHandler() : PragmaHandler("ms_struct") {}
58 
59   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
60                             Token &FirstToken);
61 };
62 
63 class PragmaUnusedHandler : public PragmaHandler {
64 public:
PragmaUnusedHandler()65   PragmaUnusedHandler() : PragmaHandler("unused") {}
66 
67   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
68                             Token &FirstToken);
69 };
70 
71 class PragmaWeakHandler : public PragmaHandler {
72 public:
PragmaWeakHandler()73   explicit PragmaWeakHandler() : PragmaHandler("weak") {}
74 
75   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
76                             Token &FirstToken);
77 };
78 
79 class PragmaRedefineExtnameHandler : public PragmaHandler {
80 public:
PragmaRedefineExtnameHandler()81   explicit PragmaRedefineExtnameHandler() : PragmaHandler("redefine_extname") {}
82 
83   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
84                             Token &FirstToken);
85 };
86 
87 class PragmaOpenCLExtensionHandler : public PragmaHandler {
88 public:
PragmaOpenCLExtensionHandler()89   PragmaOpenCLExtensionHandler() : PragmaHandler("EXTENSION") {}
90   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
91                             Token &FirstToken);
92 };
93 
94 
95 class PragmaFPContractHandler : public PragmaHandler {
96 public:
PragmaFPContractHandler()97   PragmaFPContractHandler() : PragmaHandler("FP_CONTRACT") {}
98   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
99                             Token &FirstToken);
100 };
101 
102 
103 }  // end namespace clang
104 
105 #endif
106