Commit Graph

13406 Commits

Author SHA1 Message Date
David Zarzycki
12ccc5df2c [Testing] Review feedback 2019-08-27 10:56:23 +01:00
Karoy Lorentey
d5ea371eed [test] Add some high-level tests for AutoreleasingUnsafeMutablePointer 2019-08-26 20:09:53 -07:00
Daniel Rodríguez Troitiño
f77e2835f0 [android] Link against math library for Bionic.
The Bionic modulemap was missing the autolinking information against
libm, so using the module math functions might have hit undefined
symbols (it was happening in TestDecimal in Foundation for me). The line
is present in the Linux glibc.modulemap, but was not there for Android
Bionic modulemap.
2019-08-26 17:32:51 -07:00
Austin Rude
76a649d224 [AppKit] Fix incorrect rawValue for NSEvent.SpecialKey.deleteForward
Update the rawValue to match NSDeleteFunctionKey.
2019-08-26 15:39:09 -06:00
Arnold Schwaighofer
fe69a86929 Revert "Remove stdlib and runtime dependencies on Foundation and CF"
It is causing bots to fail.

* Revert "The __has_include(<os/system_version.h>) branch here wasn't quite right, we'll just use the dlsym one for now"

This reverts commit f824922456.

* Revert "Remove stdlib and runtime dependencies on Foundation and CF"

This reverts commit 3fe46e3f16.

