[PATCH][ObjC] Cleanup ObjCInterfaceDecl lookup for ObjC literals

AlexDenisov 1101.debian at gmail.com
Sun Jul 12 12:53:27 PDT 2015


ObjC literals (NSDictionary, NSArray, Boxed Expressions) use the same
code to instantiate ObjCInterfaceDecl of corresponding classes.

The patch extracts duplicated code into one method and unifies
validation of the ObjCInterfaceDecl’s.

Also, diagnostic for NSDictionary/NSArray was changed a bit.
Before:

@class NSDictionary;
// …
id dictionary = @{}; // expected-error {{declaration of 'dictionaryWithObjects:forKeys:count:' is missing in NSDictionary class}}

After:

@class NSDictionary; // expected-note {{forward declaration of class here}}
// …
id dictionary = @{}; // expected-error {{NSDictionary must be available to use Objective-C dictionary literals}}

Implementation ‘before’ is correct, but it’s not that precise and might be confusing.
--
AlexDenisov
Software Engineer,
http://lowlevelbits.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lookup_objc_literal_interface_decl.patch
Type: application/octet-stream
Size: 16527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150712/cbbbef2d/attachment.obj>
-------------- 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/20150712/cbbbef2d/attachment.sig>


More information about the cfe-commits mailing list