diff options
author | Chris Lattner <sabre@nondot.org> | 2008-10-12 01:31:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-10-12 01:31:51 +0000 |
commit | 0af574270d3be2b0e73a3379dfaa633746f8fc6f (patch) | |
tree | 0def8a7acb239a0455748576f9eb7985e3f17116 /lib/Lex/TokenLexer.cpp | |
parent | 8527b71b1944b155a2bd60ec364d700299bc3ff7 (diff) |
Simplify raw mode lexing by treating an unterminate /**/ comment the
same we we do an unterminated string or character literal. This makes
it so we can guarantee that the lexer never calls into the
preprocessor (which would be suicide for a raw lexer).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/TokenLexer.cpp')
-rw-r--r-- | lib/Lex/TokenLexer.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp index d3acaeaab5..82b2b4df0b 100644 --- a/lib/Lex/TokenLexer.cpp +++ b/lib/Lex/TokenLexer.cpp @@ -377,11 +377,7 @@ bool TokenLexer::PasteTokens(Token &Tok) { // Lex the resultant pasted token into Result. Token Result; - // Avoid testing /*, as the lexer would think it is the start of a comment - // and emit an error that it is unterminated. - if (Tok.is(tok::slash) && RHS.is(tok::star)) { - isInvalid = true; - } else if (Tok.is(tok::identifier) && RHS.is(tok::identifier)) { + if (Tok.is(tok::identifier) && RHS.is(tok::identifier)) { // Common paste case: identifier+identifier = identifier. Avoid creating // a lexer and other overhead. PP.IncrementPasteCounter(true); |