rdar://54709269
2019-08-26 13:00:08 -07:00
David Zarzycki
db0fea4cb4 [Testing] Fix some build warnings 2019-08-26 08:16:06 +01:00
Saleem Abdulrasool
ff05ffb8c9 Platform: remove FP80 operations on android
These were accidentally re-enabled on Android when SE-0246 was reverted.
This causes the android x64 builds to break.
2019-08-25 11:50:22 -07:00
Ravi Kandhadai
8641dc7310 [oslog][stdlib-private] Refactor and generalize implementation of
interpolation of Int types in the new os_log APIs so that it is
easier to extend to other integer types. Based on this, add support
for interpolating Int32 types.
2019-08-24 19:08:55 -07:00
Steve (Numerics) Canon
273616f513 Remove BuiltinMath funcs for Float80/Android
These were previously removed in SE-0246, so they weren't modified when Float80 was removed elsewhere on Android. Reverting SE-0246 on master triggers an Android break.
2019-08-24 21:48:15 -04:00
David Smith
f824922456 The __has_include(<os/system_version.h>) branch here wasn't quite right, we'll just use the dlsym one for now 2019-08-23 23:12:29 -07:00
swift-ci
3256392211 Merge pull request #26630 from Catfish-Man/shim-shim-sher-ee 2019-08-23 17:08:59 -07:00
David Smith
3fe46e3f16 Remove stdlib and runtime dependencies on Foundation and CF 2019-08-23 14:10:23 -07:00
Stephen Canon
d80b1d39a3 Backout SE-0246 (#26809)
* Revert "Add availability information to the new Math function protocols (#24187)"

This reverts commit d2f695935f.

* Revert "SE-0246: Protocols and static functions (#23824)"

This reverts commit 57a4553832.

* Expected abi changes.
2019-08-23 16:41:17 -04:00
Jonas Devlieghere
a325154c32 Merge pull request #26578 from xiaobai/component-targets-done-right
Resubmit "[CMake][NFC] Introduce component targets for proper dependency tracking"
2019-08-22 16:14:37 -07:00
Karoy Lorentey
b8dc0f4735 [stdlib] AutoreleasingMutableUnsafePointer: switch to _unsafeReferenceCast for extra validation 2019-08-22 14:25:19 -07:00
Alex Langford
61be4d969f [CMake][NFC] Introduce component targets for proper dependency tracking
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.

This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.

This is a resubmission (with modifications) of an earlier change. I originally
committed this but there were problems with some installation rules.
2019-08-22 10:16:50 -07:00
Nate Cook
90f9dd480e Merge branch 'master' into nc_lazyscan_fix 2019-08-22 10:47:47 -05:00
Nate Cook
3dcdd451a6 [stdlib] Revisons to lazy prefix documentation. 2019-08-22 10:42:42 -05:00
Karoy Lorentey
88630e8ea3 [stdlib] AutoreleasingUnsafeMutablePointer: use typed pointers rather than UnsafeRawPointer
This improves code generation in -Onone mode. (UnsafeRawPointer.load/.storeBytes isn’t @_transparent and it doesn’t get specialized in unoptimized builds.)
2019-08-21 18:43:57 -07:00
Karoy Lorentey
b9e3ada255 [stdlib] Make Unmanaged.takeUnretainedValue, .takeRetainedValue transparent
This improves codegen in debug builds.
2019-08-21 18:31:28 -07:00
Karoy Lorentey
61c5ac118d [stdlib] AutoreleasingUnsafeMutablePointer: update docs 2019-08-21 18:25:55 -07:00
Alex Martini
f040edaa85 Typo fix: of of -> of
rdar://problem/54218099
2019-08-21 10:40:18 -07:00
Joe Groff
937deb4e49 Merge pull request #26758 from jckarter/compatibility-lib-llvm-abi
Disable LLVM ABI checks in the compatibility libraries
2019-08-21 12:28:23 -04:00
Karoy Lorentey
6a92bb9e2e [stdlib] AutoreleasingUnsafeMutablePointer: eliminate questionable pointer use
AutoreleasingUnsafeMutablePointer is pointing to a +0 reference, but in its pointee property’s getter/setter implementations, it is loading the pointer into regular Unsafe[Mutable]Pointers. Those are assuming that the addressed memory contain a +1 reference, which can mislead the compiler into doing optimizations that aren’t valid.

Change the getter/setter implementations so that they use UnsafeRawPointer and load/store Unmanaged values instead. As long as Unmanaged.passUnretained(_:) and Unmanaged.takeUnretainedValue() do the right thing, then AutoreleasingUnsafeMutablePointer won’t have issues, either. (This boils down to ensuring that loading a strong reference out of an unmanaged(unsafe) value works correctly.)
2019-08-20 20:15:49 -07:00
Saleem Abdulrasool
cc9a567ec7 stdlib: use the destructor CC adjustment thunk
Use the wrapper for the CC adjustment as on Windows x86, the destructor
needs to be `__stdcall`.  This would fail otherwise with the following:

```
D:\a\1\s\swift\stdlib\public\stubs\ThreadLocalStorage.cpp(86,18):  error: no matching function for call to '_stdlib_thread_key_create'
    int result = SWIFT_THREAD_KEY_CREATE(&key, [](void *pointer) {
                 ^~~~~~~~~~~~~~~~~~~~~~~
D:\a\1\s\swift\stdlib\public\stubs/../runtime/ThreadLocalStorage.h(96,35):  note: expanded from macro 'SWIFT_THREAD_KEY_CREATE'
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
D:\a\1\s\swift\include\swift/Basic/Lazy.h(42,27):  note: expanded from macro 'SWIFT_ONCE_F'
  ::std::call_once(TOKEN, FUNC, CONTEXT)
                          ^~~~
D:\a\1\s\swift\stdlib\public\stubs\ThreadLocalStorage.cpp(43,1):  note: candidate function not viable: no known conversion from '(lambda at D:\a\1\s\swift\stdlib\public\stubs\ThreadLocalStorage.cpp:85:3)' to '__swift_thread_key_destructor _Nullable' (aka 'void (*)(void *) __attribute__((stdcall))') for 2nd argument
_stdlib_thread_key_create(__swift_thread_key_t * _Nonnull key,
^

```
2019-08-20 19:11:46 -07:00
Joe Groff
60b21d4cf5 Disable LLVM ABI checks in the compatibility libraries 2019-08-20 18:27:42 -07:00
swift-ci
5f80f77343 Merge pull request #26747 from natecook1000/nate/doc_copymemory_backwards 2019-08-20 12:49:57 -07:00
Nate Cook
15f78fc7af Document that raw copyMemory methods handle overlapping memory. 2019-08-20 13:15:20 -05:00
David Zarzycki
1473e20c15 [Runtime] NFC: Fix -Wgnu-statement-expression warning 2019-08-19 08:10:49 +01:00
swift-ci
af1fa9c1b4 Merge pull request #26651 from gregomni/stdlib-warnings 2019-08-17 08:17:31 -07:00
Mike Ash
51987245f3 [Runtime] Initialize function pointers with the original values, check against those values to call directly.
Instruments relies on the old values being there so it can call the original implementation. This has very slightly worse codegen but the impact should be minimal.
2019-08-16 14:41:12 -04:00
Mike Ash
6295cecfa7 Merge pull request #26638 from mikeash/fix-protocol-conformances-on-unavailable-classes
[Runtime] Fix swift_conformsToProtocol crashing on conformances to unavailable classes.
2019-08-15 19:09:10 -04:00
Greg Titus
dd4c6053a7 Warning fixes for core stdlib. 2019-08-15 10:14:50 -07:00
Mike Ash
ce26e7f3fd [Runtime] Fix protocol conformances on NULL types when back deploying.
Add code to the 5.0 compatibility library that scans for conformances pointing to a NULL type and rewrites them to point to a dummy type that the 5.0 protocol conformance checking code will safely ignore.
2019-08-14 11:07:31 -04:00
pschuh
37c6414e77 Fix usage of uninitialized memory in swift_addNewDSOImage. (#26275)
This should address https://bugs.swift.org/browse/SR-6848.

Couldn't transform the unsafeGet to get because it would produce an
infinite loop.
2019-08-13 13:23:33 -07:00
Mike Ash
6473b9d7cd [Runtime] Fix swift_conformsToProtocol crashing on conformances to unavailable classes.
An extension on a class creates a conformance record that's always visible even when that class is not present at runtime. In that case, the type pointer in the conformance record is NULL. The runtime did not like this, and crashed. This fixes it to ignore such records instead.

rdar://problem/54054895
2019-08-13 14:39:20 -04:00
David Smith
bd3643a1b2 Merge pull request #26588 from Catfish-Man/shadow-backflip
Re-shim tagged NSString creation
2019-08-12 18:01:23 -07:00
David Smith
f559a94f1b Redo CFStringCreateWithBytes shim 2019-08-12 15:15:10 -07:00
Michael Gottesman
bd4953475a [ownership] Compile stdlibCore with ownership stripping after serialization. 2019-08-12 03:32:59 -07:00
Scott Perry
9f90fb1a09 Merge pull request #26575 from numist/numist/application-denied
Return nil on applying() failure instead of crashing
2019-08-10 11:37:00 -07:00
Scott Perry
15904df5d4 Review feedback from @lorentey 2019-08-10 09:30:25 -07:00
Saleem Abdulrasool
f1861c3bee Merge pull request #26479 from alexshap/modify_swift_rt_elf
Add .note.swift_reflection_metadata
2019-08-09 22:29:20 -07:00
Scott Perry
e01e964dd9 Review feedback from @xwu 2019-08-09 12:35:32 -07:00
Doug Gregor
b7e245c234 [Runtime] Mark hash_value inline 2019-08-09 11:54:27 -07:00
Doug Gregor
ae477280b4 [Runtime] Make hash_value function inline. 2019-08-09 11:53:17 -07:00
Doug Gregor
e7cedae5fc [Runtime] Fail in +Asserts builds if the context descriptor cache is wrong. 2019-08-09 11:21:21 -07:00
Mike Ash
4bc794f407 Change the context descriptor cache to be a SmallDenseSet instead of a TinyPtrVector to avoid duplicates. 2019-08-09 11:19:12 -07:00
Mike Ash
a2ed459024 Fix _forEach*SectionAfter to update the start parameter. 2019-08-09 11:19:07 -07:00
Doug Gregor
bf7aad2ac9 Populate context descriptor cache from type metadata sections 2019-08-09 11:19:03 -07:00
Doug Gregor
961842def2 Eliminate deadlock in context descriptor cache 2019-08-09 11:18:50 -07:00