diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-11 02:38:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-11 02:38:50 +0000 |
commit | cd991dbb12f24368753cef086c7ad3ec203c9ea6 (patch) | |
tree | 4590fddd124a7c5ddd4650a148652608d3c90cab /lib/Lex/Lexer.cpp | |
parent | c50e6df965ff264952d8d5805d151f89c89af302 (diff) |
add a TODO for a perf improvement in LexIdentifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index d82f8fcf85..0a74b26482 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -643,14 +643,17 @@ void Lexer::LexIdentifier(Token &Result, const char *CurPtr) { // 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; |