Refinement to previous commit. Always cast the first argument to "id"...no need to special case self.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44149 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index c5c851b..0f6c974 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -1046,12 +1046,7 @@
} 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.