diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-07-18 20:11:45 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-07-18 20:11:45 +0000 |
commit | bbbb0fe4f466d3163fcbf0a64ebf0f5868833efb (patch) | |
tree | cdacf09ed58fbb8723d1ba513316b2dea0339805 /lib/Edit | |
parent | 87f2cb5aec7b81ea6f6f9fbf6e14ef4f2de6dea6 (diff) |
ObjectiveC migration. migration to NS_ENUM/SN_OPTION
- wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Edit')
-rw-r--r-- | lib/Edit/RewriteObjCFoundationAPI.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Edit/RewriteObjCFoundationAPI.cpp b/lib/Edit/RewriteObjCFoundationAPI.cpp index 30a9f522b2..68dcd6b7c6 100644 --- a/lib/Edit/RewriteObjCFoundationAPI.cpp +++ b/lib/Edit/RewriteObjCFoundationAPI.cpp @@ -434,6 +434,19 @@ bool edit::rewriteToObjCInterfaceDecl(const ObjCInterfaceDecl *IDecl, return true; } +bool edit::rewriteToNSEnumDecl(const EnumDecl *EnumDcl, + const TypedefDecl *TypedefDcl, + const NSAPI &NS, Commit &commit) { + std::string ClassString = "typedef NS_ENUM(NSInteger, "; + ClassString += TypedefDcl->getIdentifier()->getName(); + ClassString += ')'; + SourceRange R(EnumDcl->getLocStart(), EnumDcl->getLocStart()); + commit.replace(R, ClassString); + commit.remove(SourceRange(TypedefDcl->getLocStart(), TypedefDcl->getLocEnd())); + return true; + +} + /// \brief Returns true if the immediate message arguments of \c Msg should not /// be rewritten because it will interfere with the rewrite of the parent /// message expression. e.g. |