Rename Objective-C message send completion functions to indicate that we're referring to message sends
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89164 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index f656905..87fa63e 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -2328,25 +2328,27 @@
/// \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) { }
//@}
};
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 6a2c213..f0b1e9f 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1569,9 +1569,9 @@
ExprArg ReceiverExpr) {
if (Tok.is(tok::code_completion)) {
if (ReceiverName)
- Actions.CodeCompleteObjCFactoryMethod(CurScope, ReceiverName);
+ Actions.CodeCompleteObjCClassMessage(CurScope, ReceiverName, NameLoc);
else
- Actions.CodeCompleteObjCInstanceMethod(CurScope, ReceiverExpr.release());
+ Actions.CodeCompleteObjCInstanceMessage(CurScope, ReceiverExpr.get());
ConsumeToken();
}
// Parse objc-selector
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 637075b..b3db88a 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -4003,8 +4003,9 @@
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);
//@}
//===--------------------------------------------------------------------===//
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 70af446..563ba6b 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -1624,13 +1624,11 @@
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()) {
@@ -1652,8 +1650,8 @@
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.
@@ -1663,7 +1661,7 @@
// 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>())
@@ -1673,9 +1671,9 @@
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,
@@ -1689,7 +1687,7 @@
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);