]> granicus.if.org Git - clang/commitdiff
add a TODO for a perf improvement in LexIdentifier.
authorChris Lattner <sabre@nondot.org>
Mon, 11 Jan 2010 02:38:50 +0000 (02:38 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 11 Jan 2010 02:38:50 +0000 (02:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93141 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp

index d82f8fcf8580d1887cb965bfc52d4fa089032cc3..0a74b26482e5ccb16ab6ababe74c3c329a3f8ec6 100644 (file)
@@ -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;