mac: Add a script that can rewrite Obj-C files to use "modern" features.
See the top of the script for usage instructions. I tried a few different set of options. All: https://chromium-review.googlesource.com/c/chromium/src/+/888764 Proposed + properties: https://chromium-review.googlesource.com/c/chromium/src/+/888966 Proposed: https://chromium-review.googlesource.com/c/chromium/src/+/889359 The script currently replaces (id) with (instancetype) where appropriate, tries to infer NS_DESIGNATED_INITIALIZER and NS_RETURNS_INNER_POINTER, replaces objectAtIndex: and objectForKey: for arrays and dicts with subscripting syntax, and uses Objective-C literals where possible. The clang Obj-C rewriter can't add generic parameters to Obj-C containers, so that isn't done. It also can't move instance variables from @interface to @implementation. Bug: 324079 Change-Id: I3e095e6f7c6b2cbdc0c6d37b0c043044638ab2ba Reviewed-on: https://chromium-review.googlesource.com/888981Reviewed-by:Sidney San Martín <sdy@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#532120}
Showing
Please register or sign in to comment