Separate the code-completion results for call completion from the
results for other, textual completion. For call completion, we now
produce enough information to show the function call argument that we
are currently on.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82592 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index ec01941..754d505 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -1161,19 +1161,17 @@
IsBetterOverloadCandidate(*this));
// Add the remaining viable overload candidates as code-completion reslults.
- typedef CodeCompleteConsumer::Result Result;
- ResultBuilder Results(*this);
- Results.EnterNewScope();
+ typedef CodeCompleteConsumer::OverloadCandidate ResultCandidate;
+ llvm::SmallVector<ResultCandidate, 8> Results;
for (OverloadCandidateSet::iterator Cand = CandidateSet.begin(),
CandEnd = CandidateSet.end();
Cand != CandEnd; ++Cand) {
if (Cand->Viable)
- Results.MaybeAddResult(Result(Cand->Function, 0), 0);
+ Results.push_back(ResultCandidate(Cand->Function));
}
-
- Results.ExitScope();
- HandleCodeCompleteResults(CodeCompleter, Results.data(), Results.size());
+ CodeCompleter->ProcessOverloadCandidates(NumArgs, Results.data(),
+ Results.size());
}
void Sema::CodeCompleteQualifiedId(Scope *S, const CXXScopeSpec &SS,