Commit Graph

3245 Commits

Author SHA1 Message Date
Vedant Kumar
5049db0dd9 [DebuggerSupport] Attempt expanding objects with .class display style
When pretty-printing objects, attempt to expand & print objects which
have the `.class` display style even if they do not have any instance
variables. The pretty-printer will still bail out if the object does not
conform to CustomReflectable.

This is enough to teach the pretty-printer to format bridged NSStrings.

rdar://36843869
2018-01-29 15:31:53 -08:00
Mike Ash
5e2b11d42d Merge pull request #14157 from mikeash/conditionally-disable-runtimefunctioncounters
[Runtime] Remove RuntimeFunctionCounters in no-assert builds.
2018-01-29 15:48:32 -05:00
Xiaodi Wu
cc0e64dec4 Implement efficient DoubleWidth division and fix division-related bugs 2018-01-28 14:01:06 -06:00
Mike Ash
6f37cca3e0 [Runtime] Disable RuntimeFunctionCounters tests if the counters are disabled.
Also update how the variable is managed in the build system to allow the test to be conditional based on it, and make it more natural to set it on the command line.
2018-01-26 15:35:33 -05:00
Mishal Shah
fdbf76e9f5 Update master to build with Xcode 9.3 beta 1 2018-01-25 16:03:11 -08:00
Rintaro Ishizaki
62bb17c964 [test] Eliminate warnings in Parameterpassing.swift tests (#14081) 2018-01-23 19:16:27 +09:00
Max Moiseev
b1e37b9b0c Merge pull request #14035 from moiseev/compact-message
[stdlib] Improve the flatMap deprecation message
2018-01-22 10:29:46 -08:00
Arnold Schwaighofer
d471f2a288 Merge pull request #13825 from aschwaighofer/mark_some_executable_tests_as_such
check-swift-only_executable: Mark executable tests as such
2018-01-22 07:45:46 -08:00
Karoy Lorentey
90e894729a [StringGuts] Linux support
Add support for compiling StringGuts without the Objective-C runtime.
2018-01-21 12:37:36 -08:00
Karoy Lorentey
f2a96496a0 [StringGuts] Support for 32-bit platforms
Add 32-bit support to the new StringGuts.
2018-01-21 12:36:09 -08:00
Karoy Lorentey
5cf9fd7414 Remove _StringBuffer 🎉🎉🎉 2018-01-21 12:35:15 -08:00
Karoy Lorentey
b360bd6d69 Remove _LegacyStringCore 🎉🎉🎉 2018-01-21 12:35:15 -08:00
Michael Ilseman
3be2faf5d3 [String] Initial implementation of 64-bit StringGuts.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
2018-01-21 12:32:26 -08:00
Michael Ilseman
75463e30f3 [stdlib] Rename _StringCore to _LegacyStringCore. NFC.
In grand LLVM tradition, the first step to redesigning _StringCore is
to first rename it to _LegacyStringCore. Subsequent commits will
introduce the replacement, and eventually all uses of the old one will
be moved to the new one.

NFC.
2018-01-21 12:28:56 -08:00
Max Moiseev
a4aea08bce Merge pull request #13892 from xwu/better-homes-and-logarithms
[stdlib] Improve _binaryLogarithm implementation and add tests [NFCI]
2018-01-19 16:18:07 -08:00
Max Moiseev
aceb63e058 [stdlib] Improve the flatMap deprecation message
<rdar://problem/36555646>
2018-01-19 15:29:46 -08:00
Arnold Schwaighofer
de66079e18 Mark some executable_tests as such 2018-01-19 12:58:41 -08:00
Max Moiseev
556f5cfa43 Add tests for map-map and filter-filter folds 2018-01-18 19:23:14 -08:00
Xiaodi Wu
7e03829aab Improve _binaryLogarithm implementation and add tests 2018-01-18 16:45:41 -06:00
Itai Ferber
1e110b8f63 Restore decoder state after throwing on decode
Resolve SR-6408 by restoring the JSON/PlistDecoder stack if an error
is thrown after a container was pushed during encode.
2018-01-11 12:20:01 -08:00
Itai Ferber
57e356b1c4 Restore encoder state after throwing on encode
Resolve SR-6078 by restoring the JSON/PlistEncoder stack if an error
is thrown after a container was pushed during encode.
2018-01-11 12:20:01 -08:00
Jordan Rose
59b5e2ec0d Mangle an anonymous C enum using its enclosing typedef, like C++ does
Without this, we would fall back to a Swift name even for C types that
we can expect to have stable names for linkage purposes.
2018-01-10 15:38:07 -08:00
Jordan Rose
38e2cfe1e2 Mangle imported declarations using their C names.
This makes them consistent no matter what shenanigans are pulled by
the importer, particularly NS_ENUM vs. NS_OPTIONS and NS_SWIFT_NAME.

The 'NSErrorDomain' API note /nearly/ works with this, but the
synthesized error struct is still mangled as a Swift declaration,
which means it's not rename-stable. See follow-up commits.

The main place where this still falls down is NS_STRING_ENUM: when
this is applied, a typedef is imported as a unique struct, but without
it it's just a typealias for the underlying type. There's also still a
problem with synthesized conformances, which have a module mangled
into the witness table symbol even though that symbol is linkonce_odr.

rdar://problem/31616162
2018-01-09 17:55:24 -08:00
Jordan Rose
18689fe223 [Mangling] Uniformly use "So" for imported decls.
...and repurpose "SC" for (C)lang-importer-synthesized decls, instead
of just decls that are C-like instead of ObjC-like. (See next commits.)
2018-01-09 17:55:23 -08:00
Greg Parker
9637b4a6e1 [runtime] Rename class SwiftObject to Swift._SwiftObject. (#13748)
SwiftObject needs to be renamed to avoid ObjC class name collisions between
the Swift stable ABI and older Swift apps.

rdar://35554345
2018-01-09 16:16:55 -08:00
Max Moiseev
0fa300bae2 Add a test case from SR-6634 2018-01-09 09:33:46 -08:00
Max Moiseev
3dbbd07d72 Merge pull request #13782 from xwu/generic-conversions
[stdlib] [SE-0067] Implement generic conversions to floating point
2018-01-08 11:14:53 -08:00
Max Moiseev
6513571487 Merge pull request #13653 from xwu/patch-3
[stdlib] Fix bug in String(_:radix:uppercase:)
2018-01-08 11:11:58 -08:00
Slava Pestov
4af7b84170 Runtime: Fix memory leak in swift_EnumCaseName()
If the value was wrapped in an existential buffer, we would never
release the original value even though it was passed in at +1.

Fixes <rdar://problem/36153982>, <https://bugs.swift.org/browse/SR-6536>.
2018-01-07 22:40:13 -08:00
Xiaodi Wu
a1779df06b Revise implementation and tests for NaN conversions 2018-01-07 01:25:25 -06:00
Xiaodi Wu
d965a13c44 Implement generic conversions to floating point 2018-01-06 19:03:23 -06:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Xiaodi Wu
bd32fba236 Add generic FixedWidthInteger test 2018-01-06 03:27:18 -06:00
swift-ci
9fbd809c5f Merge pull request #13548 from xwu/toil-and-trouble 2018-01-04 12:02:45 -08:00
Gregory Todd Williams
09ed106f25 [stdlib] Don't try to construct invalid UnicodeScalars in CharacterSet
Inserting and removing a single Unicode.Scalar in a CharacterSet must not
attempt to create a Range<Unicode.Scalar> because the upperBound value might
not always be a valid UnicodeScalar.

This fixes a regression to the fix for SR-2988.
2018-01-02 10:07:28 -08:00
Xiaodi Wu
cf179dada0 Fix a bug with unsigned integers in FixedWidthInteger._convert(from:) 2018-01-01 14:56:17 -06:00
Xiaodi Wu
869b9257cc Clean up DoubleWidth implementation 2018-01-01 14:56:16 -06:00
Max Moiseev
d4359b83c7 Merge pull request #12819 from moiseev/filtermap
[stdlib] Introduce compactMap and deprecate one flatMap variant
2017-12-19 17:06:32 -08:00
Pavel Yaskevich
c18edfc632 [Mangling/ABI] NFC: Fix test failures uncovered by CI on i386 (IRGen/stdlib/DebugInfo) 2017-12-18 21:06:54 -08:00
Pavel Yaskevich
782f9307d0 [Mangling/ABI] NFC: Fix stdlib to reflect label mangling changes 2017-12-18 15:45:50 -08:00
Maxim Moiseev
128092a7d6 Rename filterMap to compactMap 2017-12-18 09:22:41 -08:00
Max Moiseev
fb49b3ee97 [test] Add test for flatMap deprecation message 2017-12-18 09:16:37 -08:00
Arsen Gasparyan
823205f609 Add test cases for Repeated (#13346) 2017-12-17 10:17:08 -08:00
Max Moiseev
e888dd94cd [test] Revert use of expectCrash(executing:) in the optional test
The test is conditionally XFAILed for the release configuration only,
but using `expectCrash(executing:)` make it fail even in release mode,
but for a wrong reason (`expectUnreachable()` is unconditional).
2017-12-15 09:57:38 -08:00
Arsen Gasparyan
8d6c882fe4 Replace expectCrashLater with expectCrash in test/stdlib/Optional.swift 2017-12-13 12:16:51 +03:00
Ben Cohen
4ddac3fbbd [stdlib] Eradicate IndexDistance associated type (#12641)
* Eradicate IndexDistance associated type, replacing with Int everywhere

* Consistently use Int for ExistentialCollection’s IndexDistance type.

* Fix test for IndexDistance removal

* Remove a handful of no-longer-needed explicit types

* Add compatibility shims for non-Int index distances

* Test compatibility shim

* Move IndexDistance typealias into the Collection protocol
2017-12-08 12:00:23 -08:00
Max Moiseev
80940efa6d Merge pull request #13191 from moiseev/ungybbed
[stdlib] Conditional gardening [NFC]
2017-12-06 09:47:46 -08:00
Max Moiseev
42eb45347b [stdlib] Conditional gardening 2017-12-05 16:33:48 -08:00
Max Moiseev
8dbaa2a752 Revert "[stdlib] Temporarily exclude DoubleWidth from the standard library" 2017-12-05 15:37:07 -08:00
Philippe Hausler
beffbc6ce5 [Foundation] Discontiguous data slices should not heap corrupt (#13252)
* [Foundation] Byte access and methods that funnel to byte access for slices of discontiguous data (ala backed by dispatch_data_t) should void heap corruption and walking off the ends of buffers

* add missing parens on test_byte_access_of_discontiguousData

* Use the proper byte count in testing
2017-12-05 09:55:22 -08:00