]> granicus.if.org Git - clang/commitdiff
Refix rewriting of an ivar access when it is
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 26 Jan 2010 18:28:51 +0000 (18:28 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 26 Jan 2010 18:28:51 +0000 (18:28 +0000)
type-cast to its sub-class (radar 7575882).

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

clang.xcodeproj/project.pbxproj
lib/Frontend/RewriteObjC.cpp

index d1cd032ec03337aa23976cb6d9d668b9caabdfc4..41986dc3e1f2b7af5e9ccc9421f56b71559f8688 100644 (file)
                356EF9B30C8F7DCA006650F5 /* Analysis */ = {
                        isa = PBXGroup;
                        children = (
+                               DE67E70A0C020EC500F66BC5 /* SemaType.cpp */,
                                35544B840F5C7F9D00D92AA9 /* Path-Sensitive */,
                                3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */,
                                3507E4C30E27FE3800FB7B57 /* Checks */,
                                BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */,
                                35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */,
                                1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */,
-                               DE67E70A0C020EC500F66BC5 /* SemaType.cpp */,
                                1AE4EE3B103B89CA00888A23 /* TreeTransform.h */,
                        );
                        name = Sema;
index e473adbf9e79441904c082f87d1ef309144de999..fbd68569ff6de0ecf71ca084d6d399c239affcdf 100644 (file)
@@ -1213,8 +1213,7 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV,
   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 @@ void RewriteObjC::RewriteCastExpr(CStyleCastExpr *CE) {
                 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;