aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-01-12 17:31:23 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-01-12 17:31:23 +0000
commit26337b2f6d4b8dc7458a6e24dca05cb021a21861 (patch)
treeac97b739b383c88d5db6b4e5bbcbf12ad0af4f7a /lib/Frontend/RewriteObjC.cpp
parent2e9338824f896790ca0766f7505259ce129eb51a (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.cpp5
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.