improve diagnostics about problems with receivers to highlight the receiver.

llvm-svn: 53842
This commit is contained in:
Chris Lattner 2008-07-21 06:16:07 +00:00
parent bd2d634424
commit 12bf571fa8
1 changed files with 3 additions and 3 deletions

View File

@ -266,7 +266,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
Method = InstanceMethodPool[Sel].Method;
if (!Method) {
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
RExpr->getSourceRange());
returnType = Context.getObjCIdType();
} else {
returnType = Method->getResultType();
@ -295,7 +295,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
if (!Method)
Diag(lbrac, diag::warn_method_not_found_in_protocol,
std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
RExpr->getSourceRange());
} else if (const ObjCInterfaceType *OCIReceiver =
receiverType->getAsPointerToObjCInterfaceType()) {
// We allow sending a message to a pointer to an interface (an object).
@ -321,7 +321,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
SourceRange(lbrac, rbrac));
} else {
Diag(lbrac, diag::error_bad_receiver_type,
RExpr->getType().getAsString());
RExpr->getType().getAsString(), RExpr->getSourceRange());
return true;
}