]> granicus.if.org Git - clang/commitdiff
Implement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar refs...
authorSteve Naroff <snaroff@apple.com>
Fri, 18 Apr 2008 21:55:08 +0000 (21:55 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 18 Apr 2008 21:55:08 +0000 (21:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49932 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index f66658864b398d19a68572d037876a8b88ba828f..c78e51963012f00f267890503ef8e6e365bfc536 100644 (file)
@@ -846,13 +846,12 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
         }
       }
     }
+  } else { // we are outside a method.
+    if (IV->isFreeIvar())
+      assert(1 && "Cannot have a free standing ivar outside a method");
+    // Explicit ivar refs do not need to be rewritten. Do nothing.
   }
-  // FIXME: Implement public ivar access from a function.
-  Expr *Replacement = new MemberExpr(IV->getBase(), true, D, 
-                                     IV->getLocation(), D->getType());
-  ReplaceStmt(IV, Replacement);
-  delete IV;
-  return Replacement;
+  return IV;
 }
 
 //===----------------------------------------------------------------------===//