diff options
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index cfeefffa60..73e0ab0fad 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -1356,9 +1356,23 @@ static void HandleCodeCompleteResults(Sema *S, } void Sema::CodeCompleteOrdinaryName(Scope *S) { + typedef CodeCompleteConsumer::Result Result; ResultBuilder Results(*this, &ResultBuilder::IsOrdinaryName); unsigned NextRank = CollectLookupResults(S, Context.getTranslationUnitDecl(), 0, CurContext, Results); + + Results.EnterNewScope(); + AddTypeSpecifierResults(getLangOptions(), NextRank, Results); + + if (getLangOptions().ObjC1) { + // Add the "super" keyword, if appropriate. + if (ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(CurContext)) + if (Method->getClassInterface()->getSuperClass()) + Results.MaybeAddResult(Result("super", NextRank)); + } + + Results.ExitScope(); + if (CodeCompleter->includeMacros()) AddMacroResults(PP, NextRank, Results); HandleCodeCompleteResults(this, CodeCompleter, Results.data(),Results.size()); |