manmanren created this revision. manmanren added a reviewer: rjmccall. manmanren added a subscriber: cfe-commits.
Before this fix, both the start and the end point to the same location, and we will add the FixIt before the type name: ^(NSView view) to ^(*NSView view) After this commit, fixit will change it to ^(NSView *view). http://reviews.llvm.org/D20844 Files: lib/Parse/ParseDecl.cpp test/FixIt/fixit-interface-as-param.m Index: test/FixIt/fixit-interface-as-param.m =================================================================== --- test/FixIt/fixit-interface-as-param.m +++ test/FixIt/fixit-interface-as-param.m @@ -5,7 +5,16 @@ @interface INTF - (void) drawRect : inView:(NSView)view; +- (void)test:(NSView )a; +- (void)foo; @end // CHECK: {7:35-7:35}:"*" - +// CHECK: {8:22-8:22}:"*" +@implementation INTF +-(void)foo { + ^(NSView view) { + }; +} +@end +// CHECK: {16:12-16:12}:"*" Index: lib/Parse/ParseDecl.cpp =================================================================== --- lib/Parse/ParseDecl.cpp +++ lib/Parse/ParseDecl.cpp @@ -2935,8 +2935,8 @@ if (isInvalid) break; - DS.SetRangeEnd(Tok.getAnnotationEndLoc()); ConsumeToken(); // The typename + DS.SetRangeEnd(Tok.getLocation()); continue; }
Index: test/FixIt/fixit-interface-as-param.m =================================================================== --- test/FixIt/fixit-interface-as-param.m +++ test/FixIt/fixit-interface-as-param.m @@ -5,7 +5,16 @@ @interface INTF - (void) drawRect : inView:(NSView)view; +- (void)test:(NSView )a; +- (void)foo; @end // CHECK: {7:35-7:35}:"*" - +// CHECK: {8:22-8:22}:"*" +@implementation INTF +-(void)foo { + ^(NSView view) { + }; +} +@end +// CHECK: {16:12-16:12}:"*" Index: lib/Parse/ParseDecl.cpp =================================================================== --- lib/Parse/ParseDecl.cpp +++ lib/Parse/ParseDecl.cpp @@ -2935,8 +2935,8 @@ if (isInvalid) break; - DS.SetRangeEnd(Tok.getAnnotationEndLoc()); ConsumeToken(); // The typename + DS.SetRangeEnd(Tok.getLocation()); continue; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits