Commit Graph

3253 Commits

Author SHA1 Message Date
Karoy Lorentey
d54e56bf1d Merge pull request #40006 from lorentey/deninenineninenine-codable-additions 2021-11-03 22:05:42 -07:00
Karoy Lorentey
5f65686cfc [test] Replace some more 9999 availabilities with SwiftStdlib 5.6 2021-11-02 20:43:35 -07:00
Kuba (Brecka) Mracek
367b4c1355 Enable -experimental-hermetic-seal-at-link for the stdlib on 'freestanding' (#39961) 2021-11-02 10:05:33 -07:00
Karoy Lorentey
e2cfab4f28 [stdlib][test] Adopt availability macros in tests 2021-10-31 15:00:58 -07:00
Karoy Lorentey
8e154a415a Merge pull request #39962 from lorentey/concurrency-availability
[stdlib] Introduce availability macros
2021-10-31 14:23:57 -07:00
Morten Bek Ditlevsen
0251957ae3 [SE-0320] Added protocol CodingKeyRepresentable (#34458) 2021-10-30 11:33:42 +01:00
Michael Gottesman
3a5049fa15 [stdlib] Mark _move as public.
Just a thinko on my part.
2021-10-29 15:37:46 -07:00
Michael Gottesman
f9122a79b7 [moveOnly] Implement a new _copy function that performs an explicit copy value.
The key thing is that the move checker will not consider the explicit copy value
to be a copy_value that can be rewritten, ensuring that any uses of the result
of the explicit copy_value (consuming or other wise) are not checked.

Similar to the _move operator I recently introduced, this is a transparent
function so we can perform one level of specialization and thus at least be
generic over all concrete types.
2021-10-29 15:37:46 -07:00
Karoy Lorentey
47956908b7 [Concurrency] SwiftStdlib 5.5 ⟹ SwiftStdlib 5.1 (usages)
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.

Adjust macro usages accordingly.
2021-10-28 14:36:36 -07:00
Erik Eckstein
bec687db1b ConstantFolding: remove a wrong peephole optimization for signed "< 0" and ">= 0" comparisons
The wrong optimization was: fold x < 0 into false, if x is known to be a result of an unsigned operation with overflow checks enabled.
It was done under the wrong assumption that the result of an overflow-checked unsigned operation fits into a signed integer and is positive.
This is wrong, because the result of an unsigned operation can be larger than Int.max and therefore, when used in a signed integer operation, be re-interpreted as a negative signed value.

Fixes a miscompile which resulted in a missing abort on arithmetic overflow.

rdar://73596890
2021-10-27 14:20:19 +02:00
Jonathan Grynspan
687cee9bfa Merge pull request #37666 from grynspan/jgrynspan/temporary-buffers
[SE-0322] Temporary uninitialized buffers
2021-10-25 15:53:50 -04:00
Xiaodi Wu
fa4d08ab9f Fix _customContainsEquatableElement implementation for Stride* types (#39903)
* Fix `_customContainsEquatableElement` implementation for `Stride*` types

* Add tests for `Stride*.contains`
2021-10-25 14:07:01 -04:00
Jonathan Grynspan
f1bf7badba [SE-0322] Temporary uninitialized buffers
Adds two new IRGen-level builtins (one for allocating, the other for deallocating), a stdlib shim function for enhanced stack-promotion heuristics, and the proposed public stdlib functions.
2021-10-25 11:20:10 -04:00
Kuba (Brecka) Mracek
b413a0f4dd Add Builtin.ifdef_<FLAGNAME> as a facility to peek at -D flag that client code is building with (#39797) 2021-10-21 15:36:47 -07:00
Kuba (Brecka) Mracek
7538949859 Split out CommandLine enum into a separate static library, allow removing it from stdlib (#39591)
This is for the 'freestanding' build to stop assuming the platform has argc/argv.

- Introduce a new sub-library, libswiftCommandLineSupport.a
- Move stubs/CommandLine.cpp into this library
- Conditionally embed it into libswiftCore
- Conditionally embed it into libswiftPrivateLibcExtras if not in libswiftCore to support testing
- Add SWIFT_STDLIB_HAS_COMMANDLINE CMake (and build-script) flag
2021-10-13 07:02:43 -07:00
Evan Wilde
ab9467eba2 Filter std::function call symbol
The `std::function` symbol is showing up on centos 7. It should be okay.
2021-10-11 12:09:21 -07:00
Mishal Shah
c2fd49cebb Merge pull request #39473 from apple/rebranch
Update swift:main to support llvm-project:stable/20210726 changes (Rebranch merge)
2021-10-11 09:00:51 -07:00
Saleem Abdulrasool
0fed832b13 Update symbol-visibility-linux.test-sh
Ignore an additional symbol in swiftRemoteMirror.  This was ignored in swiftCore previously, update the list for SwiftRemoteMirror as well.
2021-10-08 21:15:48 -07:00
Pavel Yaskevich
1c0a306c75 Merge pull request #37956 from xedin/implicit-swift-to-c-ptr-conversions
[TypeChecker] Implement limited set of conversions between Swift and C pointers
2021-10-06 14:35:22 -07:00
swift-ci
3f8fea8508 Merge remote-tracking branch 'origin/main' into rebranch 2021-10-06 10:17:29 -07:00
Guillaume Lessard
c2a79393d3 Merge pull request #39553 from glessard/rdar82125382 2021-10-02 10:24:30 -06:00
Kuba (Brecka) Mracek
124b5cc19f Merge pull request #39401 from kubamracek/enforce-undefined-symbols
Ensure that we only depend on a small expected set of external symbols in the freestanding stdlib
2021-10-01 16:43:32 -07:00
Guillaume Lessard
54c7f711ba [test] apply the correct availability check
- these tests check for a fix that was released in Swift 5.2
2021-10-01 17:37:54 -06:00
Kuba Mracek
89c6d4530d Ensure that we only depend on a small expected set of external symbols in the freestanding stdlib 2021-10-01 07:54:30 -07:00
swift-ci
c51550f30e Merge remote-tracking branch 'origin/main' into rebranch 2021-09-30 15:11:41 -07:00
Alejandro Alonso
014e822cb2 Address Michael's comments
fix infinite recursion bug

NFC: Remove early ccc check

remember that false is turned on
2021-09-29 14:20:22 -07:00
Max Desiatov
04b47d7bdc test: mark a few tests as unsupported on Wasm/WASI (#39504)
Certain traps can't be supported on WASI, such as expectations for crashes, `setjmp` use, dynamic linking, multi-threading etc. These tests are marked as `UNSUPPORTED` when targeting Wasm/WASI.
2021-09-29 16:25:38 +01:00
Saleem Abdulrasool
118b47c19b Update symbol-visibility-linux.test-sh
Ignore `_M_realloc_insert` from the C++ standard library which is over-exported in libstdc++.
2021-09-28 10:51:30 -07:00
swift-ci
3b702bf6e4 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-24 11:54:10 -07:00
Ben Langmuir
8ee2ce6f08 [test] Restrict test/stdlib/ArrayBuffer_CopyContents.swift to newer runtimes
This test is crashing on older runtimes, so disable it until someone can
investigate and decide what if anything should be done about it.
2021-09-24 11:49:12 -07:00
Pavel Yaskevich
a9fdb7ad66 [CSSimplify] Detect and diagnose Swift -> C pointer conversion failures
Detect and diagnose situations when Swift -> C pointer conversion
is unsupported due to method not being imported from C header.
2021-09-20 17:22:26 -07:00
swift-ci
2cd3b7ba9b Merge remote-tracking branch 'origin/main' into rebranch 2021-09-17 11:24:13 -07:00
Kuba (Brecka) Mracek
6766824d51 Add a SWIFT_STDLIB_HAS_STDIN flag to compile out the Swift.readLine() API from the stdlib (for the 'freestanding' preset) (#39332) 2021-09-17 10:42:14 -07:00
swift-ci
e48d09cd04 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-17 00:53:19 -07:00
Karoy Lorentey
8e5ccec2c7 Merge pull request #39155 from lorentey/RawRepresentable-hashing-fix
[stdlib] Allow RawRepresentable types to customize their hashing without implementing hashValue
2021-09-17 00:50:10 -07:00
Karoy Lorentey
d8427a65e9 [test] Cover changes in RawRepresentable's default hashing behavior 2021-09-16 17:46:10 -07:00
swift-ci
82fd44ccfa Merge remote-tracking branch 'origin/main' into rebranch 2021-09-15 21:53:33 -07:00
Karoy Lorentey
88e0a87357 Merge pull request #39327 from lorentey/add-missing-availability-check
[test] ArrayBridge: Add missing availability checks
2021-09-15 21:37:08 -07:00
swift-ci
b5ac11a2ab Merge remote-tracking branch 'origin/main' into rebranch 2021-09-15 17:33:26 -07:00
Karoy Lorentey
9b91b88a78 [test] ArrayBridge: Add missing availability checks
Welp, the bogus precondition that was fixed in https://github.com/apple/swift/pull/37960 indeed doesn't entirely deploy back to previous OSes.

This makes sense -- bridging is generally not specialized.

rdar://82125353
2021-09-15 14:39:01 -07:00
Nate Chandler
b4291916f2 Merge branch 'main' into rebranch
Conflicts:
        include/swift/SIL/SILBuilder.h
2021-09-15 13:30:12 -07:00
Becca Royal-Gordon
e16cf3085f Override -triple on fallback to arm64e interface
When we fall back to loading an arm64e module interface during an arm64 build, we want to compile it for the arm64 target so that it is fully compatible with the module that will load it, even though the flags in the file specify the arm64e target. Rewrite the sub-invocation's TargetTriple property in this specific situation. If the two targets differ by more than just the sub-architecture, we will continue to respect the -target flag in the file.

Fixes <rdar://83056545>.
2021-09-15 12:36:17 -07:00
Evan Wilde
ddf210b449 Disabling arm64e testing in two tests
I wasn't aware that arm64e was a thing in open-source, but these two
tests are failing on Apple Silicon both on the main branch and on the
rebranch branch, so I'm disabling it for now.

The failing tests are:
 - ModuleInterface/arm64e-fallback.swift
 - stdlib/Reflection_objc.swift
2021-09-13 13:30:50 -07:00
swift-ci
debf283623 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-12 19:13:28 -07:00
Kuba (Brecka) Mracek
8b189d99e4 Turn off SWIFT_ENABLE_REFLECTION on the stdlib_minimal preset (#39030) 2021-09-12 18:54:53 -07:00
swift-ci
ebfc6e6af1 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-09 10:33:59 -07:00
Erik Eckstein
1c8b369afc tests: exclude two C++ symbols from the weak-symbol test
rdar://82652598
2021-09-09 11:47:08 +02:00
swift-ci
8f1a938d3b Merge remote-tracking branch 'origin/main' into rebranch 2021-08-31 11:53:16 -07:00
David Smith
1389dce956 Merge pull request #39105 from Catfish-Man/uninitialized-invalid-2
Keep the buffer in the invalid UTF8 handling path of String(unsafeUninitializedCapacity:initializingWith:) alive while we're using it
2021-08-31 11:49:56 -07:00
David Smith
3f716e3e0f Tests for invalid UTF8 handling 2021-08-31 09:14:49 -07:00