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 {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
explicit PragmaAlignHandler() : PragmaHandler("align") {}
|
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 {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
explicit PragmaGCCVisibilityHandler() : PragmaHandler("visibility") {}
|
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 {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
explicit PragmaOptionsHandler() : PragmaHandler("options") {}
|
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 {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
explicit PragmaPackHandler() : PragmaHandler("pack") {}
|
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 {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
explicit PragmaMSStructHandler() : PragmaHandler("ms_struct") {}
|
2011-04-26 02:49:15 +08:00
|
|
|
|
|
|
|
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 {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
PragmaUnusedHandler() : PragmaHandler("unused") {}
|
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 {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
explicit PragmaWeakHandler() : PragmaHandler("weak") {}
|
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
|
|
|
};
|
|
|
|
|
2012-02-19 00:12:34 +08:00
|
|
|
class PragmaRedefineExtnameHandler : public PragmaHandler {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
explicit PragmaRedefineExtnameHandler() : PragmaHandler("redefine_extname") {}
|
2012-02-19 00:12:34 +08:00
|
|
|
|
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
|
|
|
|
2011-02-14 09:42:53 +08:00
|
|
|
class PragmaOpenCLExtensionHandler : public PragmaHandler {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
PragmaOpenCLExtensionHandler() : PragmaHandler("EXTENSION") {}
|
2011-02-14 09:42:53 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-02-14 09:42:35 +08:00
|
|
|
class PragmaFPContractHandler : public PragmaHandler {
|
|
|
|
public:
|
2012-10-04 10:36:51 +08:00
|
|
|
PragmaFPContractHandler() : PragmaHandler("FP_CONTRACT") {}
|
2011-02-14 09:42:35 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
2013-03-22 14:34:35 +08:00
|
|
|
|
|
|
|
class PragmaNoOpenMPHandler : public PragmaHandler {
|
|
|
|
public:
|
|
|
|
PragmaNoOpenMPHandler() : PragmaHandler("omp") { }
|
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
|
|
|
|
|
|
|
class PragmaOpenMPHandler : public PragmaHandler {
|
|
|
|
public:
|
|
|
|
PragmaOpenMPHandler() : PragmaHandler("omp") { }
|
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
|
|
|
};
|
2011-02-14 09:42:35 +08:00
|
|
|
|
2013-05-07 05:02:12 +08:00
|
|
|
/// PragmaCommentHandler - "\#pragma comment ...".
|
|
|
|
class PragmaCommentHandler : public PragmaHandler {
|
|
|
|
public:
|
2013-05-08 21:44:39 +08:00
|
|
|
PragmaCommentHandler(Sema &Actions)
|
|
|
|
: PragmaHandler("comment"), Actions(Actions) {}
|
2013-05-07 05:02:12 +08:00
|
|
|
virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
|
|
|
|
Token &FirstToken);
|
2013-05-08 21:44:39 +08:00
|
|
|
private:
|
|
|
|
Sema &Actions;
|
2013-05-07 05:02:12 +08:00
|
|
|
};
|
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
} // end namespace clang
|
|
|
|
|
|
|
|
#endif
|