Commit Graph

4650 Commits

Author SHA1 Message Date
Erik Eckstein
716d0d7c17 Add a build option to compiler StdlibUnittest with -sil-serialize-all
This is the configurable version of 29214253e5
By default it's off.
2016-01-22 17:12:31 -08:00
Adriano Ferreira
e6cbebe6ea Revert "Adjust space in property/subscript declarations"
This reverts commit 47ab2e0e28.
2016-01-22 19:53:01 -05:00
Max Moiseev
29b26cf3b8 [stdlib] making Set conform to SetAlgebra
Since the API is not quite the same, needed to introduce several
overloads that accept Set<> and not any S : Sequence.
Some dynamic casts were removed from methods, since Set.init already
handles situations where sequence being passed is in fact a Set.
Verified there is no significant change in performance after vs before
the change.
2016-01-22 15:00:57 -08:00
Adriano Ferreira
47ab2e0e28 Adjust space in property/subscript declarations 2016-01-22 17:03:15 -05:00
Joe Pamer
5f29594cbf Revert "Reinstate "Compile StdlibUnittest with -sil-serialize-all."""
This reverts commit 29214253e5.

This change massively regresses test execution times for DebugAssert builds, where we won't currently benefit from this added validation.
Moving forward, we'll scope this exclusively to optimized builds.
2016-01-22 11:55:08 -08:00
Dmitri Gribenko
ed790c8d54 Swift 3 migration: add annotations for MirrorPathType 2016-01-22 09:16:11 -08:00
Mark Lacey
8917eb0e5a Revert "[Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()"
This reverts commit 9798dfd4aa because it
broke the stdlib build.
2016-01-22 08:41:07 -08:00
Dave Abrahams
d72d808225 Merge pull request #838 from austinzheng/az-port-mirror
Migrate mirrors to use CustomReflectable API, rewrite dump()

...and there was much rejoicing.
2016-01-22 03:45:48 -08:00
Dmitri Gribenko
3b4248ea78 stdlib: add migration aids for lazy filter collections 2016-01-21 18:00:30 -08:00
Dmitri Gribenko
f5153572d7 stdlib: rename count labels in underscored protocols
lengthInBytes => utf8CodeUnitCount

numberOfCodeUnits => utf16CodeUnitCount
2016-01-21 17:18:15 -08:00
Dmitri Gribenko
574052f1be stdlib: standardize fatalError() messages for unavailable APIs 2016-01-21 16:34:54 -08:00
Dmitri Gribenko
b371422dd9 stdlib: standardize fatalError() messages for unavailable APIs 2016-01-21 15:27:03 -08:00
Dmitri Gribenko
c5d694c4af Swift 3 migration: add migration aids for EnumeratedIterator and EnumeratedSequence 2016-01-21 15:25:21 -08:00
Max Moiseev
70d346c083 [stdlib] test for negative count in RangeReplaceableCollection.init 2016-01-21 15:21:06 -08:00
Max Moiseev
d00f407a59 [stdlib] checking for negative count value in Repeated.init 2016-01-21 15:08:14 -08:00
Max Moiseev
5568426991 [stdlib] RangeReplaceable.init with 0 repeated elements optimization 2016-01-21 12:27:09 -08:00
Max Moiseev
744b989f69 [stdlib] optimization for RangeReplaceableCollection.appendContentsOf 2016-01-21 12:27:09 -08:00
Max Moiseev
e3bb2a0972 [stdlib] adding init(repeating:length:) to RangeReplaceableCollection 2016-01-21 12:27:09 -08:00
Erik Eckstein
29214253e5 Reinstate "Compile StdlibUnittest with -sil-serialize-all.""
This reinstates commit 79517a8edf.

Let's try again. All blocking problems should be resolved now.
Compiling StdlibUnittest with -sil-serialize-all gives a much higher test coverage because we can inline and optimize unittest code togeter with the test file.
It already helped to uncover some compiler bugs which we wouldn't have found without this change.

On the downside, a test-run in optimized mode takes considerable longer than before, because some tests need much longer to compile.
2016-01-21 12:18:39 -08:00
Slava Pestov
34a4075116 IRGen: Implement resilient enum case numbering
Recent changes added support for resiliently-sized enums, and
enums resilient to changes in implementation strategy.

This patch adds resilient case numbering, fixing the problem
where adding new payload cases would break existing code by
changing the numbering of no-payload cases.

The problem is that internally, enum cases are numbered with payload
cases coming first, followed by no-payload cases. While each list
is itself in declaration order, with new additions coming at the
end, we need to partition it to give us a fast runtime test for
"is this a payload or no-payload case index."

The resilient numbering strategy used here is that the getEnumTag
and destructiveInjectEnumTag value witness functions now take a
tag index in the range [-ElementsWithPayload..ElementsWithNoPayload-1].

Payload elements are numbered in *reverse* declaration order, so
adding new payload cases yields decreasing tag indices, and adding
new no-payload cases yields increasing tag indices, allowing use
sites to be resilient.

This adds the adjustment between 'fragile' and 'resilient' tag
indices in a somewhat unsatisfying manner, because the calculation
could be pushed down further into EnumImplStrategy, simplifying
both the IRGen code and the generated IR. I'll clean this up later.

In the meantime, clean up some other stuff in GenEnum.cpp, mostly
abstracting code that walks cases.
2016-01-21 12:10:57 -08:00
Dmitri Gribenko
62f73f4469 Rename CollectionDefaultIterator to IndexingIterator 2016-01-21 11:49:03 -08:00
Dmitri Gribenko
a34a44f6c2 Swift 3 migration: add migration aids for EnumerateSequence 2016-01-21 11:48:41 -08:00
Austin Zheng
9798dfd4aa [Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()
Jira: SR-88
Changes:
- Removed stdlib type conformances to _Reflectable
- Conformed stdlib types to CustomReflectable, CustomPlaygroundQuickLookable
- Rewrote dump() function to not use _reflect()
- CGRect, CGPoint, CGSize now conform to CustomDebugStringConvertible
- Rewrote unit tests for compatibility with new API
2016-01-21 09:44:15 -08:00
Guillaume Lessard
47a3a71bf3 Outdated comment; already fixed 2016-01-20 21:05:43 -07:00
Max Moiseev
b4d74838d6 improving the deprecation attribute message for MutableSliceable 2016-01-20 17:23:54 -08:00
Doug Gregor
312a7f0aea [Clang importer] Strip the "NS" prefix from entities in Foundation.
As part of the improved import of Objective-C APIs into Swift, strip
the "NS" prefix from entities defined in the Foundation
framework. Addresses rdar://problem/24050011, which is part of
SE-0005. Naturally, this is hidden behind -enable-omit-needless-words.
2016-01-20 15:02:54 -08:00
Joe Groff
638e4b0984 IRGen/Runtime: Use relative addresses in nominal type descriptors.
Decrease the size of nominal type descriptors and make them true-const by relative-addressing the other metadata they need to reference, which should all be included in the same image as the descriptor itself. Relative-referencing string constants exposes a bug in the Apple linker, which crashes when resolving relative relocations to coalesceable symbols (rdar://problem/22674524); work around this for now by revoking the `unnamed_addr`-ness of string constants that we take relative references to. (I haven't tested whether GNU ld or gold also have this problem on Linux; it may be possible to conditionalize the workaround to only apply to Darwin targets for now.)
2016-01-20 14:41:53 -08:00
Max Moiseev
9a018bd77d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-20 14:38:22 -08:00
Max Moiseev
86680ec622 [stdlib] @available attributes for removed APIs 2016-01-20 13:08:27 -08:00
Dave Abrahams
966b6f435b Merge pull request #1025 from glessard/details2
80-column compliance
2016-01-20 08:19:32 -08:00
Guillaume Lessard
5d4fb3f210 80-column compliance 2016-01-20 07:53:44 -07:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Dmitri Gribenko
74ce1ca79c Add unavailable declarations for Swift 2.2 -> 3 migration 2016-01-19 14:32:59 -08:00
Chris Lattner
671eb1f4dd Merge pull request #976 from gregomni/associatedtype-in-stdlib
[stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
2016-01-17 14:09:06 -08:00
practicalswift
043d4ebc1f Fix recently introduced typos 2016-01-16 10:56:11 +01:00
Luke Howard
7b1ecbe794 [SR-558] Only build _swift_buildDemanglingForMetadata() for ObjC
_swift_buildDemanglingForMetadata() is being built for the non-ObjC interop
case as a result of a change introduced in an earlier version of the patch for
SR-381 that was not correctly backed out.
2016-01-15 19:50:34 -08:00
Dmitri Gribenko
42ef45b87b Fix the runtime build on Linux 2016-01-15 19:45:57 -07:00
Dmitri Gribenko
5a1f8b25a5 Merge pull request #979 from antonblanchard/powerpc64_merge
Add powerpc64le Linux support
2016-01-15 18:14:45 -08:00
Joe Groff
884a352215 Merge branch 'lhoward/SR-381' 2016-01-15 17:37:02 -08:00
Dmitri Gribenko
c99fa1757c Merge pull request #988 from practicalswift/adhere-to-subset-of-pep8
[gardening] Fix violations of non-controversial PEP8 rules
2016-01-15 17:35:26 -08:00
Chris Hanson
d2e5887469 XCTest Overlay: Treat ObjC exceptions as unexpected failures
When an assertion fails due to an Objective-C exception, that should be
treated as an unexpected failure, not an expected failure.

Addresses rdar://problem/24114025.
2016-01-15 16:37:48 -08:00
practicalswift
22d043fcc0 [gardening] Fix violations of non-controversial PEP8 rules.
Fixes:
* blank line at end of file
* closing bracket does not match indentation of opening bracket's line
* continuation line over-indented for hanging indent
* continuation line over-indented for visual indent
* continuation line unaligned for hanging indent
* inline comment should start with '# '
* missing whitespace around arithmetic operator
* missing whitespace around bitwise or shift operator
* multiple imports on one line
* multiple spaces after ':'
* multiple spaces after operator
2016-01-16 00:47:43 +01:00
Luke Howard
b5880f386b allow name lookup to work with resilient types
cleanup from review comments
2016-01-16 09:38:35 +11:00
Luke Howard
70c5755adb [SR-381]: runtime resolution of type metadata from a name
replace ProtocolConformanceTypeKind with TypeMetadataRecordKind

metadata reference does not need to be indirectable

more efficient check for protocol conformances

remove swift_getMangledTypeName(), not needed yet

kill off Remangle.cpp for non-ObjC builds

cleanup

cleanup

cleanup comments
2016-01-15 17:48:42 +11:00
Anton Blanchard
b1827d8a8f Add powerpc64le Linux support
This patch adds powerpc64le Linux support. While the patch also adds
the matching powerpc64 bits, there are endian issues that need to be
sorted out.

The PowerPC LLVM changes for the swift ABI (eg returning three element
non-homogeneous aggregates) are still in the works, but a simple LLVM
fix to allow those aggregates results in swift passing all but 8
test cases.
2016-01-15 06:48:31 +00:00
Chris Hanson
0e904b76a0 XCTest Overlay: Allow assertion expressions to throw
When an assertion expression throws an error, treat that as an
unexpected failure of the assertion.

Also generate the failure message for the error directly in the overlay,
rather than routing through _XCTFailureDescription, to avoid revlock
between the overlay and XCTest.framework's implementation.

Addresses rdar://problem/23789893.
2016-01-14 12:57:06 -08:00
Chris Hanson
bf6d7ada84 XCTest Overlay: Add XCTAssertThrowsError assertion
Add an assertion that can be used to check that an expression throws an
error, and if it does to run a block against that error which may
contain further checks.

Addresses rdar://problem/23789904.
2016-01-14 11:58:12 -08:00
gregomni
e2dee6b9dd [stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
Fixes deprecation warnings arising from addition of new
‘associatedtype’ keyword in sr-511.
2016-01-14 09:39:15 -08:00
Maxim Moiseev
77628e9747 Merge pull request #951 from tanadeau/sr-409
[SR-409][stdlib] Removed unused _CollectionWrapperType protocol
2016-01-13 17:29:56 -08:00
Brian Gesiak
e4ef6ea4a4 [StdlibUnittest] Fix "'++' is deprecated" warning
`++` operators were being used for the implementation of a
StdlibUnittest helper function, in environments where the
Objective-C runtime was unavailable. Replace these with
successor functions.
2016-01-13 15:48:21 -08:00