]> granicus.if.org Git - clang/commitdiff
Fix a regression caused by my rewriting of cast of ivar
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 26 Jan 2010 00:29:22 +0000 (00:29 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 26 Jan 2010 00:29:22 +0000 (00:29 +0000)
access (was radar 7575882).

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

lib/Frontend/RewriteObjC.cpp
test/Rewriter/rewrite-cast-ivar-access.mm

index 19c714da3daabff04489ab5d51f327bbfd91633e..e473adbf9e79441904c082f87d1ef309144de999 100644 (file)
@@ -4308,15 +4308,17 @@ void RewriteObjC::RewriteCastExpr(CStyleCastExpr *CE) {
                 TypeAsString.c_str(), TypeAsString.size());
     return;
   }
-  if (QT->isObjCObjectPointerType()) {
-    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;    
+  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;
index bdda68951218b9f93df46a035abadb610a74d423..177824d0263fc4a008443d6457c60d0692c4bcd0 100644 (file)
 }
 @end
 
+void objc_assign_strongCast(id);
+void __CFAssignWithWriteBarrier(void **location, void *value) {
+        objc_assign_strongCast((id)value);
+}
+
 // CHECK-LP: ((struct G_IMPL *)arg)->ivar
 
+// CHECK-LP: objc_assign_strongCast((id)value)