2008-10-05 03:21:03 +08:00
|
|
|
//===---- ParserPragmas.h - Language specific pragmas -----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines #pragma handlers for language specific pragmas.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_PARSE_PARSEPRAGMA_H
|
|
|
|
#define LLVM_CLANG_PARSE_PARSEPRAGMA_H
|
|
|
|
|
|
|
|
#include "clang/Lex/Pragma.h"
|
|
|
|
|
|
|
|
namespace clang {
|
2010-08-27 07:41:50 +08:00
|
|
|
class Sema;
|
2009-03-24 06:28:25 +08:00
|
|
|
class Parser;
|
2008-10-05 03:21:03 +08:00
|
|
|
|
2010-08-01 03:17:07 +08:00
|
|
|
class PragmaAlignHandler : public PragmaHandler {
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema &Actions;
|
2010-08-01 03:17:07 +08:00
|
|
|
public:
|
2010-08-27 07:41:50 +08:00
|
|
|
explicit PragmaAlignHandler(Sema &A) : PragmaHandler("align"), Actions(A) {}
|
2010-08-01 03:17:07 +08:00
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
2010-08-01 03:17:07 +08:00
|
|
|
};
|
|
|
|
|
2010-08-05 14:57:20 +08:00
|
|
|
class PragmaGCCVisibilityHandler : public PragmaHandler {
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema &Actions;
|
2010-08-05 14:57:20 +08:00
|
|
|
public:
|
2010-08-27 07:41:50 +08:00
|
|
|
explicit PragmaGCCVisibilityHandler(Sema &A) : PragmaHandler("visibility"),
|
|
|
|
Actions(A) {}
|
2010-08-05 14:57:20 +08:00
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
2010-08-05 14:57:20 +08:00
|
|
|
};
|
|
|
|
|
2010-05-27 07:29:06 +08:00
|
|
|
class PragmaOptionsHandler : public PragmaHandler {
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema &Actions;
|
2010-05-27 07:29:06 +08:00
|
|
|
public:
|
2010-08-27 07:41:50 +08:00
|
|
|
explicit PragmaOptionsHandler(Sema &A) : PragmaHandler("options"),
|
|
|
|
Actions(A) {}
|
2010-05-27 07:29:06 +08:00
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
2010-05-27 07:29:06 +08:00
|
|
|
};
|
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
class PragmaPackHandler : public PragmaHandler {
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema &Actions;
|
2008-10-05 03:21:03 +08:00
|
|
|
public:
|
2010-08-27 07:41:50 +08:00
|
|
|
explicit PragmaPackHandler(Sema &A) : PragmaHandler("pack"),
|
|
|
|
Actions(A) {}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
2008-10-05 03:21:03 +08:00
|
|
|
};
|
2011-04-26 02:49:15 +08:00
|
|
|
|
|
|
|
class PragmaMSStructHandler : public PragmaHandler {
|
|
|
|
Sema &Actions;
|
|
|
|
public:
|
|
|
|
explicit PragmaMSStructHandler(Sema &A) : PragmaHandler("ms_struct"),
|
|
|
|
Actions(A) {}
|
|
|
|
|
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
class PragmaUnusedHandler : public PragmaHandler {
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema &Actions;
|
2009-03-24 06:28:25 +08:00
|
|
|
Parser &parser;
|
|
|
|
public:
|
2010-08-27 07:41:50 +08:00
|
|
|
PragmaUnusedHandler(Sema &A, Parser& p)
|
2010-07-13 17:07:17 +08:00
|
|
|
: PragmaHandler("unused"), Actions(A), parser(p) {}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
2009-09-09 23:08:12 +08:00
|
|
|
};
|
2008-10-05 03:21:03 +08:00
|
|
|
|
2009-06-05 08:49:58 +08:00
|
|
|
class PragmaWeakHandler : public PragmaHandler {
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema &Actions;
|
2009-06-05 08:49:58 +08:00
|
|
|
public:
|
2010-08-27 07:41:50 +08:00
|
|
|
explicit PragmaWeakHandler(Sema &A)
|
2010-07-13 17:07:17 +08:00
|
|
|
: PragmaHandler("weak"), Actions(A) {}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
2009-06-05 08:49:58 +08:00
|
|
|
};
|
|
|
|
|
2011-02-14 09:42:53 +08:00
|
|
|
class PragmaOpenCLExtensionHandler : public PragmaHandler {
|
|
|
|
Sema &Actions;
|
|
|
|
Parser &parser;
|
|
|
|
public:
|
|
|
|
PragmaOpenCLExtensionHandler(Sema &S, Parser& p) :
|
|
|
|
PragmaHandler("EXTENSION"), Actions(S), parser(p) {}
|
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-02-14 09:42:35 +08:00
|
|
|
class PragmaFPContractHandler : public PragmaHandler {
|
|
|
|
Sema &Actions;
|
|
|
|
Parser &parser;
|
|
|
|
public:
|
|
|
|
PragmaFPContractHandler(Sema &S, Parser& p) :
|
|
|
|
PragmaHandler("FP_CONTRACT"), Actions(S), parser(p) {}
|
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
} // end namespace clang
|
|
|
|
|
|
|
|
#endif
|