Improve on objective-c pointer recognition

during rewrite. No functionality chang.

llvm-svn: 93241
This commit is contained in:
Fariborz Jahanian 2010-01-12 17:31:23 +00:00
parent c119dd50c2
commit 12e2e86f0f
1 changed files with 3 additions and 2 deletions

View File

@ -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.