diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-12 17:31:23 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-12 17:31:23 +0000 |
commit | 26337b2f6d4b8dc7458a6e24dca05cb021a21861 (patch) | |
tree | ac97b739b383c88d5db6b4e5bbcbf12ad0af4f7a /lib/Frontend/RewriteObjC.cpp | |
parent | 2e9338824f896790ca0766f7505259ce129eb51a (diff) |
Improve on objective-c pointer recognition
during rewrite. No functionality chang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index 74b2a1eb85..e9072d62e7 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/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<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 @@ 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<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType()); // lookup which class implements the instance variable. |