]> granicus.if.org Git - clang/commitdiff
objective-C: underline name of the missing method
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 31 Aug 2012 17:03:18 +0000 (17:03 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 31 Aug 2012 17:03:18 +0000 (17:03 +0000)
in the diagnbostic. // rdar://11303469

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163003 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/Sema.h
lib/Sema/SemaExprObjC.cpp

index b0afc98006ef2dee7209a9215a4981a703585cd1..5fdb09caea984a6424f4dcf637647882770ce80e 100644 (file)
@@ -6796,6 +6796,7 @@ public:
   /// \return true iff there were any incompatible types.
   bool CheckMessageArgumentTypes(QualType ReceiverType,
                                  Expr **Args, unsigned NumArgs, Selector Sel,
+                                 ArrayRef<SourceLocation> SelectorLocs,
                                  ObjCMethodDecl *Method, bool isClassMessage,
                                  bool isSuperMessage,
                                  SourceLocation lbrac, SourceLocation rbrac,
index 79161cfcc5f457e0669b27df5419811eb982989e..17850bb2d7ef82bbb09a3eef386ce717ed9f48d9 100644 (file)
@@ -1123,7 +1123,9 @@ void Sema::EmitRelatedResultTypeNote(const Expr *E) {
 
 bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
                                      Expr **Args, unsigned NumArgs,
-                                     Selector Sel, ObjCMethodDecl *Method,
+                                     Selector Sel, 
+                                     ArrayRef<SourceLocation> SelectorLocs,
+                                     ObjCMethodDecl *Method,
                                      bool isClassMessage, bool isSuperMessage,
                                      SourceLocation lbrac, SourceLocation rbrac,
                                      QualType &ReturnType, ExprValueKind &VK) {
@@ -1147,7 +1149,8 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
                               : diag::warn_inst_method_not_found;
     if (!getLangOpts().DebuggerSupport)
       Diag(lbrac, DiagID)
-        << Sel << isClassMessage << SourceRange(lbrac, rbrac);
+        << Sel << isClassMessage << SourceRange(SelectorLocs.front(), 
+                                                SelectorLocs.back());
 
     // In debuggers, we want to use __unknown_anytype for these
     // results so that clients can cast them.
@@ -1964,7 +1967,8 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
 
   unsigned NumArgs = ArgsIn.size();
   Expr **Args = ArgsIn.data();
-  if (CheckMessageArgumentTypes(ReceiverType, Args, NumArgs, Sel, Method, true,
+  if (CheckMessageArgumentTypes(ReceiverType, Args, NumArgs, Sel, SelectorLocs,
+                                Method, true,
                                 SuperLoc.isValid(), LBracLoc, RBracLoc, 
                                 ReturnType, VK))
     return ExprError();
@@ -2298,7 +2302,8 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
   ExprValueKind VK = VK_RValue;
   bool ClassMessage = (ReceiverType->isObjCClassType() ||
                        ReceiverType->isObjCQualifiedClassType());
-  if (CheckMessageArgumentTypes(ReceiverType, Args, NumArgs, Sel, Method, 
+  if (CheckMessageArgumentTypes(ReceiverType, Args, NumArgs, Sel,
+                                SelectorLocs, Method, 
                                 ClassMessage, SuperLoc.isValid(), 
                                 LBracLoc, RBracLoc, ReturnType, VK))
     return ExprError();