]> granicus.if.org Git - clang/commitdiff
ArrayRef'ize CodeCompletionContext::getNumSelIdents()
authorDmitri Gribenko <gribozavr@gmail.com>
Tue, 18 Jun 2013 04:02:26 +0000 (04:02 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Tue, 18 Jun 2013 04:02:26 +0000 (04:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184168 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/CodeCompleteConsumer.h
tools/libclang/CIndexCodeCompletion.cpp

index b152cca9ab9cb7faedc425acf8729d21ed310ad0..64de82c6b05f3c3a59392e4e359d28e991188a4f 100644 (file)
@@ -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.
index bfd54f5c00241f4ad119a4fe6e3cca278991c0ca..411728b789b897f1eaa98953ea913c554fe5948a 100644 (file)
@@ -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();