From 242ea9a05af8d5635e5c47697dd533ed9da2bfeb Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 13 Nov 2009 08:58:20 +0000 Subject: Rework Sema code completion interface. - Provide Sema in callbacks, instead of requiring it in constructor. This eliminates the need for a factory function. Clients now just pass the object to consume the results in directly. - CodeCompleteConsumer is cheap to construct, so building it whenever we are doing code completion is reasonable. Doug, please review. llvm-svn: 87099 --- clang/lib/Sema/CodeCompleteConsumer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'clang/lib/Sema/CodeCompleteConsumer.cpp') diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp index f94989ee721..3529ece2574 100644 --- a/clang/lib/Sema/CodeCompleteConsumer.cpp +++ b/clang/lib/Sema/CodeCompleteConsumer.cpp @@ -508,7 +508,8 @@ CodeCompleteConsumer::OverloadCandidate::getFunctionType() const { CodeCompleteConsumer::~CodeCompleteConsumer() { } void -PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Result *Results, +PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, + Result *Results, unsigned NumResults) { // Print the results. for (unsigned I = 0; I != NumResults; ++I) { @@ -552,7 +553,8 @@ PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Result *Results, } void -PrintingCodeCompleteConsumer::ProcessOverloadCandidates(unsigned CurrentArg, +PrintingCodeCompleteConsumer::ProcessOverloadCandidates(Sema &SemaRef, + unsigned CurrentArg, OverloadCandidate *Candidates, unsigned NumCandidates) { for (unsigned I = 0; I != NumCandidates; ++I) { @@ -570,7 +572,8 @@ PrintingCodeCompleteConsumer::ProcessOverloadCandidates(unsigned CurrentArg, } void -CIndexCodeCompleteConsumer::ProcessCodeCompleteResults(Result *Results, +CIndexCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, + Result *Results, unsigned NumResults) { // Print the results. for (unsigned I = 0; I != NumResults; ++I) { @@ -632,7 +635,8 @@ CIndexCodeCompleteConsumer::ProcessCodeCompleteResults(Result *Results, } void -CIndexCodeCompleteConsumer::ProcessOverloadCandidates(unsigned CurrentArg, +CIndexCodeCompleteConsumer::ProcessOverloadCandidates(Sema &SemaRef, + unsigned CurrentArg, OverloadCandidate *Candidates, unsigned NumCandidates) { for (unsigned I = 0; I != NumCandidates; ++I) { -- cgit v1.2.3