Commit Graph

15 Commits

Author SHA1 Message Date
Michael Ilseman
3d04fb5eac [shims] Move bit masks to SwiftShims and include/swift/ABI.
Move bits mask from Metadata.h to SwiftShims's HeapObject.h. This
exposes the bit masks to the stdlib, so that the stdlib doesn't have
to have its own magic numbers per-platform. This also enhances
readability for BridgeObject, whose magic numbers are mostly derived
from Swift's ABI.
2017-10-05 16:31:43 -07:00
Max Moiseev
52522f118c [overlay] Implement UIFocusEnvironment.contains using a shim
Addresses: <rdar://problem/32538412>
2017-06-20 17:14:24 -07:00
Joe Groff
f45abc0122 KeyPaths: Move layout constants to a shims header for sharing with compiler/runtime. 2017-04-04 11:31:15 -07:00
Philippe Hausler
dc783c064c [Foundation] Remove @_silgen thunks and replace them with shims instead
This avoids indirection by making calls directly to the C implementations which prevents potentials of mismatched intent or changes of calling convention of @_silgen. The added benefit is that all of the shims in this case are no longer visible symbols (anyone using them was not authorized out side of the Foundation overlay). Also the callout methods in the headers now all share similar naming shcemes for easier refactoring and searching in the style of __NS<class><action> style. The previous compiled C/Objective-C source files were built with MRR the new headers MUST be ARC by Swift import rules.

The one caveat is that certain functions MUST avoid the bridge case (since they are part of the bridging code-paths and that would incur a recursive potential) which have the types erased up to NSObject * via the macro NS_NON_BRIDGED.

The remaining @_silgen declarations are either swift functions exposed externally to the rest of Swift’s runtime or are included in NSNumber.gyb which the Foundation team has other plans for removing those @_silgen functions at a later date and Data.swift has one external function left with @_silgen which is blocked by a bug in the compiler which seems to improperly import that particular method as an inline c function.
2017-03-06 09:59:37 -08:00
Jordan Rose
7d61a5e6a2 [SDK] Use an extra shims header to remove _silgen_name from Dispatch.
We still have a bunch of redeclarations of Dispatch functions to avoid
the automatic bridging of dispatch_data_t and dispatch_block_t, but
mostly this is a vast reduction in complexity (and increase in safety).
2016-12-01 16:06:15 -08:00
Jordan Rose
c0304aef84 [SDK] Fix circularity issues with overlay shim headers.
Loading a Clang module eagerly brings in overlays for anything it re-exports,
but this is a problem for these new "shim header" modules, which generally
import the underlying module for an overlay and are in turn imported by the
overlay. That means that when we try to import an overlay, we'll end up with
a circular reference before it's done loading all its dependencies. Break the
cycle by not exporting anything from these modules, which are mostly just an
implementation detail anyway.
2016-10-15 14:59:29 -07:00
Jordan Rose
1589ca1b8d [SDK] Use an extra shims header to remove _silgen_name from the XPC overlay. 2016-10-15 14:59:29 -07:00
Jordan Rose
26e24f7bee [SDK] Use an extra shim header to remove _silgen_name from SafariServices. 2016-10-15 14:59:28 -07:00
Jordan Rose
cb59b94135 [SDK] Use an extra shim header to eliminate _silgen_name from ObjectiveC. 2016-10-15 14:59:28 -07:00
Jordan Rose
244cf50c0c [SDK] Use an extra shims header to remove _silgen_name from the os overlay. 2016-10-15 14:59:27 -07:00
Jordan Rose
2e560b0319 [SDK] Use an extra shim header to remove _silgen_name from XCTest. 2016-10-15 14:59:27 -07:00
Dmitri Gribenko
e8e8b35610 stdlib: use SipHash-1-3 for string hashing on non-ObjC platforms
Part of rdar://problem/24109692
2016-09-06 20:41:03 -07:00
Dmitri Gribenko
e4aaba9ba6 stdlib: declare functions for assertion reporting in SwiftShims instead of using @_silgen_name 2016-09-05 22:47:24 -07:00
Matt Wright
8ac413a0b5 [libdispatch] Post-beta API changes and bug fixes
* Fix DispatchSourceSignal initialisation such that it no longer
    registers for the wrong source type.

    * Remove (group:) option from DispatchWorkItem, introduce group
    options to `.async` methods that accept DispatchWorkItem.

    * Rename `DispatchSourceType` to `DispatchSourceProtocol`

    * Rework DispatchQueue attributes and flags into a less confusing
    approach.

    * Fixes:

	SR-1817, SR-1771, SR-1770, SR-1769

	<rdar://problem/26725156> <rdar://problem/26873917>
	<rdar://problem/26918843> <rdar://problem/26810149>
	<rdar://problem/27117023> <rdar://problem/27121422>
	<rdar://problem/27236887> <rdar://problem/27337555>
2016-07-18 13:22:23 -07:00
Robert Widmann
567ea9a297 Rename map to modulemap 2016-07-15 16:07:28 -07:00