Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:
- ASTUnit wasn't saving/restoring diagnostic state appropriately between
reparses and code completions.
- "Overload" completions weren't being passed through to the client
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116241 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index a9c97e4..9ad6537 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -2366,10 +2366,12 @@
CodeCompletionString *
CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(
unsigned CurrentArg,
- Sema &S) const {
+ Sema &S,
+ CodeCompletionString *Result) const {
typedef CodeCompletionString::Chunk Chunk;
- CodeCompletionString *Result = new CodeCompletionString;
+ if (!Result)
+ Result = new CodeCompletionString;
FunctionDecl *FDecl = getFunction();
AddResultTypeChunk(S.Context, FDecl, Result);
const FunctionProtoType *Proto