r184168 - ArrayRef'ize CodeCompletionContext::getNumSelIdents()

Dmitri Gribenko gribozavr at gmail.com
Mon Jun 17 21:02:26 PDT 2013


Author: gribozavr
Date: Mon Jun 17 23:02:26 2013
New Revision: 184168

URL: http://llvm.org/viewvc/llvm-project?rev=184168&view=rev
Log:
ArrayRef'ize CodeCompletionContext::getNumSelIdents()

Modified:
    cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
    cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp

Modified: cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h?rev=184168&r1=184167&r2=184168&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h (original)
+++ cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h Mon Jun 17 23:02:26 2013
@@ -303,10 +303,7 @@ public:
   QualType getBaseType() const { return BaseType; }
 
   /// \brief Retrieve the Objective-C selector identifiers.
-  IdentifierInfo * const *getSelIdents() const { return SelIdents.data(); }
-
-  /// \brief Retrieve the number of Objective-C selector identifiers.
-  unsigned getNumSelIdents() const { return SelIdents.size(); }
+  ArrayRef<IdentifierInfo *> getSelIdents() const { return SelIdents; }
 
   /// \brief Determines whether we want C++ constructors as results within this
   /// context.

Modified: cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp?rev=184168&r1=184167&r2=184168&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp Mon Jun 17 23:02:26 2013
@@ -562,15 +562,13 @@ namespace {
       AllocatedResults.Contexts = getContextsForContextKind(contextKind, S);
       
       AllocatedResults.Selector = "";
-      if (Context.getNumSelIdents() > 0) {
-        for (unsigned i = 0; i < Context.getNumSelIdents(); i++) {
-          IdentifierInfo *selIdent = Context.getSelIdents()[i];
-          if (selIdent != NULL) {
-            StringRef selectorString = Context.getSelIdents()[i]->getName();
-            AllocatedResults.Selector += selectorString;
-          }
-          AllocatedResults.Selector += ":";
+      for (unsigned i = 0, e = Context.getSelIdents().size(); i != e; i++) {
+        IdentifierInfo *selIdent = Context.getSelIdents()[i];
+        if (selIdent != NULL) {
+          StringRef selectorString = Context.getSelIdents()[i]->getName();
+          AllocatedResults.Selector += selectorString;
         }
+        AllocatedResults.Selector += ":";
       }
       
       QualType baseType = Context.getBaseType();





More information about the cfe-commits mailing list