Commit Graph

5263 Commits

Author SHA1 Message Date
Karoy Lorentey
3696f83f5f Merge pull request #20071 from lorentey/dictionary-subscript-fix
[stdlib] Fix over-release in _modify accessor of Dictionary.subscript
2018-10-26 22:29:40 +01:00
Karoy Lorentey
c61d4265b3 [stdlib] Hide most of AnyHashable’s implementation details from the ABI
Leave the _AnyHashableBox protocol visible and AnyHashable itself @_fixed_layout.
2018-10-26 21:27:35 +01:00
Joe Shajrawi
22d411c4ae Merge pull request #20053 from shajrawi/enforce_dom
[Exclusivity] Remove dominated access checks with no nested conflict.
2018-10-26 13:22:37 -07:00
Michael Gottesman
b36c6e5dd6 [sil-ownership] Enable ownership verification on all of the stdlib libraries.
rdar://29791263
2018-10-26 12:09:53 -07:00
Joe Shajrawi
b5508f5488 [Exclusivity] Remove dominated access checks with no nested conflict:
Simplification of the code (bail on unpaired accesses) + change the implementation so we can avoid quadratic behavior
2018-10-26 11:19:21 -07:00
Karoy Lorentey
e76881fe9d [stdlib] Dictionary: Fix overrelease in key-based subscript
Also, reorganize the code. We can have multiple yields now!

