aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/PreprocessorLexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Lex/PreprocessorLexer.h')
-rw-r--r--include/clang/Lex/PreprocessorLexer.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/clang/Lex/PreprocessorLexer.h b/include/clang/Lex/PreprocessorLexer.h
index 20fb8a0c48..b85729dd08 100644
--- a/include/clang/Lex/PreprocessorLexer.h
+++ b/include/clang/Lex/PreprocessorLexer.h
@@ -61,6 +61,10 @@ protected:
/// Note that in raw mode that the PP pointer may be null.
bool LexingRawMode;
+ /// \brief When true, if EOF of the current lexer is found, tok::included_eof
+ /// is returned instead of continuing lexing higher in the include stack.
+ bool EnableIncludedEOF;
+
/// \brief A state machine that detects the \#ifndef-wrapping a file
/// idiom for the multiple-include optimization.
MultipleIncludeOpt MIOpt;
@@ -79,7 +83,8 @@ protected:
: PP(0), InitialNumSLocEntries(0),
ParsingPreprocessorDirective(false),
ParsingFilename(false),
- LexingRawMode(false) {}
+ LexingRawMode(false),
+ EnableIncludedEOF(false) {}
virtual ~PreprocessorLexer() {}
@@ -147,6 +152,11 @@ public:
/// \brief Return true if this lexer is in raw mode or not.
bool isLexingRawMode() const { return LexingRawMode; }
+ /// \brief When true, if EOF of the current lexer is found, tok::included_eof
+ /// is returned instead of continuing lexing higher in the include stack.
+ /// False is the default behavior.
+ void setEnableIncludedEOF(bool Enable) { EnableIncludedEOF = Enable; }
+
/// \brief Return the preprocessor object for this lexer.
Preprocessor *getPP() const { return PP; }