[cfe-commits] r98347 - /cfe/trunk/include/clang/Basic/IdentifierTable.h

Kovarththanan Rajaratnam kovarththanan.rajaratnam at gmail.com
Fri Mar 12 04:01:19 PST 2010


Author: krj
Date: Fri Mar 12 06:01:19 2010
New Revision: 98347

URL: http://llvm.org/viewvc/llvm-project?rev=98347&view=rev
Log:
Make IdentifierTable::get(StringRef) "primary" (no functionality change)

Modified:
    cfe/trunk/include/clang/Basic/IdentifierTable.h

Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=98347&r1=98346&r2=98347&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Fri Mar 12 06:01:19 2010
@@ -282,16 +282,16 @@
 
   /// get - Return the identifier token info for the specified named identifier.
   ///
-  IdentifierInfo &get(const char *NameStart, const char *NameEnd) {
+  IdentifierInfo &get(llvm::StringRef Name) {
     llvm::StringMapEntry<IdentifierInfo*> &Entry =
-      HashTable.GetOrCreateValue(NameStart, NameEnd);
+      HashTable.GetOrCreateValue(Name);
 
     IdentifierInfo *II = Entry.getValue();
     if (II) return *II;
 
     // No entry; if we have an external lookup, look there first.
     if (ExternalLookup) {
-      II = ExternalLookup->get(llvm::StringRef(NameStart, NameEnd-NameStart));
+      II = ExternalLookup->get(Name);
       if (II) {
         // Cache in the StringMap for subsequent lookups.
         Entry.setValue(II);
@@ -311,8 +311,8 @@
     return *II;
   }
 
-  IdentifierInfo &get(llvm::StringRef Name) {
-    return get(Name.begin(), Name.end());
+  IdentifierInfo &get(const char *NameStart, const char *NameEnd) {
+    return get(llvm::StringRef(NameStart, NameEnd-NameStart));
   }
 
   IdentifierInfo &get(const char *Name, size_t NameLen) {





More information about the cfe-commits mailing list