diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-06-18 04:02:26 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-06-18 04:02:26 +0000 |
commit | 9fdd7e6d2795a216ea378bf0c93305ce129630b4 (patch) | |
tree | c159cf289cd5b7a306656bf430021174de605c68 /clang | |
parent | bf4aa573989f67b3d371c1808f86caef6dbc74f2 (diff) | |
download | bcm5719-llvm-9fdd7e6d2795a216ea378bf0c93305ce129630b4.tar.gz bcm5719-llvm-9fdd7e6d2795a216ea378bf0c93305ce129630b4.zip |
ArrayRef'ize CodeCompletionContext::getNumSelIdents()
llvm-svn: 184168
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Sema/CodeCompleteConsumer.h | 5 | ||||
-rw-r--r-- | clang/tools/libclang/CIndexCodeCompletion.cpp | 14 |
2 files changed, 7 insertions, 12 deletions
diff --git a/clang/include/clang/Sema/CodeCompleteConsumer.h b/clang/include/clang/Sema/CodeCompleteConsumer.h index b152cca9ab9..64de82c6b05 100644 --- a/clang/include/clang/Sema/CodeCompleteConsumer.h +++ b/clang/include/clang/Sema/CodeCompleteConsumer.h @@ -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. diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp index bfd54f5c002..411728b789b 100644 --- a/clang/tools/libclang/CIndexCodeCompletion.cpp +++ b/clang/tools/libclang/CIndexCodeCompletion.cpp @@ -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(); |