diff options
| author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-12-22 08:23:18 +0000 |
|---|---|---|
| committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-12-22 08:23:18 +0000 |
| commit | ea4f7c776194c96f8ece1456bc22102c6cbc9a33 (patch) | |
| tree | d1053edb8868105b02ca8fdf61a21462e03a8501 /clang/lib/Lex/TokenLexer.cpp | |
| parent | fe86bc527a0d50b653d2df8fa8b091a5397d3a9d (diff) | |
| download | bcm5719-llvm-ea4f7c776194c96f8ece1456bc22102c6cbc9a33.tar.gz bcm5719-llvm-ea4f7c776194c96f8ece1456bc22102c6cbc9a33.zip | |
Introduced raw_identifier token kind.
llvm-svn: 122394
Diffstat (limited to 'clang/lib/Lex/TokenLexer.cpp')
| -rw-r--r-- | clang/lib/Lex/TokenLexer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp index a0e5ae33b26..ea39b47904b 100644 --- a/clang/lib/Lex/TokenLexer.cpp +++ b/clang/lib/Lex/TokenLexer.cpp @@ -435,12 +435,13 @@ bool TokenLexer::PasteTokens(Token &Tok) { // Lex the resultant pasted token into Result. Token Result; - if (Tok.is(tok::identifier) && RHS.is(tok::identifier)) { + if (Tok.isAnyIdentifier() && RHS.isAnyIdentifier()) { // Common paste case: identifier+identifier = identifier. Avoid creating // a lexer and other overhead. PP.IncrementPasteCounter(true); Result.startToken(); - Result.setKind(tok::identifier); + Result.setKind(tok::raw_identifier); + Result.setRawIdentifierData(ResultTokStrPtr); Result.setLocation(ResultTokLoc); Result.setLength(LHSLen+RHSLen); } else { @@ -524,10 +525,10 @@ bool TokenLexer::PasteTokens(Token &Tok) { // Now that we got the result token, it will be subject to expansion. Since // token pasting re-lexes the result token in raw mode, identifier information // isn't looked up. As such, if the result is an identifier, look up id info. - if (Tok.is(tok::identifier)) { + if (Tok.is(tok::raw_identifier)) { // Look up the identifier info for the token. We disabled identifier lookup // by saying we're skipping contents, so we need to do this manually. - PP.LookUpIdentifierInfo(Tok, ResultTokStrPtr); + PP.LookUpIdentifierInfo(Tok); } return false; } |

