Commit Graph

110 Commits

Author SHA1 Message Date
Jordan Rose
12964f2e27 [ClangImporter] Resolve generated header protocols to native decls as well.
This is the same as the previous commit, but for protocols. To do this I
had to modify the ObjC printer to include a SWIFT_PROTOCOL annotation like
the SWIFT_CLASS annotation already in use. This is probably a good thing
anyway.

Second half of <rdar://problem/16296027>

Swift SVN r14985
2014-03-13 00:19:12 +00:00
Jordan Rose
480c1bac08 [PrintAsObjC] Push the prologue back into the generated headers.
This means more duplication, but it's also more future-proof: the set of
features used is based on the compiler that generates the header, not the
compiler that eventually consumes the header. To allow for forward-
compatibility, all the macros used by the header can be overridden by the
consuming environment, and the header <swift/objc-prologue.h> will be
included if it exists.

Swift SVN r14893
2014-03-10 23:47:22 +00:00
Chris Lattner
d758e0dfe3 Eliminate more "DynamicLookup" in favor of "AnyObject", this is the
bulk of finishing rdar://13327098.


Swift SVN r14653
2014-03-04 22:15:46 +00:00
Doug Gregor
25c5692fe6 PrintAsObjC: Swift subobject initializers are ObjC designated initializers.
Swift SVN r14610
2014-03-03 21:38:28 +00:00
Jordan Rose
4e72db0a94 [PrintAsObjC] Only @import frameworks that are used by the header.
Anything used only in an implementation should be omitted.

<rdar://problem/16140047>

Swift SVN r14485
2014-02-27 23:32:58 +00:00
Jordan Rose
b9cd3c1163 [Sema] Allow Optional and UncheckedOptional in @objc methods and properties.
...when the optional object type is a class or Objective-C protocol type.
This is currently hidden behind -enable-objc-optional because I didn't test
if the generated code is actually correct.

Also add PrintAsObjC support for these.

Known missing pieces: blocks, and Swift structs bridged to Objective-C classes
(right now, just String).

Swift SVN r14416
2014-02-26 22:15:55 +00:00
Jordan Rose
ffd104e3b0 [PrintAsObjC] Add objc_complete_definition attribute to generated @interfaces.
This is using the compatibility macro SWIFT_CLASS, so older Clangs can still
parse a generated header on its own. This will only be interesting in a
mixed-source target, where we may need to merge a forward declaration with
a Swift-generated @interface. (See <rdar://problem/16076729>.)

Swift SVN r14411
2014-02-26 22:15:48 +00:00
Jordan Rose
02892a0412 [PrintAsObjC] Handle UInt by printing it as NSUInteger.
This is a bit ironic considering we're importing NSUInteger as Int rather
than UInt, but Swift should never be using the headers it prints anyway.

Swift SVN r14088
2014-02-19 18:29:42 +00:00
Jordan Rose
7995dde448 Module::getImportedModules can now get public, private, or all imports.
...whereas before the only options were "public" and "all".

No functionality change.

Swift SVN r13849
2014-02-12 23:57:43 +00:00
Jordan Rose
95461797aa Move -print-as-objc feature into a library.
No functionality change.

Swift SVN r13798
2014-02-12 01:19:09 +00:00