aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2007-12-06 19:49:56 +0000
committerFariborz Jahanian <fjahanian@apple.com>2007-12-06 19:49:56 +0000
commitd0ee6f9f9a5bc5d85e7469f5aabf91f1e71b12f5 (patch)
tree6426e3d41a8706f087b9d3a9123fbddd5f2cf2cf
parent37884b3b3ab34bf539ba3eee44708886f2fc91cf (diff)
On Steve's suggestion, moved handling of use of undeclared method in a message
to rewriter (my previous patch). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44665 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Driver/RewriteTest.cpp8
-rw-r--r--Sema/SemaExpr.cpp4
2 files changed, 4 insertions, 8 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index b0c40f7b34..9b19cfb450 100644
--- a/Driver/RewriteTest.cpp
+++ b/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/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 95b900c677..ed71934621 100644
--- a/Sema/SemaExpr.cpp
+++ b/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())