summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/TokenLexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-12 01:31:51 +0000
committerChris Lattner <sabre@nondot.org>2008-10-12 01:31:51 +0000
commit7c2e9809b12610fcfa6e661bda88cd02f55e093b (patch)
treecde4104cbe0a0bd1bc987ac81aa80a9b686768b4 /clang/lib/Lex/TokenLexer.cpp
parent6b0c5ad0965ef13e14ee79aaeedec24a5d3ee3e1 (diff)
downloadbcm5719-llvm-7c2e9809b12610fcfa6e661bda88cd02f55e093b.tar.gz
bcm5719-llvm-7c2e9809b12610fcfa6e661bda88cd02f55e093b.zip
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). llvm-svn: 57395
Diffstat (limited to 'clang/lib/Lex/TokenLexer.cpp')
-rw-r--r--clang/lib/Lex/TokenLexer.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp
index d3acaeaab54..82b2b4df0b0 100644
--- a/clang/lib/Lex/TokenLexer.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud