[cfe-commits] r98343 - in /cfe/trunk: include/clang/Basic/IdentifierTable.h lib/Frontend/PCHReader.cpp

Kovarththanan Rajaratnam kovarththanan.rajaratnam at gmail.com
Fri Mar 12 02:32:27 PST 2010


Author: krj
Date: Fri Mar 12 04:32:27 2010
New Revision: 98343

URL: http://llvm.org/viewvc/llvm-project?rev=98343&view=rev
Log:
Add IdentifierTable::get() overload and start using it

Modified:
    cfe/trunk/include/clang/Basic/IdentifierTable.h
    cfe/trunk/lib/Frontend/PCHReader.cpp

Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=98343&r1=98342&r2=98343&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Fri Mar 12 04:32:27 2010
@@ -311,6 +311,14 @@
     return *II;
   }
 
+  IdentifierInfo &get(llvm::StringRef Name) {
+    return get(Name.begin(), Name.end());
+  }
+
+  IdentifierInfo &get(const char *Name, size_t NameLen) {
+    return get(llvm::StringRef(Name, NameLen));
+  }
+
   /// \brief Creates a new IdentifierInfo from the given string.
   ///
   /// This is a lower-level version of get() that requires that this
@@ -342,10 +350,6 @@
     return CreateIdentifierInfo(Name.begin(), Name.end());
   }
 
-  IdentifierInfo &get(llvm::StringRef Name) {
-    return get(Name.begin(), Name.end());
-  }
-
   typedef HashTableTy::const_iterator iterator;
   typedef HashTableTy::const_iterator const_iterator;
 

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=98343&r1=98342&r2=98343&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Fri Mar 12 04:32:27 2010
@@ -2628,7 +2628,7 @@
     unsigned StrLen = (((unsigned) StrLenPtr[0])
                        | (((unsigned) StrLenPtr[1]) << 8)) - 1;
     IdentifiersLoaded[ID - 1]
-      = &PP->getIdentifierTable().get(Str, Str + StrLen);
+      = &PP->getIdentifierTable().get(Str, StrLen);
   }
 
   return IdentifiersLoaded[ID - 1];





More information about the cfe-commits mailing list