diff options
Diffstat (limited to 'clang/lib/Edit/RewriteObjCFoundationAPI.cpp')
-rw-r--r-- | clang/lib/Edit/RewriteObjCFoundationAPI.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp index 30a9f522b2f..68dcd6b7c60 100644 --- a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp +++ b/clang/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. |