[cfe-commits] r98339 - in /cfe/trunk: include/clang/Basic/IdentifierTable.h lib/Index/Entity.cpp lib/Index/GlobalSelector.cpp

Kovarththanan Rajaratnam kovarththanan.rajaratnam at gmail.com
Fri Mar 12 01:33:31 PST 2010


Author: krj
Date: Fri Mar 12 03:33:31 2010
New Revision: 98339

URL: http://llvm.org/viewvc/llvm-project?rev=98339&view=rev
Log:
Cleanup using StringRef

Modified:
    cfe/trunk/include/clang/Basic/IdentifierTable.h
    cfe/trunk/lib/Index/Entity.cpp
    cfe/trunk/lib/Index/GlobalSelector.cpp

Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=98339&r1=98338&r2=98339&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Fri Mar 12 03:33:31 2010
@@ -473,9 +473,7 @@
     SelectorName = "set";
     SelectorName += Name->getName();
     SelectorName[3] = toupper(SelectorName[3]);
-    IdentifierInfo *SetterName =
-      &Idents.get(SelectorName.data(),
-                  SelectorName.data() + SelectorName.size());
+    IdentifierInfo *SetterName = &Idents.get(SelectorName);
     return SelTable.getUnarySelector(SetterName);
   }
 };

Modified: cfe/trunk/lib/Index/Entity.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/Entity.cpp?rev=98339&r1=98338&r2=98339&view=diff
==============================================================================
--- cfe/trunk/lib/Index/Entity.cpp (original)
+++ cfe/trunk/lib/Index/Entity.cpp Fri Mar 12 03:33:31 2010
@@ -71,9 +71,7 @@
   DeclarationName GlobName;
 
   if (IdentifierInfo *II = LocalName.getAsIdentifierInfo()) {
-    IdentifierInfo *GlobII =
-      &ProgImpl.getIdents().get(II->getNameStart(),
-                                II->getNameStart() + II->getLength());
+    IdentifierInfo *GlobII = &ProgImpl.getIdents().get(II->getName());
     GlobName = DeclarationName(GlobII);
   } else {
     Selector LocalSel = LocalName.getObjCSelector();
@@ -140,9 +138,7 @@
   DeclarationName LocalName;
 
   if (IdentifierInfo *GlobII = Name.getAsIdentifierInfo()) {
-    IdentifierInfo &II =
-      AST.Idents.get(GlobII->getNameStart(),
-                     GlobII->getNameStart() + GlobII->getLength());
+    IdentifierInfo &II = AST.Idents.get(GlobII->getName());
     LocalName = DeclarationName(&II);
   } else {
     Selector GlobSel = Name.getObjCSelector();

Modified: cfe/trunk/lib/Index/GlobalSelector.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/GlobalSelector.cpp?rev=98339&r1=98338&r2=98339&view=diff
==============================================================================
--- cfe/trunk/lib/Index/GlobalSelector.cpp (original)
+++ cfe/trunk/lib/Index/GlobalSelector.cpp Fri Mar 12 03:33:31 2010
@@ -29,9 +29,7 @@
   for (unsigned i = 0, e = GlobSel.isUnarySelector() ? 1 : GlobSel.getNumArgs();
          i != e; ++i) {
     IdentifierInfo *GlobII = GlobSel.getIdentifierInfoForSlot(i);
-    IdentifierInfo *II =
-      &AST.Idents.get(GlobII->getNameStart(),
-                      GlobII->getNameStart() + GlobII->getLength());
+    IdentifierInfo *II = &AST.Idents.get(GlobII->getName());
     Ids.push_back(II);
   }
 
@@ -58,9 +56,7 @@
   for (unsigned i = 0, e = Sel.isUnarySelector() ? 1 : Sel.getNumArgs();
          i != e; ++i) {
     IdentifierInfo *II = Sel.getIdentifierInfoForSlot(i);
-    IdentifierInfo *GlobII =
-      &ProgImpl.getIdents().get(II->getNameStart(),
-                                II->getNameStart() + II->getLength());
+    IdentifierInfo *GlobII = &ProgImpl.getIdents().get(II->getName());
     Ids.push_back(GlobII);
   }
 





More information about the cfe-commits mailing list