[cfe-commits] r72278 - /cfe/trunk/lib/Lex/TokenLexer.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Fri May 22 14:09:31 PDT 2009
Author: akirtzidis
Date: Fri May 22 16:09:31 2009
New Revision: 72278
URL: http://llvm.org/viewvc/llvm-project?rev=72278&view=rev
Log:
The TokenLexer may encounter annotations if the parser enters them using Preprocessor::EnterTokenStream.
So check for annotation before using the Token's IdentifierInfo.
Modified:
cfe/trunk/lib/Lex/TokenLexer.cpp
Modified: cfe/trunk/lib/Lex/TokenLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/TokenLexer.cpp?rev=72278&r1=72277&r2=72278&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/TokenLexer.cpp (original)
+++ cfe/trunk/lib/Lex/TokenLexer.cpp Fri May 22 16:09:31 2009
@@ -342,9 +342,10 @@
}
// Handle recursive expansion!
- if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
+ if (!Tok.isAnnotation() && Tok.getIdentifierInfo() != 0) {
// Change the kind of this identifier to the appropriate token kind, e.g.
// turning "for" into a keyword.
+ IdentifierInfo *II = Tok.getIdentifierInfo();
Tok.setKind(II->getTokenID());
// If this identifier was poisoned and from a paste, emit an error. This
More information about the cfe-commits
mailing list