[cfe-commits] r39063 - in /cfe/cfe/trunk: Lex/IdentifierTable.cpp include/clang/Lex/IdentifierTable.h

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


Author: sabre
Date: Wed Jul 11 11:27:14 2007
New Revision: 39063

URL: http://llvm.org/viewvc/llvm-project?rev=39063&view=rev
Log:
Remove identifier length field from IdentifierInfo, it is now dead.

Modified:
    cfe/cfe/trunk/Lex/IdentifierTable.cpp
    cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h

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

==============================================================================
--- cfe/cfe/trunk/Lex/IdentifierTable.cpp (original)
+++ cfe/cfe/trunk/Lex/IdentifierTable.cpp Wed Jul 11 11:27:14 2007
@@ -192,7 +192,6 @@
     // being non-null and for the full hash value) not at the identifiers.  This
     // is important for cache locality.
     if (Bucket.FullHashValue == FullHashValue &&
-        BucketII->getNameLength() == Length &&
         memcmp(BucketII->getName(), NameStart, Length) == 0)
       // We found a match!
       return *BucketII;
@@ -215,7 +214,6 @@
 #else
   IdentifierInfo *Identifier = (IdentifierInfo*)malloc(AllocSize);
 #endif
-  Identifier->NameLen = Length;
   Identifier->Macro = 0;
   Identifier->TokenID = tok::identifier;
   Identifier->PPID = tok::pp_not_keyword;
@@ -394,10 +392,10 @@
       continue;
     }
     IdentifierInfo *Id = TableArray[i].Info;
-    
-    AverageIdentifierSize += Id->getNameLength();
-    if (MaxIdentifierLength < Id->getNameLength())
-      MaxIdentifierLength = Id->getNameLength();
+    unsigned IdLen = strlen(Id->getName());
+    AverageIdentifierSize += IdLen;
+    if (MaxIdentifierLength < IdLen)
+      MaxIdentifierLength = IdLen;
 
     // Count the number of times something was probed.
     if ((TableArray[i].FullHashValue & (e-1)) != i)

Modified: cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h?rev=39063&r1=39062&r2=39063&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/IdentifierTable.h Wed Jul 11 11:27:14 2007
@@ -50,12 +50,6 @@
     return (const char*)(this+1);
   }
   
-  /// getNameLength - Return the length of the identifier string.
-  ///
-  unsigned getNameLength() const {
-    return NameLen;
-  }
-  
   /// getMacroInfo - Return macro information about this identifier, or null if
   /// it is not a macro.
   MacroInfo *getMacroInfo() const { return Macro; }





More information about the cfe-commits mailing list