]> granicus.if.org Git - clang/commitdiff
Remove assert from hot code path and add a clarifying comment.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 22 Nov 2011 20:39:31 +0000 (20:39 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 22 Nov 2011 20:39:31 +0000 (20:39 +0000)
The assert wasn't adding much value but slowed down Release+Asserts builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145082 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp

index a1155798433e4cb19cf3637ba21ae43ffe320908..a9b11d69c9e5133893562791048a3cc4c4d2358c 100644 (file)
@@ -1920,10 +1920,10 @@ bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr) {
       while (CurPtr+16 <= BufferEnd) {
         int cmp = _mm_movemask_epi8(_mm_cmpeq_epi8(*(__m128i*)CurPtr, Slashes));
         if (cmp != 0) {
-          // Adjust the pointer to the first '/' that was found.
-          CurPtr += llvm::CountTrailingZeros_32(cmp);
-          C = *CurPtr++;
-          assert(C == '/');
+          // Adjust the pointer to point directly after the first slash. It's
+          // not necessary to set C here, it will be overwritten at the end of
+          // the outer loop.
+          CurPtr += llvm::CountTrailingZeros_32(cmp) + 1;
           goto FoundSlash;
         }
         CurPtr += 16;