[cfe-commits] r39057 - /cfe/cfe/trunk/Lex/IdentifierTable.cpp

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:27:11 PDT 2007


Author: sabre
Date: Wed Jul 11 11:27:11 2007
New Revision: 39057

URL: http://llvm.org/viewvc/llvm-project?rev=39057&view=rev
Log:
Use the full hash as a filter to reduce # strcmps

Modified:
    cfe/cfe/trunk/Lex/IdentifierTable.cpp

Modified: cfe/cfe/trunk/Lex/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/IdentifierTable.cpp?rev=39057&r1=39056&r2=39057&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/IdentifierTable.cpp (original)
+++ cfe/cfe/trunk/Lex/IdentifierTable.cpp Wed Jul 11 11:27:11 2007
@@ -187,6 +187,7 @@
   for (IdentifierBucket *Identifier = IdentHead, *LastID = 0; Identifier; 
        LastID = Identifier, Identifier = Identifier->Next) {
     if (Identifier->TokInfo.getNameLength() == Length &&
+        Identifier->TokInfo.HashValue == FullHash &&
         memcmp(Identifier->TokInfo.getName(), NameStart, Length) == 0) {
       // If found identifier wasn't at start of bucket, move it there so
       // that frequently searched for identifiers are found earlier, even if





More information about the cfe-commits mailing list