/// \param S the scope in which the operator keyword occurs.
virtual void CodeCompleteObjCProperty(Scope *S, ObjCDeclSpec &ODS) { }
- /// \brief Code completion for an ObjC factory method (from within a message
- /// expression).
+ /// \brief Code completion for an ObjC message expression that refers to
+ /// a class method.
///
/// This code completion action is invoked when the code-completion token is
/// found after the class name.
///
/// \param S the scope in which the message expression occurs.
/// \param FName the factory name.
- virtual void CodeCompleteObjCFactoryMethod(Scope *S, IdentifierInfo *FName){ }
+ /// \param FNameLoc the source location of the factory name.
+ virtual void CodeCompleteObjCClassMessage(Scope *S, IdentifierInfo *FName,
+ SourceLocation FNameLoc){ }
- /// \brief Code completion for an ObjC instance method (from within a message
- /// expression).
+ /// \brief Code completion for an ObjC message expression that refers to
+ /// an instance method.
///
/// This code completion action is invoked when the code-completion token is
/// found after the receiver expression.
///
/// \param S the scope in which the operator keyword occurs.
/// \param Receiver an expression for the receiver of the message.
- virtual void CodeCompleteObjCInstanceMethod(Scope *S, ExprTy *Receiver) { }
+ virtual void CodeCompleteObjCInstanceMessage(Scope *S, ExprTy *Receiver) { }
//@}
};
virtual void CodeCompleteOperatorName(Scope *S);
virtual void CodeCompleteObjCProperty(Scope *S, ObjCDeclSpec &ODS);
- virtual void CodeCompleteObjCFactoryMethod(Scope *S, IdentifierInfo *FName);
- virtual void CodeCompleteObjCInstanceMethod(Scope *S, ExprTy *Receiver);
+ virtual void CodeCompleteObjCClassMessage(Scope *S, IdentifierInfo *FName,
+ SourceLocation FNameLoc);
+ virtual void CodeCompleteObjCInstanceMessage(Scope *S, ExprTy *Receiver);
//@}
//===--------------------------------------------------------------------===//
AddObjCMethods(Impl, WantInstanceMethods, CurContext, Results);
}
-void Sema::CodeCompleteObjCFactoryMethod(Scope *S, IdentifierInfo *FName) {
+void Sema::CodeCompleteObjCClassMessage(Scope *S, IdentifierInfo *FName,
+ SourceLocation FNameLoc) {
typedef CodeCompleteConsumer::Result Result;
ObjCInterfaceDecl *CDecl = 0;
- // FIXME: Pass this in!
- SourceLocation NameLoc;
-
if (FName->isStr("super")) {
// We're sending a message to "super".
if (ObjCMethodDecl *CurMethod = getCurMethodDecl()) {
QualType SuperTy = Context.getObjCInterfaceType(CDecl);
SuperTy = Context.getObjCObjectPointerType(SuperTy);
OwningExprResult Super
- = Owned(new (Context) ObjCSuperExpr(NameLoc, SuperTy));
- return CodeCompleteObjCInstanceMethod(S, (Expr *)Super.get());
+ = Owned(new (Context) ObjCSuperExpr(FNameLoc, SuperTy));
+ return CodeCompleteObjCInstanceMessage(S, (Expr *)Super.get());
}
// Okay, we're calling a factory method in our superclass.
// If the given name refers to an interface type, retrieve the
// corresponding declaration.
if (!CDecl)
- if (TypeTy *Ty = getTypeName(*FName, NameLoc, S, 0, false)) {
+ if (TypeTy *Ty = getTypeName(*FName, FNameLoc, S, 0, false)) {
QualType T = GetTypeFromParser(Ty, 0);
if (!T.isNull())
if (const ObjCInterfaceType *Interface = T->getAs<ObjCInterfaceType>())
if (!CDecl && FName->isStr("super")) {
// "super" may be the name of a variable, in which case we are
// probably calling an instance method.
- OwningExprResult Super = ActOnDeclarationNameExpr(S, NameLoc, FName,
+ OwningExprResult Super = ActOnDeclarationNameExpr(S, FNameLoc, FName,
false, 0, false);
- return CodeCompleteObjCInstanceMethod(S, (Expr *)Super.get());
+ return CodeCompleteObjCInstanceMessage(S, (Expr *)Super.get());
}
// Add all of the factory methods in this Objective-C class, its protocols,
HandleCodeCompleteResults(this, CodeCompleter, Results.data(),Results.size());
}
-void Sema::CodeCompleteObjCInstanceMethod(Scope *S, ExprTy *Receiver) {
+void Sema::CodeCompleteObjCInstanceMessage(Scope *S, ExprTy *Receiver) {
typedef CodeCompleteConsumer::Result Result;
Expr *RecExpr = static_cast<Expr *>(Receiver);