Use the modern spelling for the nullability attributes in the test mock
headers. Currently, this was relying on the predefined macros from
clang to work. However, those are only available on Darwin targets.
This is needed to make the mock environments more portable.
This is a squash of the following commits:
* [SE-0054] Import function pointer arg, return types, typedefs as optional
IUOs are only allowed on function decl arguments and return types, so
don't import typedefs or function pointer args or return types as IUO.
* [SE-0054] Only allow IUOs in function arg and result type.
When validating a TypeRepr, raise a diagnostic if an IUO is found
anywhere other thn the top level or as a function parameter or return
tpye.
* [SE-0054] Disable inference of IUOs by default
When considering a constraint of the form '$T1 is convertible to T!',
generate potential bindings 'T' and 'T?' for $T1, but not 'T!'. This
prevents variables without explicit type information from ending up with
IUO type. It also prevents implicit instantiation of functions and types
with IUO type arguments.
* [SE-0054] Remove the -disable-infer-iuos flag.
* Add nonnull annotations to ObjectiveCTests.h in benchmark suite.
r31634 mistakenly treated all dispatch_block_ts as nonnull, because we've
never had to deal with a mapped typedef that refers to a pointer type.
('SEL' will eventually have the same issue, but for now the Swift
'Selector' type just has nil as an inhabitant.)
rdar://problem/22843921
Swift SVN r32210
We'd rather show dispatch_async as
// new
func dispatch_async(queue: dispatch_queue_t!, block: dispatch_block_t!)
than
// old
func dispatch_async(queue: dispatch_queue_t!, block: (() -> Void)!)
which was only happening because we were trying to hide the @objc_block
annotation when possible. That's not necessary when we have a typealias.
<rdar://problem/16679280>
Swift SVN r17273