Commit Graph

2017 Commits

Author SHA1 Message Date
Michael Gottesman
a047bb7564 Revert "Fix the build."
This reverts commit dc24c2bd34.

Turns out Chris fixed the build but when I was looking at the bots, his fix had
not been tested yet, so I thought the tree was still red and was trying to
revert to green.
2016-07-17 16:29:18 -07:00
Michael Gottesman
dc24c2bd34 Fix the build.
This reverts commit b4cba58330.
This reverts commit a602927c75.
This reverts commit 55fbe5a763.
2016-07-17 16:17:15 -07:00
Chris Lattner
a602927c75 remove the empty Boolean.swift file from the stdlib, NFC. 2016-07-17 15:15:49 -07:00
Chris Lattner
a0d34852bb Revert "Fix the build."
This reverts commit 932fe9d6b9.
2016-07-17 12:35:42 -07:00
Michael Gottesman
932fe9d6b9 Fix the build.
This reverts commit 4242af7503.
This reverts commit 76cf339694.
This reverts commit e97ed133a8.
This reverts commit 66961fcda8.
2016-07-17 01:02:48 -07:00
Chris Lattner
76cf339694 Implement the first half of SE-0109: Remove the Boolean protocol
This removes conformance of DarwinBool and ObjCBool to the Boolean protocol,
and makes the &&/||/! operators be concrete w.r.t. Bool instead of abstract
on Boolean.

