Maxim Moiseev
ca51626fd3
[stdlib] Move _stdlib_AtomicInt and friends out of the stdlib
2018-11-06 09:53:58 -08:00
Maxim Moiseev
90106444d3
[stdlib] Remove a bunch of unused functions from Runtime.swift.gyb
...
<rdar://problem/45746339>
2018-11-05 15:03:19 -08:00
Michael Ilseman
d112e5f20f
[test] Dump in new API and ABI reference point
...
Put in the new API/ABI from UTF-8 String.
2018-11-04 10:42:44 -08:00
Brent Royal-Gordon
9bd1a26089
Implementation for SE-0228: Fix ExpressibleByStringInterpolation ( #20214 )
...
* [CodeCompletion] Restrict ancestor search to brace
This change allows ExprParentFinder to restrict certain searches for parents to just AST nodes within the nearest surrounding BraceStmt. In the string interpolation rework, BraceStmts can appear in new places in the AST; this keeps code completion from looking at irrelevant context.
NFC in this commit, but keeps code completion from crashing once TapExpr is introduced.
* Remove test relying on ExpressibleByStringInterpolation being deprecated
Since soon enough, it won’t be anymore.
* [AST] Introduce TapExpr
TapExpr allows a block of code to to be inserted between two expressions, accessing and potentially mutating the result of its subexpression before giving it to its parent expression. It’s roughly equivalent to this function:
func _tap<T>(_ value: T, do body: (inout T) throws -> Void) rethrows -> T {
var copy = value
try body(©)
return copy
}
Except that it doesn’t use a closure, so no variables are captured and no call frame is (even notionally) added.
This commit does not include tests because nothing in it actually uses TapExpr yet. It will be used by string interpolation.
* SE-0228: Fix ExpressibleByStringInterpolation
This is the bulk of the implementation of the string interpolation rework. It includes a redesigned AST node, new parsing logic, new constraints and post-typechecking code generation, and new standard library types and members.
* [Sema] Rip out typeCheckExpressionShallow()
With new string interpolation in place, it is no longer used by anything in the compiler.
* [Sema] Diagnose invalid StringInterpolationProtocols
StringInterpolationProtocol informally requires conforming types to provide at least one method with the base name “appendInterpolation” with no (or a discardable) return value and visibility at least as broad as the conforming type’s. This change diagnoses an error when a conforming type does not have a method that meets those criteria.
* [Stdlib] Fix map(String.init) source break
Some users, including some in the source compatibility suite, accidentally used init(stringInterpolationSegment:) by writing code like `map(String.init)`. Now that these intializers have been removed, the remaining initializers often end up tying during overload resolution. This change adds several overloads of `String.init(describing:)` which will break these ties in cases where the compiler previously selected `String.init(stringInterpolationSegment:)`.
* [Sema] Make callWitness() take non-mutable arrays
It doesn’t actually need to mutate them.
* [Stdlib] Improve floating-point interpolation performance
This change avoids constructing a String when interpolating a Float, Double, or Float80. Instead, we write the characters to a fixed-size buffer and then append them directly to the string’s storage.
This seems to improve performance for all three types, but especially for Double and Float80, which cannot always fit into a small string when stringified.
* [NameLookup] Improve MemberLookupTable invalidation
In rare cases usually involving generated code, an overload added by an extension in the middle of a file would not be visible below it if the type had lazy members and the same base name had already been referenced above the extension. This change essentially dirties a type’s member lookup table whenever an extension is added to it, ensuring the entries in it will be updated.
This change also includes some debugging improvements for NameLookup.
* [SILOptimizer] XFAIL dead object removal failure
The DeadObjectRemoval pass in SILOptimizer does not currently remove reworked string interpolations as well as the old design because their effects cannot be described by @_effects(readonly). That causes a test failure on Linux. This change temporarily silences that test. The SILOptimizer issue has been filed as SR-9008.
* Confess string interpolation’s source stability sins
* [Parser] Parse empty interpolations
Previously, the parser had an odd asymmetry which caused the same function to accept foo(), but reject “\()”. This change fixes the issue.
Already tested by test/Parse/try.swift, which uses this construct in one of its throwing interpolation tests.
* [Sema] Fix batch-mode-only lazy var bug
The temporary variable used by string interpolation needs to be recontextualized when it’s inserted into a synthesized getter. Fixes a compilation failure in Alamofire.
I’ll probably follow up on this bug a bit more after merging.
2018-11-02 19:16:03 -07:00
John McCall
abdba1d3f4
Change the integer-literal type from Int2048 to IntLiteral.
...
Part of SR-290.
2018-10-31 23:14:58 -04:00
Ben Cohen
dbc2e21522
Remove customization points from Sequence and Collection ( #19995 )
2018-10-31 18:58:00 -07:00
Karoy Lorentey
3ae170c1c1
[stdlib] Remove SipHash from ABI-visible names
...
Also, eliminate the (unused) SipHash24 implementation and nest most of Hasher’s internals under Hasher itself.
2018-11-01 00:45:40 +00:00
Karoy Lorentey
68b9b08cdd
[stdlib] Add 256 bits of extra state to Hasher
2018-11-01 00:43:53 +00:00
Karoy Lorentey
80ebdfc17c
[test] Update expected ABI changes
2018-10-31 12:19:52 +00:00
Ben Cohen
4381735269
Switch Zip2Sequence.init to be internal ( #20148 )
2018-10-30 18:08:06 -07:00
Ben Cohen
e8e169c11f
Add removed methods to expected ABI breakage
2018-10-29 08:00:20 -07:00
Karoy Lorentey
21b75609b6
[test] Confess ABI changes
2018-10-27 01:12:26 +01:00
Karoy Lorentey
3aae412839
[test] Confess ABI changes
2018-10-27 00:17:56 +01:00
Karoy Lorentey
1195fcf0e0
[test] Update tests for _HeapBuffer changes
2018-10-26 23:53:34 +01:00
Karoy Lorentey
79b755c73c
[test] Confess ABI changes
2018-10-26 21:49:39 +01:00
swift-ci
dda7c10df5
Merge pull request #20080 from nkcsgexi/disable-To
2018-10-26 12:30:59 -07:00
Xi Ge
88e9544adc
test: disable a flaky test api-digester/diagnostics.swift
2018-10-26 11:26:52 -07:00
Xi Ge
49c16922dd
swift-module-digester: diagnose type witness type changes when checking ABI stability.
2018-10-25 16:40:23 -07:00
Xi Ge
334c46aabd
swift-module-digester: update API/ABI baselines after recent format changes.
2018-10-25 15:14:53 -07:00
Xi Ge
fcc4bf5be2
swift-module-digester: don't blindly include initializer decls. rdar://45418572
2018-10-25 15:14:17 -07:00
Xi Ge
da4fc05a0e
swift-module-digester: model ProcotolConformance as a standalone node.
...
Modeling ProtocolConformance as a standalone node allows us to keep
track of all type witnesses and re-use existing matching algorithm
to diagnose type witness changes.
2018-10-25 15:14:17 -07:00
Ben Cohen
116dac1925
[stdlib] Uninline float description ( #20038 )
...
* Uninline float description
* Uninline _floatNNToString
2018-10-25 14:20:24 -07:00
Ben Cohen
f625f466c4
[stdlib] Simplify internal DropFirst/PrefixSequence types ( #19970 )
...
* Simplify internal DropFirstSequence type
* Simplify internal PrefixSequence type
2018-10-22 07:53:05 -07:00
Saleem Abdulrasool
920aa2f9b7
Merge pull request #19877 from compnerd/sse-no-more
...
SSE no more
2018-10-16 13:11:02 -07:00
Slava Pestov
8954e5f3c8
Merge pull request #19891 from slavapestov/unqualified-lookup-fixes-part-2
...
Unqualified lookup fixes, part 2
2018-10-15 23:02:19 -07:00
swift-ci
7cd273e777
Merge pull request #19904 from nkcsgexi/redirect-diags
2018-10-15 20:06:13 -07:00
Slava Pestov
4ef1904e88
AST: Don't allow declarations to shadow generic parameters
...
Associated type inference can synthesize type aliases with the same name
as a generic parameter. This is all fine since the underlying type of
the alias is the generic parameter type, however it might have been
synthesized in a constrained extension, resulting in bogus diagnostics
that depend on the order in which declarations are type checked, which
can vary between WMO and non-WMO, different batch mode settings, etc.
Instead, let's just check the generic parameter list first.
Fixes <rdar://problem/22587551>, <rdar://problem/44777661>.
2018-10-15 19:24:27 -07:00
Slava Pestov
ba066b8257
swift-api-digester: Don't drop value ownership when parameter has typealias type
2018-10-15 19:24:27 -07:00
Xi Ge
70118d4db0
swift-module-digester: output ABI/API diagnostics to a path instead of stdout.
...
This is handy for scripts.
2018-10-15 19:12:34 -07:00
Erik Eckstein
15b01ab792
SIL: Remove array.owner semantic function
...
Also remove the getOwner functions from ArraySlide.
These functions are not needed anymore with accessors.
rdar://problem/44184810
2018-10-15 09:44:52 -07:00
Saleem Abdulrasool
2935c09a07
stdlib: rename x86_64 variables to be generic
...
Rename some of the variables in the VaListBuilder path to be agnostic to
the architecture. SSE is x86 specific, by renaming the variables to
hide the fact that the path is x86 specific, we will be able to share
some of the code with arm64 (where the analogous hardware is the VFP).
2018-10-14 13:39:17 -07:00
Xi Ge
87ed4b4488
[test] Remove Swift 3 flags from various tests.
2018-10-09 16:09:41 -07:00
Xi Ge
9802206285
Merge pull request #19799 from nkcsgexi/module-digester-swift-only
...
swift-module-digester: add a flag to include Swift decls specifically.
2018-10-09 14:00:26 -07:00
Xi Ge
3f58f1e6d3
swift-module-digester: add a flag to include Swift decls specifically.
...
This flag allows us to diagnose the overlay part exclusively without digesting
the entire SDK framework.
2018-10-09 12:57:22 -07:00
Xi Ge
329423b165
Merge pull request #19737 from nkcsgexi/enable-api-json
...
swift-module-digester: reenable test for Json serialization diagnostics.
2018-10-08 22:12:55 -07:00
Xi Ge
7177f4191b
test: regenerate ABI/API stability baselines after recent fixes.
2018-10-08 14:05:17 -07:00
Xi Ge
c8c7fb39b0
swift-module-digester: exclude fixed binary order when checking API stability.
2018-10-08 13:59:30 -07:00
Xi Ge
847aa9b327
swift-module-digester: avoid including private protocol conformances when checking API stability.
2018-10-08 13:30:30 -07:00
Xi Ge
382e27f4ab
swift-module-digester: diagnose adding/removing final as ABI/API breakages.
2018-10-08 13:19:54 -07:00
Xi Ge
bfadd46d57
swift-module-digester: diagnose non-final function changes in non-resilient classes.
2018-10-08 12:15:55 -07:00
Xi Ge
9ed3894667
Merge remote-tracking branch 'apple/master' into include-non-resilient-class
2018-10-08 10:51:26 -07:00
Karoy Lorentey
4967393618
Merge pull request #19688 from lorentey/hashed-bridgeobject
...
[stdlib] Set, Dictionary: Replace _Variant enums with _BridgeStorage
2018-10-08 12:07:40 +01:00
Xi Ge
c5550ce2f8
test: regenerate abi stability baseline after recent fixes.
2018-10-05 14:48:56 -07:00
Xi Ge
8a769a0460
swift-module-digester: include non-resilient class decls when checking ABI stability.
2018-10-05 14:48:00 -07:00
Jordan Rose
30d15682d5
Merge pull request #19522 from jrose-apple/lined-pockets
...
Remove unwanted exceptions from @inlinable checking
2018-10-05 14:28:21 -07:00
Xi Ge
9cfc0dee79
swift-module-digester: keep track of whether a property/subscript has didSet and willSet.
2018-10-05 13:02:31 -07:00
Jordan Rose
df1ef05c4c
Remove unwanted exceptions from @inlinable checking
...
- Treat protocol requirements just like associated types in how they
inherit usable-from-inline-ness, rather than special-casing them in
the check for inlinable code.
- Enum elements are already treated this way, so we can remove a
redundant check for that.
- Finally, start enforcing that 'dynamic' declarations need to be
'@usableFromInline' to be used in inlinable functions...in Swift 5
mode or resilient code. I didn't even add a warning in Swift 4/4.2
because it was illegal to use '@usableFromInline' on a 'dynamic'
declaration in Swift 4.2. (Oops.)
2018-10-05 12:21:01 -07:00
Xi Ge
9978cd9283
swift-module-digester: re-enable test for Json serialization diagnostics.
2018-10-05 11:12:44 -07:00
Karoy Lorentey
c47b922421
[test] Confess Set/Dictionary ABI changes
2018-10-05 14:07:10 +01:00
Xi Ge
a1e66a0515
swift-module-digester: diagnose value ownership changes for parameters.
2018-10-04 18:02:45 -07:00