diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-16 23:54:48 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-16 23:54:48 +0000 |
commit | a44b97004298a4eb7c270009ea4cb12aad49c543 (patch) | |
tree | 92e67c31b5a90cdf30d6644414185ed85543e5a4 /include/clang/Edit | |
parent | 4d8a33b4cea46948f86afccf0ad3675aff924148 (diff) |
[objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a dictionary literal
if we can see the elements of the arrays.
for example:
NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]];
-->
NSDictionary *dict = @{ @"A" : @"1", @"B" : @"2" };
rdar://12428166
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172679 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Edit')
-rw-r--r-- | include/clang/Edit/Rewriters.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/clang/Edit/Rewriters.h b/include/clang/Edit/Rewriters.h index aa7a5b2320..292878e756 100644 --- a/include/clang/Edit/Rewriters.h +++ b/include/clang/Edit/Rewriters.h @@ -13,6 +13,7 @@ namespace clang { class ObjCMessageExpr; class NSAPI; + class ParentMap; namespace edit { class Commit; @@ -21,7 +22,8 @@ bool rewriteObjCRedundantCallWithLiteral(const ObjCMessageExpr *Msg, const NSAPI &NS, Commit &commit); bool rewriteToObjCLiteralSyntax(const ObjCMessageExpr *Msg, - const NSAPI &NS, Commit &commit); + const NSAPI &NS, Commit &commit, + const ParentMap *PMap); bool rewriteToObjCSubscriptSyntax(const ObjCMessageExpr *Msg, const NSAPI &NS, Commit &commit); |