aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/PreprocessorLexer.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-12 23:13:54 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-12 23:13:54 +0000
commitd6a2e7d71e9a910c45a3eb0268a5d94635003d58 (patch)
tree17c208f99eaa5e4b60d56cc6fc5060af02bcc51e /include/clang/Lex/PreprocessorLexer.h
parent2c71d0f00e40b7b0a85561d430f52247b9c6e7f2 (diff)
Move some diagnostic handling to PreprocessorLexer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/PreprocessorLexer.h')
-rw-r--r--include/clang/Lex/PreprocessorLexer.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/clang/Lex/PreprocessorLexer.h b/include/clang/Lex/PreprocessorLexer.h
index bbe6dbeeac..de9c6b780a 100644
--- a/include/clang/Lex/PreprocessorLexer.h
+++ b/include/clang/Lex/PreprocessorLexer.h
@@ -17,14 +17,19 @@
#include "clang/Lex/MultipleIncludeOpt.h"
#include "clang/Lex/Token.h"
#include <vector>
-
+#include <string>
+
namespace clang {
class Preprocessor;
class PreprocessorLexer {
-protected:
+protected:
+ Preprocessor *PP; // Preprocessor object controlling lexing.
+
+ //===--------------------------------------------------------------------===//
// Context-specific lexing flags set by the preprocessor.
+ //===--------------------------------------------------------------------===//
/// ParsingPreprocessorDirective - This is true when parsing #XXX. This turns
/// '\n' into a tok::eom token.
@@ -59,12 +64,15 @@ protected:
void operator=(const PreprocessorLexer&); // DO NOT IMPLEMENT
friend class Preprocessor;
- PreprocessorLexer() {}
+ PreprocessorLexer(Preprocessor* pp) : PP(pp) {}
virtual ~PreprocessorLexer();
virtual void IndirectLex(Token& Result) = 0;
-protected:
+ /// Diag - Forwarding function for diagnostics. This translate a source
+ /// position in the current buffer into a SourceLocation object for rendering.
+ void Diag(SourceLocation Loc, unsigned DiagID,
+ const std::string &Msg = std::string()) const;
//===--------------------------------------------------------------------===//
// #if directive handling.