This fixes some outstanding bugs w.r.t diagnostics, but exposes some cases
where an existing diagnostic is not great.  I'll fix that in a later patch
(tracked by rdar://27391581).
2016-07-16 23:23:45 -07:00
Dave Abrahams
f4b3149b03 [stdlib] Code clean up
Should have no functional effect
2016-07-15 22:05:53 -07:00
Michael Gottesman
40e1991e12 Revert "Name and label changes for closure parameters (for review only) (#2981)"
This reverts commit 18406900ba.
2016-07-15 19:45:26 -07:00
Dmitri Gribenko
c99f3dd0cd Merge pull request #3536 from apple/stdlib-docs-fixes
stdlib: update doc comments for recent language changes
2016-07-15 17:42:05 -07:00
Dave Abrahams
18406900ba Name and label changes for closure parameters (for review only) (#2981)
Implement SE-0118 Name and label changes for closure parameters

[SE-0118](https://github.com/apple/swift-evolution/blob/master/proposals/0118-closure-parameter-names-and-labels.md)
2016-07-15 15:31:48 -07:00
Dmitri Gribenko
f84136af19 stdlib: update doc comments for recent language changes 2016-07-15 14:07:23 -07:00
Dmitri Gribenko
61fcdf5fcf Merge pull request #3527 from practicalswift/gardening-20160715
[gardening] Header fixes. Don't compare to false.
2016-07-15 13:12:17 -07:00
Stephen Canon
5564f94867 Intrinsics instead of shims (#3530)
* Use intrinsics instead of Libc stubs where we can.

This replaces most of the stubs used for basic operations on these
types with intrinsics, eliminating a level of indirection for fma,
ceil, floor, round, trunc.

square root and remainder still require stubs because there is no
remainder intrinsic and we can't use the square root intrinsic because
its behavior is undefined for negative inputs.  A previous commit
apparently either the compiler annotates static inline stubs wrong
or the SIL verifier can't handle them, so that change was backed out.

* Explicitly CHECK-NOT @llvm.sqrt instead of looking for @sqrt.
2016-07-15 12:08:25 -05:00
Andrew Trick
b1bf920a36 Revert "Use builtins instead of shims in FloatingPointTypes. (#3454)"
This reverts commit 999885fc8d.

This breaks the stdlib serialization tests:

Assertion failed: (!hasSharedVisibility(F->getLinkage()) && "external declaration of SILFunction with shared visibility is not " "allowed"), function visitSILFunction, file /s/sptr/swift/lib/SIL/SILVerifier.cpp, line 3267.
2016-07-15 08:58:53 -07:00
Stephen Canon
cc024d0710 Generic implementations of math functions implementable on FloatingPoint. (#3524)
Replace the non-generic tgmath functions with generic <T: FloatingPoint> implementations where possible, and move the global sqrt() operation into tgmath.
2016-07-15 08:19:08 -04:00
practicalswift
68af19b6b8 [gardening] Fix incorrect header filenames 2016-07-15 10:23:42 +02:00
practicalswift
a8c18a5242 [gardening] Don't compare to false. 2016-07-15 10:20:15 +02:00
swift-ci
38362bbbfb Merge pull request #3522 from apple/stdlib-move-Equatable-Comparable-Hashable 2016-07-14 19:18:21 -07:00
Dmitri Gribenko
4cd41051b3 stdlib: move Equatable, Comparable and Hashable into separate files 2016-07-14 18:26:30 -07:00
swift-ci
f8174ff0ed Merge pull request #3518 from apple/stdlib-remove-redundant-entry-points 2016-07-14 18:12:46 -07:00
Maxim Moiseev
5868f9c597 [stdlib] More new integer protocols (#3502) 2016-07-14 17:10:53 -07:00
swift-ci
6e85962970 Merge pull request #3515 from apple/array-bridge 2016-07-14 15:53:41 -07:00
Dmitri Gribenko
49164c9b7e stdlib: ExistentialCollection: remove redundant entry points 2016-07-14 14:57:56 -07:00
Stephen Canon
999885fc8d Use builtins instead of shims in FloatingPointTypes. (#3454)
* Map .round, .squareRoot, .addProduct, and .formRemainder onto builtins instead of shims where possible.
2016-07-14 17:50:30 -04:00
Dave Abrahams
b21d8bea92 [stdlib] Bridging [aClass] to ObjC in O(1) (redux #2)
There's no need for a deferred conversion in these cases.

This time committing ALL the changes needed to get the validation tests to pass.
2016-07-14 12:45:54 -07:00
Robert Widmann
65226dec83 Merge pull request #3108 from CodaFi/argumental
[Stdlib] Fix entry-point-based process args
2016-07-14 09:38:04 -07:00
Robert Widmann
dc88e51321 Nuke entry-point-based process args
Provides a new fallback for Process arguments for those instances where we do
not own main (e.g. Frameworks, Objective-C owns main.m or main.c, etc.). This
includes a number of platform-specific specializations of argument grabbing
logic and a new thread-safe interface to Process.unsafeArgv.

main()  | _NSGetArgc/_NSGetArgv    | /proc/self/cmdline     | __argc/__argv
--------|--------------------------|------------------------|---------------
Scripts | OS X, iOS, tvOS, watchOS | Linux, FreeBSD, Cygwin | Windows

For interpreted Swift where we must filter out the arguments we now do so by
loading the standard library and calling into new SPI to override the arguments
that would have been grabbed by the runtime. This implementation completely
subsumes the use of the entry point  '_stdlib_didEnterMain' and it will be
removed in a future commit.
2016-07-14 01:06:19 -07:00
Nate Cook
63a4107c3c [stdlib] Fix type inference issue for BidirectionalCollection
This resolves the issue described in SR-1922, where conformance
to a bidirectional collection gives errors when implemented using
only the minimal protocol requirements.
2016-07-14 00:34:23 -05:00
Enrico Granata
4990fbd074 In order to avoid reference cycles and repeat printing of data, stringForPrintObject maintains a list of references it has encountered and skips printing them
Bridging was causing an issue where some value types were being bridged into references and ending up randomly causing collisions which would make certain data not be printed when it should have

Make it so that we only tuck away references we know are natively references for uniqueness purposes

Fixes rdar://problem/27319054
2016-07-13 16:36:56 -07:00
Patrick Pijnappel
fe2c2d1494 [stdlib] Use double space after periods
This is a commit access test.
2016-07-14 08:55:45 +10:00
Enrico Granata
061b681d9f Minor tweak to stringForPrintObject to not say "1 elements" 2016-07-13 14:47:56 -07:00
Joe Groff
93c8784463 Merge pull request #3475 from jckarter/id-as-any-silgen
Preliminary SILGen and runtime support for id-as-Any.
2016-07-13 11:52:57 -07:00
Maxim Moiseev
61d1c599e8 [stdlib] Introducing the new Arithmetic protocol (#3479)
* [stdlib] Introducing the new Arithmetic protocol

* [stdlib] conforming floating point types to the new Arithmetic protocol

* [stdlib] removing AbsoluteValuable conformance from floating point types

* [stdlib] removing the integers prototype
2016-07-13 11:35:14 -07:00
Dmitri Gribenko
2bf19132de Merge pull request #3452 from natecook1000/nc-utf8index-nocore
[stdlib] Remove _StringCore from UTF8View.Index
2016-07-13 09:11:29 -07:00
Dmitri Gribenko
9f5a545116 stdlib: mark _reinterpretCastToAnyObject() as internal 2016-07-13 01:42:34 -07:00
Dmitri Gribenko
5d9c10bf96 Merge pull request #3481 from apple/stdlib-existential-collection-use-better-names
stdlib: ExistentialCollection: use better names for internal methods
2016-07-13 01:11:32 -07:00
Dmitri Gribenko
01fe073b8a Merge pull request #3480 from xwu/master
Conform ObjectIdentifier to CustomDebugStringConvertible [SR-2014]
2016-07-13 00:08:48 -07:00
Dmitri Gribenko
856e298694 Revert "[stdlib] Bridging [aClass] to ObjC in O(1) (redux)"
This reverts commit 7e8158a6f5.

stdlib/ArrayNew.swift.gyb is still broken.
2016-07-12 23:22:07 -07:00
Dave Abrahams
7e8158a6f5 [stdlib] Bridging [aClass] to ObjC in O(1) (redux)
There's no need for a deferred conversion in these cases.

This time committing the changes needed to get the validation tests to pass.
2016-07-12 22:08:10 -07:00
Robert Widmann
c39da37525 Merge pull request #3474 from CodaFi/postminimalist-abstract-expressionism
[SE-0115] Rename *LiteralConvertible protocols to ExpressibleBy*…
2016-07-12 21:08:52 -07:00
Michael Gottesman
297853ae77 Revert "[stdlib] Kill O(N) bridging [SomeClass] to ObjC"
This reverts commit 63f2ec24e4.

Broke the build.
2016-07-12 20:49:15 -07:00
Joe Groff
02640fc1bc Runtime: Look through existentials when bridging to id. 2016-07-12 19:21:13 -07:00
Xiaodi Wu
3b81fc2bbe Make ObjectIdentifier CustomDebugStringConvertible, add test 2016-07-12 21:06:12 -05:00
Dave Abrahams
63f2ec24e4 [stdlib] Kill O(N) bridging [SomeClass] to ObjC
There's no need for a deferred conversion in these cases.
2016-07-12 18:30:31 -07:00
Dmitri Gribenko
46fba3e792 stdlib: ExistentialCollection: use better names for internal methods 2016-07-12 18:29:37 -07:00
Xiaodi Wu
985ce3954f Conform ObjectIdentifier to CustomStringConvertible [SR-2014] 2016-07-12 20:25:35 -05:00
Dave Abrahams
e1e739f9e7 Merge pull request #3374 from apple/SE-0114
[stdlib] ManagedBuffer: rename Value => Header
2016-07-12 15:45:58 -07:00
Robert Widmann
f97e5dcb0e [SE-0115][1/2] Rename *LiteralConvertible protocols to ExpressibleBy*Literal. This
change includes both the necessary protocol updates and the deprecation
warnings
suitable for migration.  A future patch will remove the renamings and
make this
a hard error.
2016-07-12 15:25:24 -07:00
Slava Pestov
16f60d8064 SILGen: Add bridging support for id-as-Any.
- Previously we didn't know how to bridge address-only types.  Add some
  plumbing for this. Not fully general yet, but with a bit more work we
  could allow resilient value types to adopt _ObjectiveCBridgable, too.
  For now, this is just intended to support the id-as-Any work.

- Specifically when going from a type without any other known bridging
  strategy, emit a call to the new `_bridgeAnythingToObjectiveC` entry
  point from the previous commit.
2016-07-12 14:34:25 -07:00
Slava Pestov
67f7e773dd Runtime: Add preliminary _swift_bridgeUnknownToObject() entry point. 2016-07-12 13:49:39 -07:00