aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r--lib/Lex/PTHLexer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index 16aca4aacb..a88470bbad 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/lib/Lex/PTHLexer.cpp
@@ -27,6 +27,18 @@ PTHLexer::PTHLexer(Preprocessor& pp, SourceLocation fileloc,
assert(Tokens[LastTokenIdx].is(tok::eof));
}
+Token PTHLexer::GetToken() {
+ Token Tok = Tokens[CurTokenIdx];
+
+ // If we are in raw mode, zero out identifier pointers. This is
+ // needed for 'pragma poison'. Note that this requires that the Preprocessor
+ // can go back to the original source when it calls getSpelling().
+ if (LexingRawMode && Tok.is(tok::identifier))
+ Tok.setIdentifierInfo(0);
+
+ return Tok;
+}
+
void PTHLexer::Lex(Token& Tok) {
LexNextToken:
if (AtLastToken()) {