mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 19:32:35 +00:00
Objective-C moderinzer [qoi], add space on rhs when needed when
converting to property-dot syntax for setters. rdar://19381786 llvm-svn: 226944
This commit is contained in:
parent
e368a62676
commit
f9317f1586
@ -309,6 +309,10 @@ namespace {
|
||||
BegLoc = PP.getLocForEndOfToken(BegLoc);
|
||||
SourceLocation EndLoc = RHS->getLocStart();
|
||||
EndLoc = EndLoc.getLocWithOffset(-1);
|
||||
const char *colon = PP.getSourceManager().getCharacterData(EndLoc);
|
||||
// Add a space after '=' if there is no space between RHS and '='
|
||||
if (colon && colon[0] == ':')
|
||||
PropertyDotString += " ";
|
||||
SourceRange Range(BegLoc, EndLoc);
|
||||
commit.replace(Range, PropertyDotString);
|
||||
// remove '[' ']'
|
||||
|
@ -90,3 +90,24 @@ id testRdar19038838(Rdar19038838 *obj) {
|
||||
}
|
||||
@end
|
||||
|
||||
// rdar://19140114
|
||||
int NSOnState;
|
||||
int ArrNSOnState[4];
|
||||
@interface rdar19140114 : NSObject
|
||||
{
|
||||
rdar19140114* menuItem;
|
||||
}
|
||||
@property int state;
|
||||
@end
|
||||
|
||||
@implementation rdar19140114
|
||||
- (void) Meth {
|
||||
[menuItem setState:NSOnState];
|
||||
[menuItem setState :NSOnState];
|
||||
[menuItem setState :ArrNSOnState[NSOnState]];
|
||||
[menuItem setState : NSOnState];
|
||||
[menuItem setState: NSOnState];
|
||||
[menuItem setState: NSOnState];
|
||||
[menuItem setState : NSOnState];
|
||||
}
|
||||
@end
|
||||
|
@ -90,3 +90,24 @@ id testRdar19038838(Rdar19038838 *obj) {
|
||||
}
|
||||
@end
|
||||
|
||||
// rdar://19140114
|
||||
int NSOnState;
|
||||
int ArrNSOnState[4];
|
||||
@interface rdar19140114 : NSObject
|
||||
{
|
||||
rdar19140114* menuItem;
|
||||
}
|
||||
@property int state;
|
||||
@end
|
||||
|
||||
@implementation rdar19140114
|
||||
- (void) Meth {
|
||||
menuItem.state = NSOnState;
|
||||
menuItem.state = NSOnState;
|
||||
menuItem.state = ArrNSOnState[NSOnState];
|
||||
menuItem.state = NSOnState;
|
||||
menuItem.state = NSOnState;
|
||||
menuItem.state = NSOnState;
|
||||
menuItem.state = NSOnState;
|
||||
}
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user