]> granicus.if.org Git - clang/commitdiff
On Steve's suggestion, moved handling of use of undeclared method in a message
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 6 Dec 2007 19:49:56 +0000 (19:49 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 6 Dec 2007 19:49:56 +0000 (19:49 +0000)
to rewriter (my previous patch).

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

Driver/RewriteTest.cpp
Sema/SemaExpr.cpp

index b0c40f7b3412f163038aced2c181ce14dc09a5e3..9b19cfb450c8d6878ed4431ff7af607bca90578f 100644 (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());
     
index 95b900c67727a795cefa1e5fb8d8c2411899933b..ed719346215e354cec5246341b55184cc1c53d15 100644 (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())