aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-26 17:11:39 +0000
committerChris Lattner <sabre@nondot.org>2010-06-26 17:11:39 +0000
commitabfe094ce71c42656dcb84a3bdc3e79cb3c16fc3 (patch)
treef2584af627983ca77e82ab857529c3c999ba8aa3 /include/clang/Lex
parent32f36baa6c8d491c374af622b4e3ac28d597453c (diff)
Implement support for #pragma message, patch by Michael Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex')
-rw-r--r--include/clang/Lex/PPCallbacks.h12
-rw-r--r--include/clang/Lex/Preprocessor.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h
index d74124e9c7..99fe29b22d 100644
--- a/include/clang/Lex/PPCallbacks.h
+++ b/include/clang/Lex/PPCallbacks.h
@@ -16,6 +16,7 @@
#include "clang/Lex/DirectoryLookup.h"
#include "clang/Basic/SourceLocation.h"
+#include "llvm/ADT/StringRef.h"
#include <string>
namespace clang {
@@ -70,6 +71,12 @@ public:
const std::string &Str) {
}
+ /// PragmaMessage - This callback is invoked when a #pragma message directive
+ /// is read.
+ ///
+ virtual void PragmaMessage(SourceLocation Loc, llvm::StringRef Str) {
+ }
+
/// MacroExpands - This is called by
/// Preprocessor::HandleMacroExpandedIdentifier when a macro invocation is
/// found.
@@ -127,6 +134,11 @@ public:
Second->PragmaComment(Loc, Kind, Str);
}
+ virtual void PragmaMessage(SourceLocation Loc, llvm::StringRef Str) {
+ First->PragmaMessage(Loc, Str);
+ Second->PragmaMessage(Loc, Str);
+ }
+
virtual void MacroExpands(const Token &Id, const MacroInfo* MI) {
First->MacroExpands(Id, MI);
Second->MacroExpands(Id, MI);
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index f01b3afc45..f90cb0a687 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -918,6 +918,7 @@ public:
void HandlePragmaSystemHeader(Token &SysHeaderTok);
void HandlePragmaDependency(Token &DependencyTok);
void HandlePragmaComment(Token &CommentTok);
+ void HandlePragmaMessage(Token &MessageTok);
// Return true and store the first token only if any CommentHandler
// has inserted some tokens and getCommentRetentionState() is false.
bool HandleComment(Token &Token, SourceRange Comment);