[cfe-commits] r93141 - /cfe/trunk/lib/Lex/Lexer.cpp
Chris Lattner
sabre at nondot.org
Sun Jan 10 18:38:50 PST 2010
Author: lattner
Date: Sun Jan 10 20:38:50 2010
New Revision: 93141
URL: http://llvm.org/viewvc/llvm-project?rev=93141&view=rev
Log:
add a TODO for a perf improvement in LexIdentifier.
Modified:
cfe/trunk/lib/Lex/Lexer.cpp
Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=93141&r1=93140&r2=93141&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Sun Jan 10 20:38:50 2010
@@ -643,14 +643,17 @@
// Match [_A-Za-z0-9]*, we have already matched [_A-Za-z$]
unsigned Size;
unsigned char C = *CurPtr++;
- while (isIdentifierBody(C)) {
+ while (isIdentifierBody(C))
C = *CurPtr++;
- }
+
--CurPtr; // Back up over the skipped character.
// Fast path, no $,\,? in identifier found. '\' might be an escaped newline
// or UCN, and ? might be a trigraph for '\', an escaped newline or UCN.
// FIXME: UCNs.
+ //
+ // TODO: Could merge these checks into a CharInfo flag to make the comparison
+ // cheaper
if (C != '\\' && C != '?' && (C != '$' || !Features.DollarIdents)) {
FinishIdentifier:
const char *IdStart = BufferPtr;
More information about the cfe-commits
mailing list