From 12e2e86f0f812d49cbf845e942c419f609ce0ff0 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 12 Jan 2010 17:31:23 +0000 Subject: [PATCH] Improve on objective-c pointer recognition during rewrite. No functionality chang. llvm-svn: 93241 --- clang/lib/Frontend/RewriteObjC.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index 74b2a1eb85e9..e9072d62e76d 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/lib/Frontend/RewriteObjC.cpp @@ -1195,7 +1195,8 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV, ObjCIvarDecl *D = IV->getDecl(); const Expr *BaseExpr = IV->getBase(); if (CurMethodDef) { - if (IV->isArrow() && isa(BaseExpr)) { + if (BaseExpr->getType()->isObjCObjectPointerType() && + isa(BaseExpr)) { ObjCInterfaceType *iFaceDecl = dyn_cast(BaseExpr->getType()->getPointeeType()); // lookup which class implements the instance variable. @@ -1243,7 +1244,7 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV, // 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(BaseExpr->getType()->getPointeeType()); // lookup which class implements the instance variable.