diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-11-20 19:49:00 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-11-20 19:49:00 +0000 |
commit | 111caaac58e21550c71c96f68394ad4d5f4f0198 (patch) | |
tree | 5bdac5c16d45eb3fc295e4eabd02ebc2ee4658e7 /clang/lib/Lex/PTHLexer.cpp | |
parent | c1877cbc213c188ce31d4664d56bd9aef53bbeb6 (diff) | |
download | bcm5719-llvm-111caaac58e21550c71c96f68394ad4d5f4f0198.tar.gz bcm5719-llvm-111caaac58e21550c71c96f68394ad4d5f4f0198.zip |
PTHLexer:
- Move PTHLexer::GetToken() to be inside PTHLexer.cpp.
- When lexing in raw mode, null out identifiers.
llvm-svn: 59744
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r-- | clang/lib/Lex/PTHLexer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp index 16aca4aacbe..a88470bbad6 100644 --- a/clang/lib/Lex/PTHLexer.cpp +++ b/clang/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()) { |