Commit Graph

1397 Commits

Author SHA1 Message Date
Dave Abrahams
981a156823 [stdlib] Add _UnitTestArray[Buffer] temporarily
We're going to replace StdlibUnittest's use of ContiguousArray with
_UnitTestArray so that we can work on (and potentially break)
_ContiguousArray and still get useful test results.  When refactoring is
complete, we can optionally replace StdlibUnittest's use of
_UnitTestArray with ContiguousArray, or move the decoupled component
into the StdlibUnittest module.

Swift SVN r22874
2014-10-22 05:28:22 +00:00
Dmitri Hrybenko
ca4df0cbf2 stdlib: use 'count' for parameter name consistently
rdar://18665454

Swift SVN r22871
2014-10-22 00:58:31 +00:00
Arnold Schwaighofer
f88190ab8b Reapply "stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent""
This reapplies commit r22864 - it is not changing the public api as we initially
thought. sqrt() was never available without importing Darwin.

This change only changes where sqrt() gets "forwarded" to. Before 'sqrt' called
the builtin '_sqrt' defined in BuiltinMath now it just calls the math library's
'sqrt' function.

I also added a stdlib test.

rdar://18371371

Swift SVN r22870
2014-10-21 23:52:37 +00:00
Arnold Schwaighofer
d95b9c9ab8 Revert "stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent"
This reverts commit 22864. The change is under discussion.

Swift SVN r22865
2014-10-21 17:46:24 +00:00
Arnold Schwaighofer
b0e5358624 stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent
llvm.sqrt(-1.0) is undefined, while sqrt(-1.0) is defined as nan.

rdar://18371371

Swift SVN r22864
2014-10-21 17:26:59 +00:00
Dave Abrahams
383ebdc7dd Revert "[stdlib] ArrayBuffer: replace unsafeBitCasts"
This reverts r22824, again.  I need to try to reproduce the failure
Jordan is seeing on my own machine.

Swift SVN r22841
2014-10-20 16:39:01 +00:00
Dave Abrahams
fc862c1954 [stdlib] bisect replacement of bitcasts 0..<2 of 6
Swift SVN r22840
2014-10-20 16:02:45 +00:00
Dave Abrahams
5ef5df8b89 [stdlib] bisect replacement of bitcasts 0..<3 of 6
Applying half of an earlier change, trying to zero in on a bot-only
failure.

Swift SVN r22836
2014-10-20 11:14:23 +00:00
Dave Abrahams
4a1d2e67ec [stdlib] ContiguousArrayBuffer: truthful types
The buffer stored in a _ContiguousArrayBuffer<T> is not always
_ContiguousArrayStorage<T>.  It might in fact be the special empty
buffer class.

Swift SVN r22835
2014-10-20 05:13:21 +00:00
Dave Abrahams
b9bdbb87b6 Revert "[stdlib] ContiguousArrayBuffer: truthful types"
This reverts commit r22824, which I suspect of causing the
closure_multivalue failure at

Swift SVN r22834
2014-10-20 03:20:46 +00:00
Dave Abrahams
4d2dff1501 [stdlib] HeapBuffer: no lying to the type system
Swift SVN r22833
2014-10-20 03:20:45 +00:00
Dave Abrahams
00e1b67279 Revert "[stdlib] HeapBuffer: no lying to the type system"
This reverts commit r22825, which I suspect of causing the
closure_multivalue failure at

Swift SVN r22832
2014-10-20 01:05:12 +00:00
Dave Abrahams
8b9772d64e Revert "De-intrinsify and remove the _does*OptionalHaveValue functions."
This reverts commit r22829, because reverting r22828 depends on it.
Reverting r22828 because it
was apparently causing an assertion on the bot:

Swift SVN r22830
2014-10-19 19:54:34 +00:00
Joe Groff
7a24c85ed8 De-intrinsify and remove the _does*OptionalHaveValue functions.
Swift SVN r22829
2014-10-19 00:08:30 +00:00
Dave Abrahams
b9d5a7a71b Revert "[stdlib] ArrayBuffer: replace unsafeBitCasts"
This reverts r22824 as it appeared to be causing

