Refix rewriting of an ivar access when it is
type-cast to its sub-class (radar 7575882).

llvm-svn: 94559
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index e473adb..fbd6856 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/lib/Frontend/RewriteObjC.cpp
@@ -1213,8 +1213,7 @@
   ObjCIvarDecl *D = IV->getDecl();
   const Expr *BaseExpr = IV->getBase();
   if (CurMethodDef) {
-    if (BaseExpr->getType()->isObjCObjectPointerType() && 
-        isa<DeclRefExpr>(BaseExpr)) {
+    if (BaseExpr->getType()->isObjCObjectPointerType()) {
       ObjCInterfaceType *iFaceDecl =
         dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType());
       // lookup which class implements the instance variable.
@@ -4308,18 +4307,6 @@
                 TypeAsString.c_str(), TypeAsString.size());
     return;
   }
-  if (LangOpts.Microsoft && QT->isObjCObjectPointerType()) {
-    if (isa<ObjCInterfaceType>(QT->getPointeeType())) {
-      QualType ptee = QT->getAs<ObjCObjectPointerType>()->getPointeeType();
-      std::string TypeAsString = "(struct ";
-      TypeAsString += ptee.getAsString();
-      TypeAsString += "_IMPL *";
-      TypeAsString += ")";
-      ReplaceText(LocStart, endBuf-startBuf+1, 
-                  TypeAsString.c_str(), TypeAsString.size());
-      return;
-    }  
-  }
   // advance the location to startArgList.
   const char *argPtr = startBuf;