https://bugs.swift.org/browse/SR-9065
2018-10-26 16:22:56 +01:00
Nate Cook
dfb01b6a6a [stdlib] Minor documentation revisions (#20045)
* [stdlib] Minor documentation revisions
* [docs] Convert 'nonoptional' to 'non-optional'
We're switching to 'non-optional' across the board, as the unhyphenated
form is too easy to read as 'no-noptional'.
2018-10-26 00:05:45 -05:00
eeckstein
c2dad28b7b Merge pull request #20043 from eeckstein/utf8-string-literals
support static large string literal generation for the new UTF8 String implementation
2018-10-25 16:40:34 -07:00
Joe Shajrawi
63b50f65a4 [Exclusivity] Remove dominated access checks with no nested conflict.
General case:

—
begin_access A (may or may not have no_nested_conflict)
load/store
end_access

apply // may have a scoped access that conflicts with A

begin_access A [no_nested_conflict]
load/store
end_access A
—

The second access scope does not need to be emitted.

NOTE: KeyPath access must be identified at the top-level, non-inlinable stdlib entry point.
As such, The sodlib entry pointed is annotated by a new @_semantics that is equivalent to inline(never)
2018-10-25 15:21:06 -07:00
Ben Cohen
116dac1925 [stdlib] Uninline float description (#20038)
* Uninline float description

* Uninline _floatNNToString
2018-10-25 14:20:24 -07:00
Erik Eckstein
a60eafe472 Require Builtin.valueToBridgeObject to have a builtin integer as argument
Previously it was used with an UInt struct argument. But this is bad because UInt is a type defined in the stdlib.
2018-10-25 10:18:23 -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
Karoy Lorentey
aedf2b91ad [stdlib] CollectionOfOne.subscript: Replace setter with _modify 2018-10-19 11:32:43 +01:00
Max Moiseev
36786a00db Merge pull request #19918 from moiseev/int-fixme
[stdlib] Remove sil-serialize-all FIXMEs from integers
2018-10-16 16:12:38 -07:00
Maxim Moiseev
d6501e2e90 Remove sil-serialize-all FIXMEs from integers 2018-10-16 13:27:29 -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
Mark Lacey
b158651119 [ConstraintSystem] Extend solver support for designated types for operators.
Have the constraint solver consider multiple designated types for an
operator. We currently consider the overloads from each in turn,
stopping as soon as we have a solution. As a result, we can still end
up with exponential type checking in some cases if an operator has
more than a single designated type. This still allows us to reduce the
base of that exponent, though, which makes it possible to increase the
number of expressions we can type check successfully in practice.
2018-10-15 23:51:43 -07:00
Max Moiseev
ca6a2e5f7e Merge pull request #19805 from moiseev/fp-inline
[stdlib] Audit use of @_transparent in FP code
2018-10-15 16:04:23 -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
Saleem Abdulrasool
f52085a440 stdlib: extract a variable in varargs (NFCI) 2018-10-14 13:34:43 -07:00
Ben Cohen
e514ac5838 Switch ArraySlice subscript set to _modify (#19855) 2018-10-12 14:29:50 -07:00
Maxim Moiseev
a54c53580c [stdlib] Audit use of @_transparent in FP code
<rdar://problem/45140678>
2018-10-10 17:00:39 -07:00
Erik Eckstein
6e6aae8d61 Mark all _unconditionallyBridgeFromObjectiveC functions as @_effects(readonly)
This enables removal of those bridging calls for dead parameters. Read-only lets the optimizer remove such a call if the result is not used.
Note that "readonly" means: no observable write operations. It's okay to allocate and initialize new objects.

rdar://problem/44944094
2018-10-10 08:24:26 -07:00
Arnold Schwaighofer
6c571305bc Merge pull request #19716 from aschwaighofer/assume
Add the Swift equivalent of the llvm.assume intrinsic
2018-10-10 06:12:33 -07:00
Harlan
00cc011621 [SILOptimizer] Don't diagnose infinite recursion if a branch terminates the program (#19781)
* [SILOptimizer] Don't diagnose infinite recursion if a branch terminates the program

This patch augments the infinite recursion checker to not warn if a
branch terminates, but still warns if a branch calls into something with
@_semantics("programtermination_point"). This way, calling fatalError
doesn't disqualify you for the diagnostic, but calling exit does.

This also removes the warning workaround in the standard library, and
annotates the internal _assertionFailure functions as
programtermination_points, so they get this treatment too.

* Fix formatting in SILInstructions.cpp

* Re-add missing test
2018-10-09 09:46:37 -07:00
Ben Cohen
2b9544966f Switch .first to use an index not an iterator (#18075) 2018-10-08 20:44:38 -07:00
Ben Cohen
6a0fd51beb Switch UnsafeMutableBufferPointer.subscript to use _modify (#19771) 2018-10-08 16:23:01 -07:00
Arnold Schwaighofer
d2f52783d2 Fix spelling 2018-10-08 08:34:10 -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
Graydon Hoare
cc16ddfd13 Revert "[SILOptimizer] Don't diagnose infinite recursion if a branch terminates (#19724)"
This reverts commit e94450e840.

rdar://45080912
2018-10-07 23:54:33 -07:00
swift-ci
f9a2d90239 Merge pull request #19533 from lorentey/per-instance-seeding 2018-10-06 07:00:52 -07:00
Harlan
e94450e840 [SILOptimizer] Don't diagnose infinite recursion if a branch terminates (#19724)
This patch augments the infinite recursion checker to not warn if a
branch terminates, but still warns if a branch calls into something with
`@_semantics("arc.programtermination_point")`. This way, calling `fatalError`
doesn't disqualify you for the diagnostic, but calling `exit` does.

This also removes the warning workaround in the standard library, and
annotates the internal _assertionFailure functions as
`programtermination_point`s, so they get this treatment too.
2018-10-05 19:15:26 -07:00
Arnold Schwaighofer
76db09ac63 Address review comments and try to fix test 2018-10-05 06:44:34 -07:00
Mike Ash
f4db1dd7a4 Merge pull request #19614 from mikeash/no-internal-export
[Stdlib] Change SWIFT_RUNTIME_STDLIB_INTERNAL to not export the symbol.
2018-10-05 09:26:03 -04:00
Karoy Lorentey
d904b46554 [stdlib] Dictionary.Index: Remove duplicate definition for _isNative 2018-10-05 12:33:26 +01:00
Karoy Lorentey
35502ef476 [stdlib] Acknowledge there are no spare bits in Set/Dictionary’s BridgeObject storage
We really need to do a pass on the _BridgeStorage API at some point soon.
2018-10-05 12:33:25 +01:00
Karoy Lorentey
bb2cb064ae [stdlib] Eliminate more overflow checks
This is a tiny code size improvement.
2018-10-05 12:33:25 +01:00
Karoy Lorentey
84d8cedaae [stdlib] _SetBuilder, _DictionaryBuilder: Assume target has enough capacity
The compiled code included unnecessary references to resize().
2018-10-05 12:33:25 +01:00
Karoy Lorentey
be0abbbafb [stdlib] _Bitset: Reduce unnecessary overflow checking
This is mostly a code size improvement.
2018-10-05 12:33:25 +01:00
Karoy Lorentey
21da7da9d0 [stdlib] Fix build on 32-bit platforms 2018-10-05 12:33:25 +01:00
Karoy Lorentey
697ad69d24 [stdlib] Set, Dictionary: Reorganize equality checks to fix Linux builds 2018-10-05 12:33:25 +01:00
Karoy Lorentey
5c0d27036a [stdlib] Set._Variant: Add a dummy initializer for use in _modify
Dictionary already does this.
2018-10-05 12:33:25 +01:00
Karoy Lorentey
73771b1ca9 [stdlib] Rework Dictionary.values._modify 2018-10-05 12:33:25 +01:00
Karoy Lorentey
12cad748d4 [stdlib] Dictionary.Values.swapAt: Fix uniqueness check 2018-10-05 12:33:25 +01:00
Karoy Lorentey
3c60042b6c [stdlib] Fix building on platforms without an Objective-C runtime 2018-10-05 12:33:25 +01:00
Karoy Lorentey
363b74d1f2 [stdlib] Set, Dictionary: Implement modify accessor for _variant.asNative 2018-10-05 12:33:25 +01:00
Karoy Lorentey
64d19f44db [stdlib] Set, Dictionary: Switch to using a _BridgeObject instead of an enum 2018-10-05 12:33:25 +01:00
Karoy Lorentey
e24f2ba6e5 [stdlib] Set, Dictionary: Flatten switch statements
The optimizer dislikes nested switch statements; flatten them out to simplify optimization and to hopefully speed things up a little.
2018-10-05 12:33:25 +01:00
Mike Ash
3c2096f433 Merge pull request #19540 from mikeash/reserved-bits-refinement
[IRGen][Runtime] Adjust the ObjC reserved bits on x86-64 to exactly match what the target uses.
2018-10-04 17:06:08 -04:00