Swift SVN r22826
2014-10-18 13:21:05 +00:00
Dave Abrahams
8119458acf [stdlib] HeapBuffer: no lying to the type system
Swift SVN r22825
2014-10-18 04:49:02 +00:00
Dave Abrahams
14043e8ed8 [stdlib] ArrayBuffer: replace unsafeBitCasts
Swift SVN r22824
2014-10-18 04:49:01 +00:00
Dave Abrahams
f765ffdc45 [stdlib] ContiguousArrayBuffer: truthful types
The buffer stored in a _ContiguousArrayBuffer<T> is not always
_ContiguousArrayStorage<T>.  It might in fact be the special empty
buffer class.

Swift SVN r22823
2014-10-18 04:49:00 +00:00
Dmitri Hrybenko
7fa402868d stdlib comments: remove a false statement that fatalError is a no-op
outside of debug mode

rdar://18614211

Swift SVN r22821
2014-10-17 23:37:35 +00:00
Dmitri Hrybenko
86a37dfd96 stdlib: fix grammar in comments
Swift SVN r22820
2014-10-17 23:35:05 +00:00
Dmitri Hrybenko
71887852e5 stdlib: clarify that toString and toDebugString are better alternatives
to Printable and DebugPrintable

rdar://18673000

Swift SVN r22819
2014-10-17 23:32:10 +00:00
Dave Abrahams
afe73f308f [stdlib] Disable a check on i386, where it breaks
Fix tracked by rdar://problem/18682097

Swift SVN r22811
2014-10-17 05:56:56 +00:00
Dave Abrahams
15f7847690 [stdlib] Disable a check on armv7, where it breaks
Fix tracked by rdar://problem/18682097

Swift SVN r22801
2014-10-16 21:04:51 +00:00
Erik Eckstein
2ae07c2326 Make _HashingDetail.fixedSeedOverride public because it is accessed in validation-test/stdlib/Hashing.swift.
Swift SVN r22794
2014-10-16 08:15:07 +00:00
Dave Abrahams
69194280a7 [stdlib] Nix an unused protocol and rename another
Swift SVN r22791
2014-10-16 03:46:34 +00:00
Dave Abrahams
8a27fb8178 [stdlib] Integrate BridgeStorage into the stdlib
We're going to use it for Array internals.  When we do, it should be
expected to cause a performance hit on arrays of value types until
rdar://18125016 is handled.

Swift SVN r22784
2014-10-15 23:32:44 +00:00
Dave Abrahams
56c4cb2d42 [stdlib] Kill off _isUniquelyReferenced
It was doing an unsafeBitCast and possibly not managing lifetimes;
replace it with more-typesafe and memory-safe calls where possible.

Swift SVN r22779
2014-10-15 22:25:12 +00:00
Dave Abrahams
4e31ae0a44 [stdlib] ArrayCast discipline
use withUnsafeMutableBufferPointer rather than accessing _elementStorage
directly, where possible

Swift SVN r22778
2014-10-15 22:25:11 +00:00
Dave Abrahams
506a1b07a6 [stdlib] Modernize ArrayBuffer uniqueness check
Swift SVN r22773
2014-10-15 21:17:31 +00:00
Dave Abrahams
4bdb9462c7 [stdlib] ArrayBufferType: identity is base address
Buffer identity is only used by tests.  The switch to an identity
representation that accounts for the buffer length was actually
incorrect for the way many tests used it.

Swift SVN r22771
2014-10-15 20:27:57 +00:00
Dmitri Hrybenko
3da435d96e stdlib: Fix doc comment on Dictionary.init()
rdar://problem/18665301

Swift SVN r22762
2014-10-15 17:23:24 +00:00
Dave Abrahams
903459d87e [stdlib] ManagedBuffer updates
Edit comments, add a holdsUniqueReference test, and make the buffer
class validity check work for the empty array buffer class.

Swift SVN r22747
2014-10-15 03:57:56 +00:00
Dave Abrahams
ab69e26656 [stdlib] Actually run the ArrayCore test
Fixes rdar://problem/18646425

Running the test uncovered avoidable inefficiencies in Array copying, so
dispatch of _copyToNativeArrayBuffer was revamped.  It's reasonable to
expect some speedups from this.

