summaryrefslogtreecommitdiffstats
path: root/lib/ARCMigrate/ObjCMT.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2015-01-23 21:58:46 +0000
committerFariborz Jahanian <fjahanian@apple.com>2015-01-23 21:58:46 +0000
commit8e7cb7bdf2f00287e30e6520af256095a294274f (patch)
tree73b95dea6c617a03e51124c9d168f29d15a44aa3 /lib/ARCMigrate/ObjCMT.cpp
parentdbd59c516ce77b47a8aff1a24c3939e63fe99110 (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.cpp4
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 '[' ']'