]> granicus.if.org Git - clang/commitdiff
Refinement to previous commit. Always cast the first argument to "id"...no need to...
authorSteve Naroff <snaroff@apple.com>
Thu, 15 Nov 2007 00:00:21 +0000 (00:00 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 15 Nov 2007 00:00:21 +0000 (00:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44149 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteTest.cpp

index c5c851b4ec0119c859730be96b9fbb0470784d83..0f6c9741cdb8aba9fc2fb8da09798364ff6cbed4 100644 (file)
@@ -1046,12 +1046,7 @@ Stmt *RewriteTest::RewriteMessageExpr(ObjCMessageExpr *Exp) {
   } else { // instance message.
     Expr *recExpr = Exp->getReceiver();
     
-    // Make sure we cast "self" to "id".
-    if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(recExpr)) {
-      if (!strcmp(DRE->getDecl()->getName(), "self"))
-        recExpr = new CastExpr(Context->getObjcIdType(), recExpr, 
-                               SourceLocation());
-    }
+    recExpr = new CastExpr(Context->getObjcIdType(), recExpr, SourceLocation());
     MsgExprs.push_back(recExpr);
   }
   // Create a call to sel_registerName("selName"), it will be the 2nd argument.