Commit Graph

8969 Commits

Author SHA1 Message Date
Pavel Yaskevich
e0a97ed568 Merge pull request #12421 from xedin/metadata-reader-fn-flags
[RemoteAST/Reflection] Changes to MetadataReader and its users to track function parameter flags
2017-10-16 20:57:19 -07:00
Pavel Yaskevich
51d9542a2a [Reflection] Add label and flags to function type reference parameters 2017-10-16 16:46:45 -07:00
Pavel Yaskevich
bf8d6f591e [Reflection] NFC: Rename FunctionTypeRef::{getArguments() -> getParameters()} 2017-10-16 16:46:45 -07:00
Max Moiseev
88c544164f Merge pull request #12424 from moiseev/mtkmesh-fix
[overlay] Fix newMeshes to return proper modelIO meshes
2017-10-16 14:50:36 -07:00
Ben Cohen
a70e857d59 [stdlib] Fix issue with UTF16 index(_:offsetBy:limitedBy) (#12378)
* Fix issue with empty string ranges

* Add tests for basic offsetBy operation on UTF16View.Index
2017-10-16 13:44:51 -07:00
ktopley-apple
95564f24fa Merge pull request #12387 from ktopley-apple/dispatch-timebase-overflow
Fixes overflow trap when creating DispatchTime objects with large upt…
2017-10-16 07:37:33 -07:00
Kim Topley
1da4b04d99 Fixes overflow trap when creating DispatchTime objects with large uptimeNanoseconds values and re-enables the tests that failed.
Adds some additional tests.
2017-10-16 07:09:05 -07:00
Max Moiseev
92d9b3ad42 Merge pull request #12390 from moiseev/strides
[stdlib] Implement customization points for StrideTo, StrideThrough, and LazyFilterX
2017-10-14 19:48:41 -07:00
Max Moiseev
ed553fd257 [overlay] Fix newMeshes to return proper modelIO meshes
Fixes: <rdar://problem/34624659>
2017-10-13 10:48:11 -07:00
Pavel Yaskevich
0ccf4fabd7 Merge pull request #12320 from xedin/rdar-31408030
[IRGen/Runtime] Update Function Metadata
2017-10-12 17:45:09 -07:00
Max Moiseev
ba019f3dea Use _base._customContainsEquatableElement in LazyFilterX structs 2017-10-12 17:04:52 -07:00
Max Moiseev
dd5ba51a19 [stdlib] Implement _customContainsEquatableElement for LazySequence and LazyXCollection 2017-10-12 16:46:17 -07:00
Max Moiseev
2874662ffb [stdlib] Implement _preprocessingPass and _customContainsEquatableElement for StrideTo and StrideThrough 2017-10-12 16:46:17 -07:00
Pavel Yaskevich
c5cff769c7 [IRGen] Update Function Metadata to use AnyFunctionType::Param
This changes layout of the parameter metadata from single tuple record
(in case of materializable type) to N records each corresponding to
invididual function parameter, where functions with no parameters
`() -> Void` get 0 records allocated.
2017-10-12 15:58:19 -07:00
Saleem Abdulrasool
2f41cc216c Merge pull request #12012 from paulmenage/asan
[Metadata] Unpoison memory being returned from the metadata allocator
2017-10-12 14:27:30 -07:00
Max Moiseev
93afb243ca Merge pull request #11917 from natecook1000/nc-uint-advance
[stdlib] Fix strideable methods for large unsigned values
2017-10-11 10:08:29 -07:00
Slava Pestov
124251cf2c Merge pull request #9619 from allevato/synthesize-equatable-hashable
Synthesize Equatable/Hashable for complex enums, structs
2017-10-10 18:22:40 -07:00
Saleem Abdulrasool
03ecfe2867 Merge pull request #12350 from compnerd/calling-conv
stdlib: fix build for non-ObjC targets
2017-10-10 17:25:29 -07:00
Saleem Abdulrasool
5022dbc201 stdlib: fix build for LLP64 targets
When building the stdlib for Windows x86_64, we would see the following error:

  swift/stdlib/public/core/RuntimeFunctionCounters.swift:95:19: error: '(UnsafeRawPointer, Int64) -> Void' is not representable in Objective-C, so it cannot be used with '@convention(c)'
     @convention(c) (_ object: UnsafeRawPointer, _ functionId: Int64) -> Void
                    ^

This is caused by `Int64` not being mapped as on Windows x86_64, `CLong`
is mapped to `Int32` and `CLongLong` is mapped to `Int`.  This causes
the `Int64` to fail to be reverse-mapped to a C type causing the FFI
construction failure.
2017-10-10 12:21:08 -07:00
Nate Cook
37b4083ac7 [stdlib] Try inlining integer stride methods 2017-10-10 13:00:36 -05:00
Doug Gregor
26cdef13a7 Merge pull request #12342 from natecook1000/nc-indexdistance
[stdlib] Constrain SubSequence.IndexDistance == IndexDistance
2017-10-10 09:48:19 -07:00
Tony Allevato
715ba632dd Merge branch 'master' into synthesize-equatable-hashable 2017-10-09 15:57:36 -07:00
Jacopo Andrea Giola
bcb9571079 Add fix in Casting.cpp for SR-6032 (#12298)
Private classes doesn't add extra stuff when passed to String(describing:)
2017-10-09 14:06:34 -07:00
Nate Cook
0648aad14f [stdlib] Constrain SubSequence.IndexDistance == IndexDistance 2017-10-09 01:59:44 -05:00
Arnold Schwaighofer
b6eef4fc75 Merge pull request #12312 from aschwaighofer/fix_hashvalue_leak
runtime: Move String implementation stubs that want need the auto-rel…
2017-10-08 08:12:21 -07:00
Arnold Schwaighofer
f9c004945f Update comments 2017-10-07 09:15:55 -07:00
swift-ci
b10726b62f Merge pull request #12299 from compnerd/va_list 2017-10-06 18:03:40 -07:00
Max Moiseev
5db258b5ab Merge pull request #12196 from moiseev/bench-no-characters
[benchmark] Eliminate usages of String.characters and CharacterView
2017-10-06 17:05:14 -07:00
Saleem Abdulrasool
d7fc6a0359 stdlib: initialize va_list variables (NFC)
This silences `-Wuninitialized` warnings from clang when building the
swift stdlib for Windows ARM.  NFC.
2017-10-06 15:33:43 -07:00
Arnold Schwaighofer
f691657f3e Use an autorelease pool on i386 instead 2017-10-06 14:41:56 -07:00
Arnold Schwaighofer
362f91052a Not a doc comment 2017-10-06 14:11:38 -07:00
Arnold Schwaighofer
16552c003c Fix linux build 2017-10-06 13:04:03 -07:00
Arnold Schwaighofer
513303fd63 Also fix and test uppercased and lowercased 2017-10-06 13:04:03 -07:00
Arnold Schwaighofer
ec5f40f12f runtime: Move String implementation stubs that want need the auto-released return value optimization to an ARC compiled file
String's hashValue function is implemented in terms of Foundation's hash
function in a runtime function on darwin platforms. For non-ASCII strings we
will call str.decomposedStringWithCanonicalMapping inside this runtime function
which will allocate a new NSString and return the result in the current
autorelease pool. We implemented this function in a file compiled without ARC.
This meant that we would leak said NSString into the current active autorelease
pool.
This patch moves the implementation to a file compiled with ARC. ARC will insert
objc_retainAutoreleasedReturnValue call and on platforms that require it an
marker for the hand-off of the autoreleased return value optimization.

SR-4889
rdar://32199117
2017-10-06 11:12:22 -07:00
Roman Levenstein
111499d2bf Merge pull request #12256 from swiftix/sil-serialize-all-improvments
Remove the -sil-serialize-all option
2017-10-05 22:03:41 -07:00
Michael Ilseman
94970496ba Merge pull request #12306 from milseman/spooky_bit_masques
[shims] Move bit masks to SwiftShims and include/swift/ABI.
2017-10-05 20:12:19 -07:00
Michael Ilseman
87a84d836d [stubs] Prefer __swift_uintptr_t over uintptr_t. NFC 2017-10-05 19:49:41 -07:00
Michael Ilseman
3d04fb5eac [shims] Move bit masks to SwiftShims and include/swift/ABI.
Move bits mask from Metadata.h to SwiftShims's HeapObject.h. This
exposes the bit masks to the stdlib, so that the stdlib doesn't have
to have its own magic numbers per-platform. This also enhances
readability for BridgeObject, whose magic numbers are mostly derived
from Swift's ABI.
2017-10-05 16:31:43 -07:00
Ben Cohen
e3a4ca22d5 [stdlib] Implement slice Indices using their base Indices (#12277)
* Implement slice Indices using their base Indices

* Fix expected type test for Slice
2017-10-05 10:46:04 -07:00
Karoy Lorentey
7dabd3ee1a Merge pull request #12249 from lorentey/rdar/34672149
[stdlib] Dictionary.Keys, .Values: Implement Custom[Debug]StringConvertible
2017-10-05 11:31:14 +01:00
Joe Groff
f4ef19fedf Merge pull request #12274 from jckarter/remove-pattern-reference-from-nominal-descriptor
Remove generic metadata pattern from nominal type descriptors.
2017-10-04 18:33:11 -07:00
Max Moiseev
ff105c5ab2 [benchmark] Eliminate usages of String.characters and CharacterView
To avoid compiler warnings.
<rdar://problem/34750654>
2017-10-04 15:50:34 -07:00
Roman Levenstein
5e67f755e0 Remove the -sil-serialize-all option 2017-10-04 14:20:53 -07:00
Slava Pestov
c272d41e2f Re-apply "SIL: Remove special meaning for @_semantics("stdlib_binary_only")"
With -sil-serialize-all gone, this no longer means anything; just
don't declare the function as @_inlineable instead.

Fixes <rdar://problem/34564380>.
2017-10-04 14:07:52 -07:00
Joe Groff
d558168a42 Merge pull request #12254 from jckarter/unused-metadata-getGenericPattern
Runtime: Remove unused Metadata::getGenericPattern() method.
2017-10-04 13:58:45 -07:00
Jordan Rose
aab5f7aa4f Revert "SIL: Remove special meaning for @_semantics("stdlib_binary_only")" (#12270)
It still affects StdlibUnittest, which is still using -sil-serialize-all.
2017-10-04 12:49:21 -07:00
Joe Groff
9e7b60326c Runtime: Remove API for getting generic metadata pattern from nominal type descriptors.
The NTD now references the metadata accessor function for the type, which is a better interface for most things one would want to do with type metadata from a nominal type. The only remaining use in the runtime self really has no requirement to do so. For now, don't disturb the binary layout to prevent breaking downstream clients.
2017-10-04 12:42:06 -07:00
Joe Groff
0f137aaae2 Runtime: Remove apparently-unused Metadata::getGenericPattern() method. 2017-10-04 11:47:27 -07:00
Karoy Lorentey
4ff5a41061 [stdlib] Dictionary.Keys, .Values: Implement Custom[Debug]StringConvertible.
This prevents a crash while printing these collections.

Resolves:
https://bugs.swift.org/browse/SR-6003
rdar://problem/34672149
2017-10-04 12:40:00 +01:00
Karoy Lorentey
e4ef5203d2 [stdlib] Extract Array._makeDescription into standalone function
This enables its use for collection types unrelated to Arrays.
Use the new function to replace Set’s implementation of
Custom[Debug]StringConvertible.
2017-10-04 12:40:00 +01:00