On Steve's suggestion, moved handling of use of undeclared method in a message

to rewriter (my previous patch).

llvm-svn: 44665
This commit is contained in:
Fariborz Jahanian 2007-12-06 19:49:56 +00:00
parent 65a2288eef
commit 227c0d13bc
2 changed files with 4 additions and 8 deletions

View File

@ -1419,8 +1419,8 @@ Stmt *RewriteTest::RewriteMessageExpr(ObjCMessageExpr *Exp) {
// Now do the "normal" pointer to function cast.
QualType castType = Context->getFunctionType(returnType,
&ArgTypes[0], ArgTypes.size(),
Exp->getMethodDecl()->isVariadic());
&ArgTypes[0], ArgTypes.size(),
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false);
castType = Context->getPointerType(castType);
cast = new CastExpr(castType, cast, SourceLocation());
@ -1444,8 +1444,8 @@ Stmt *RewriteTest::RewriteMessageExpr(ObjCMessageExpr *Exp) {
SourceLocation());
// Now do the "normal" pointer to function cast.
castType = Context->getFunctionType(returnType,
&ArgTypes[0], ArgTypes.size(),
Exp->getMethodDecl()->isVariadic());
&ArgTypes[0], ArgTypes.size(),
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false);
castType = Context->getPointerType(castType);
cast = new CastExpr(castType, cast, SourceLocation());

View File

@ -2242,10 +2242,6 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
returnType = Context.getObjcIdType();
// Must have a dummy method declaration, so clients work as expected
Method = new ObjcMethodDecl(SourceLocation(), SourceLocation(), Sel,
returnType, ClassDecl, 0, -1, 0, true, false,
ObjcMethodDecl::None);
} else {
returnType = Method->getResultType();
if (Sel.getNumArgs())