diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-13 21:24:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-13 21:24:53 +0000 |
commit | 6b0656a7c386662e1bec5f23a3bd0bf2687a9635 (patch) | |
tree | 516c0870d16990140ec2ab0e35435d124e22531b /lib/Sema/SemaCodeComplete.cpp | |
parent | 7d520baec9b762633a09d31ee0db12e41fe2758a (diff) |
Eliminate the use of ObjCSuperExpr in code completion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 9ad653731f..9b504113f9 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -4449,16 +4449,11 @@ void Sema::CodeCompleteObjCSuperMessage(Scope *S, SourceLocation SuperLoc, if (CurMethod->isInstanceMethod()) { // We are inside an instance method, which means that the message // send [super ...] is actually calling an instance method on the - // current object. Build the super expression and handle this like - // an instance method. - QualType SuperTy = Context.getObjCInterfaceType(CDecl); - SuperTy = Context.getObjCObjectPointerType(SuperTy); - ExprResult Super - = Owned(new (Context) ObjCSuperExpr(SuperLoc, SuperTy)); - return CodeCompleteObjCInstanceMessage(S, (Expr *)Super.get(), + // current object. + return CodeCompleteObjCInstanceMessage(S, 0, SelIdents, NumSelIdents, AtArgumentExpression, - /*IsSuper=*/true); + CDecl); } // Fall through to send to the superclass in CDecl. @@ -4644,7 +4639,7 @@ void Sema::CodeCompleteObjCInstanceMessage(Scope *S, ExprTy *Receiver, IdentifierInfo **SelIdents, unsigned NumSelIdents, bool AtArgumentExpression, - bool IsSuper) { + ObjCInterfaceDecl *Super) { typedef CodeCompletionResult Result; Expr *RecExpr = static_cast<Expr *>(Receiver); @@ -4653,7 +4648,10 @@ void Sema::CodeCompleteObjCInstanceMessage(Scope *S, ExprTy *Receiver, // C99 6.7.5.3p[7,8]. if (RecExpr) DefaultFunctionArrayLvalueConversion(RecExpr); - QualType ReceiverType = RecExpr? RecExpr->getType() : Context.getObjCIdType(); + QualType ReceiverType = RecExpr? RecExpr->getType() + : Super? Context.getObjCObjectPointerType( + Context.getObjCInterfaceType(Super)) + : Context.getObjCIdType(); // Build the set of methods we can see. ResultBuilder Results(*this, CodeCompletionContext::CCC_Other); @@ -4661,7 +4659,7 @@ void Sema::CodeCompleteObjCInstanceMessage(Scope *S, ExprTy *Receiver, // If this is a send-to-super, try to add the special "super" send // completion. - if (IsSuper) { + if (Super) { if (ObjCMethodDecl *SuperMethod = AddSuperSendCompletion(*this, false, SelIdents, NumSelIdents, Results)) |