diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2015-01-23 21:58:46 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2015-01-23 21:58:46 +0000 |
commit | 8e7cb7bdf2f00287e30e6520af256095a294274f (patch) | |
tree | 73b95dea6c617a03e51124c9d168f29d15a44aa3 /lib/ARCMigrate/ObjCMT.cpp | |
parent | dbd59c516ce77b47a8aff1a24c3939e63fe99110 (diff) |
Objective-C moderinzer [qoi], add space on rhs when needed when
converting to property-dot syntax for setters.
rdar://19381786
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226944 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate/ObjCMT.cpp')
-rw-r--r-- | lib/ARCMigrate/ObjCMT.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 48a4931c20..59feea11e1 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -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 '[' ']' |