Author: fjahanian
Date: Tue Jan 12 11:31:23 2010
New Revision: 93241

URL: http://llvm.org/viewvc/llvm-project?rev=93241&view=rev
Log:
Improve on objective-c pointer recognition
during rewrite. No functionality chang.

Modified:
    cfe/trunk/lib/Frontend/RewriteObjC.cpp

Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=93241&r1=93240&r2=93241&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Tue Jan 12 11:31:23 2010
@@ -1195,7 +1195,8 @@
   ObjCIvarDecl *D = IV->getDecl();
   const Expr *BaseExpr = IV->getBase();
   if (CurMethodDef) {
-    if (IV->isArrow() && isa<DeclRefExpr>(BaseExpr)) {
+    if (BaseExpr->getType()->isObjCObjectPointerType() && 
+        isa<DeclRefExpr>(BaseExpr)) {
       ObjCInterfaceType *iFaceDecl =
         dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType());
       // lookup which class implements the instance variable.
@@ -1243,7 +1244,7 @@
 
     // Explicit ivar refs need to have a cast inserted.
     // FIXME: consider sharing some of this code with the code above.
-    if (IV->isArrow()) {
+    if (BaseExpr->getType()->isObjCObjectPointerType()) {
       ObjCInterfaceType *iFaceDecl =
         dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType());
       // lookup which class implements the instance variable.


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to