[cfe-commits] r157227 - in /cfe/trunk: lib/Edit/RewriteObjCFoundationAPI.cpp test/ARCMT/objcmt-subscripting-literals.m test/ARCMT/objcmt-subscripting-literals.m.result
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon May 21 17:47:53 PDT 2012
Author: akirtzidis
Date: Mon May 21 19:47:53 2012
New Revision: 157227
URL: http://llvm.org/viewvc/llvm-project?rev=157227&view=rev
Log:
[objcmt] Don't add redundant parentheses when migrating subscripting of an ivar.
rdar://11501256
Modified:
cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp
cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m
cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m.result
Modified: cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp?rev=157227&r1=157226&r2=157227&view=diff
==============================================================================
--- cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp (original)
+++ cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp Mon May 21 19:47:53 2012
@@ -624,6 +624,7 @@
isa<ObjCPropertyRefExpr>(Expr) ||
isa<ObjCProtocolExpr>(Expr) ||
isa<MemberExpr>(Expr) ||
+ isa<ObjCIvarRefExpr>(Expr) ||
isa<ParenExpr>(FullExpr) ||
isa<ParenListExpr>(Expr) ||
isa<SizeOfPackExpr>(Expr))
@@ -650,6 +651,7 @@
isa<ObjCPropertyRefExpr>(Expr) ||
isa<ObjCProtocolExpr>(Expr) ||
isa<MemberExpr>(Expr) ||
+ isa<ObjCIvarRefExpr>(Expr) ||
isa<ParenExpr>(FullExpr) ||
isa<ParenListExpr>(Expr) ||
isa<SizeOfPackExpr>(Expr) ||
Modified: cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m?rev=157227&r1=157226&r2=157227&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m Mon May 21 19:47:53 2012
@@ -77,7 +77,9 @@
#define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
#define TWO(x) ((x), (x))
- at interface I
+ at interface I {
+ NSArray *ivarArr;
+}
@end
@implementation I
-(void) foo {
@@ -138,6 +140,7 @@
o = [*parr objectAtIndex:2];
void *hd;
o = [(NSArray*)hd objectAtIndex:2];
+ o = [ivarArr objectAtIndex:2];
}
@end
Modified: cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m.result?rev=157227&r1=157226&r2=157227&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-subscripting-literals.m.result Mon May 21 19:47:53 2012
@@ -77,7 +77,9 @@
#define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
#define TWO(x) ((x), (x))
- at interface I
+ at interface I {
+ NSArray *ivarArr;
+}
@end
@implementation I
-(void) foo {
@@ -138,6 +140,7 @@
o = (*parr)[2];
void *hd;
o = ((NSArray*)hd)[2];
+ o = ivarArr[2];
}
@end
More information about the cfe-commits
mailing list