[PATCH] Add ObjCBoxable handling to ObjCMigrator

AlexDenisov via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 5 07:58:39 PST 2015


Extend ObjCMigrator to cover automatic migration from message sending to boxable literals, e.g.:

```before
typedef struct __attribute__((objc_boxable)) CGRect CGRect;
/// ...
CGRect rect;
[NSValue valueWithBytes:&rect objCType:@encode(CGRect)];
[NSValue valueWithCGPoint:functionReturningCGPoint()];
```

```after
typedef struct __attribute__((objc_boxable)) CGRect CGRect;
/// ...
CGRect rect;
@(rect);
@(functionReturningCGPoint());
```

I will appreciate any ideas how to improve it since the implementation is far from beautiful.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: objc_migrator_objc_boxable.patch
Type: application/octet-stream
Size: 18635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151205/058544f3/attachment-0001.obj>
-------------- next part --------------

--
AlexDenisov
Software Engineer, http://lowlevelbits.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151205/058544f3/attachment-0001.sig>


More information about the cfe-commits mailing list