Also, the internal Array API requestNativeBuffer was highly error prone
when the source was a Slice, because it could return an array buffer
that represented more than the entire slice.  That capability was
probably used for optimization once, but is no longer, and the error
prone API probably caused bugs, so it was reformed.

Swift SVN r22746
2014-10-15 03:24:47 +00:00
Erik Eckstein
bec6758105 Enable tests which use ~= for Ranges.
These tests were disabled because of <rdar://problem/17668465> Failure to find overload
It seems that this is fixed now.



Swift SVN r22726
2014-10-14 09:06:55 +00:00
Erik Eckstein
b51b3ed123 Mark public compiler intrinsics with // COMPILER_INTRINSIC
I followed Joe's example in Process.swift and used COMPILER_INTRINSIC (and not just INTRINSIC)



Swift SVN r22723
2014-10-14 07:32:03 +00:00
Dave Abrahams
f2a046a64c [stdlib] Remove obsolete workaround
Swift SVN r22709
2014-10-13 21:23:48 +00:00
Dmitri Hrybenko
fea5de2fc8 stdlib and runtime: coding style fixes
Swift SVN r22685
2014-10-11 01:40:57 +00:00
Dmitri Hrybenko
8d68624c87 stdlib: fix doc comment syntax and coding style
Swift SVN r22684
2014-10-11 01:33:05 +00:00
Dave Abrahams
5c33278e63 [stdlib] Add ManagedBufferPointer
A revamped version of HeapBuffer that doesn't allow null buffer
references.  Something like this is needed for killing the null array
state.

Swift SVN r22683
2014-10-11 01:10:38 +00:00
Erik Eckstein
a69fc9833e Fix wrong argument labels in ARM specific code in stdlib.
This was missing in the previous commit r22657.



Swift SVN r22661
2014-10-10 12:32:54 +00:00
Erik Eckstein
d0697f2ac1 Make internal stdlib functions public, which are called from the stdlib tests.
And make sure that all those public identifiers are preceeded with underscores.

I marked these public-modifiers with "// @testable" to document why they are public.
If some day we have a @testable attribute it should be used instead of those public-modifiers.

Again, this is needed for enabling dead internal function elimination in the stdlib.



Swift SVN r22657
2014-10-10 09:45:10 +00:00
Erik Eckstein
3d8008117f Make compiler intrinsic _getBool public.
Again, this is needed for enabling dead internal function elimination in the stdlib.



Swift SVN r22656
2014-10-10 09:35:32 +00:00
Dave Abrahams
2d850421bc [stdlib] Internalize HeapBuffer[Storage], OnHeap
They were never really useful to users, because their APIs were
insufficiently public.  They have been replaced with a single class,
ManagedBuffer<Value,Element>, which is really designed for user
consumption.

Swift SVN r22636
2014-10-09 21:45:44 +00:00
Dmitri Hrybenko
7ca765f720 stdlib/Character: fix code style
Swift SVN r22632
2014-10-09 20:17:58 +00:00
Dave Abrahams
57367877c4 [stdlib] Make 'Character' a struct
It used to be a public enum, which unnecessarily exposed structure that
was intended to be private implementation detail.  This change also has
the benefit that converting a String to a Character will avoid
allocating memory in many more cases.

Swift SVN r22629
2014-10-09 18:25:25 +00:00
Dave Abrahams
1f38b125f4 [stdlib] Fix typos in sanity check strings
Swift SVN r22627
2014-10-09 18:25:24 +00:00
Dave Abrahams
587c818c5b [stdlib] Use addressors in HeapBuffer
Swift SVN r22620
2014-10-09 13:30:02 +00:00
Dmitri Hrybenko
b350841f72 stdlib: remove old migration aid for ConstUnsafePointer
Swift SVN r22599
2014-10-08 08:34:14 +00:00
Dave Abrahams
74e27aaab1 [stdlib] uniqueness checking for users
Make unique reference checking available to users, making ManagedBuffer
a complete facility for building COW value types.  Also rationalize the
way we name and organize the runtime primitives we ultimately call.

Swift SVN r22594
2014-10-08 04:48:52 +00:00
Doug Gregor
ef3ff24439 CMake: don't use target_link_libraries on a "target" library.
Fixes regression in the SDK variant build that was introduced by r22527.

Swift SVN r22583
2014-10-07 23:04:34 +00:00