diff options
Diffstat (limited to 'clang/lib/Sema/CodeCompleteConsumer.cpp')
-rw-r--r-- | clang/lib/Sema/CodeCompleteConsumer.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp index f1b475a6df5..a3d4d92fc3c 100644 --- a/clang/lib/Sema/CodeCompleteConsumer.cpp +++ b/clang/lib/Sema/CodeCompleteConsumer.cpp @@ -169,26 +169,10 @@ PrintingCodeCompleteConsumer::ProcessOverloadCandidates(unsigned CurrentArg, OverloadCandidate *Candidates, unsigned NumCandidates) { for (unsigned I = 0; I != NumCandidates; ++I) { - std::string ArgString; - QualType ArgType; - - if (FunctionDecl *Function = Candidates[I].getFunction()) { - if (CurrentArg < Function->getNumParams()) { - ArgString = Function->getParamDecl(CurrentArg)->getNameAsString(); - ArgType = Function->getParamDecl(CurrentArg)->getOriginalType(); - } - } else if (const FunctionProtoType *Proto - = dyn_cast<FunctionProtoType>( - Candidates[I].getFunctionType())) { - if (CurrentArg < Proto->getNumArgs()) - ArgType = Proto->getArgType(CurrentArg); - } - - if (ArgType.isNull()) - OS << "...\n"; // We have no prototype or we're matching an ellipsis. - else { - ArgType.getAsStringInternal(ArgString, SemaRef.Context.PrintingPolicy); - OS << ArgString << "\n"; + if (CodeCompletionString *CCS + = Candidates[I].CreateSignatureString(CurrentArg, SemaRef)) { + OS << CCS->getAsString() << "\n"; + delete CCS; } } |