From 227c0d13bc9387bb73fd1d49f34d1d7394bdb74e Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 6 Dec 2007 19:49:56 +0000 Subject: [PATCH] On Steve's suggestion, moved handling of use of undeclared method in a message to rewriter (my previous patch). llvm-svn: 44665 --- clang/Driver/RewriteTest.cpp | 8 ++++---- clang/Sema/SemaExpr.cpp | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index b0c40f7b3412..9b19cfb450c8 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/Driver/RewriteTest.cpp @@ -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()); diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp index 95b900c67727..ed719346215e 100644 --- a/clang/Sema/SemaExpr.cpp +++ b/clang/Sema/SemaExpr.cpp @@ -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())