Commit Graph

71 Commits

Author SHA1 Message Date
Jordan Rose
da29f099f0 Update stdlib for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19672
2014-07-08 02:17:46 +00:00
Chris Lattner
7dae30f755 rename the integer 'modulus' methods to 'remainder' methods.
Swift SVN r19433
2014-07-01 22:36:54 +00:00
Jordan Rose
748efed913 [Accessibility] Protocol witnesses must be as accessible as the protocol.
...unless the type has less accessibility than the protocol, in which case
they must be as accessible as the type.

This restriction applies even with access control checking disabled, but
shouldn't affect any decls not already marked with access control modifiers.

Swift SVN r19382
2014-06-30 23:38:35 +00:00
Dave Abrahams
8e7d45f2c0 [stdlib] Normalize .gyb files
- Follow LLVM conventions for emacs mode specification

- Use local variables suffix to make the output read-only (at least on
  Emacs)

- But drop the admonitions not to edit the generated files;
  line-directive mostly takes care of that problem now.

Swift SVN r19381
2014-06-30 23:24:17 +00:00
Jordan Rose
5e59d30c6f Update stdlib for memberwise access control.
As before, there may be more things marked @public than we actually want
public. Judicious use of the frontend option -disable-access-control may
help reduce the public surface area of the stdlib.

Swift SVN r19353
2014-06-30 18:50:50 +00:00
Chris Lattner
4ac0f31852 add an 'overflow' label to the second result of the "withoverflow" aritmetic operations,
as suggested by Dmitri



Swift SVN r19251
2014-06-26 21:00:32 +00:00
Chris Lattner
4dcd6cf4d1 implement <rdar://problem/17101613> standard library should provide a way to test for overflow
This just renames the existing "uncheckedAdd" (and related) functions to addWithOverflow.  These
were already "checked" and return the partial result + bool that we want.


Swift SVN r19246
2014-06-26 20:33:17 +00:00
Jordan Rose
cca27d02a0 Tag everything in the standard library with accessibility attributes.
Keep calm: remember that the standard library has many more public exports
than the average target, and that this contains ALL of them at once.
I also deliberately tried to tag nearly every top-level decl, even if that
was just to explicitly mark things @internal, to make sure I didn't miss
something.

This does export more than we might want to, mostly for protocol conformance
reasons, along with our simple-but-limiting typealias rule. I tried to also
mark things private where possible, but it's really going to be up to the
standard library owners to get this right. This is also only validated
against top-level access control; I haven't fully tested against member-level
access control yet, and none of our semantic restrictions are in place.

Along the way I also noticed bits of stdlib cruft; to keep this patch
understandable, I didn't change any of them.

Swift SVN r19145
2014-06-24 21:32:18 +00:00
Ted Kremenek
58558fcca3 Rename 'succ' and 'pred' to 'successor' and 'predecessor' respectively.
This is motivated by <rdar://problem/17051606>.

This ends up renaming variables as well, which seems right for
consistency since we use "predicate" as variable name.

Swift SVN r19135
2014-06-24 19:27:19 +00:00
Chris Lattner
b5cec06c12 remove an extraneous space.
Swift SVN r18911
2014-06-15 19:59:15 +00:00
Chris Lattner
ab3100230e restore DaveZ's r18786, which adds a .bytesSwapped property. Not all byte
swapping is about endianness.  This resolves rdar://17319884.


Swift SVN r18910
2014-06-15 19:57:37 +00:00
Dmitri Hrybenko
363dfbee9b stdlib: add doc comments
Swift SVN r18794
2014-06-10 23:59:24 +00:00
Dave Zarzycki
152627896e stdlib: more byte swap feedback
Swift SVN r18790
2014-06-10 23:23:56 +00:00
Dave Zarzycki
59368b5711 stdlib: byte swap feedback
We only care about little-endian hosts at it shows. ;-)

Swift SVN r18787
2014-06-10 23:03:56 +00:00
Dave Zarzycki
9bdf3f6f6e stdlib: add .byteSwapped to integer types
This fixes: <rdar://problem/17085624>

Swift SVN r18786
2014-06-10 22:41:27 +00:00
Dmitri Hrybenko
473ad2e1eb stdlib: don't use assert() in stdlib implementation
Swift SVN r18653
2014-05-28 20:43:56 +00:00
Dmitri Hrybenko
3ca4c987f8 stdlib/Fixed point: switch allZeros to be a static property
Swift SVN r18490
2014-05-21 11:31:21 +00:00
Dmitri Hrybenko
de9a0c8ff0 stdlib/printing: remove ReplPrintable protocol
It is replaced by debugPrint() family of functions, that are called by REPL.

There is a regression in printing types that don't conform to Printable, this
is tracked by rdar://16898708


Swift SVN r18006
2014-05-13 16:22:56 +00:00
Dmitri Hrybenko
2cc8fe40d4 stdlib/printing: replace four printing systems with one new one
The old ones were:

- print/println
- printAny
- printf
- Console

The new printing story is just print/println.  Every object can be printed.
You can customize the way it is printed by adopting Printable protocol.  Full
details in comments inside stdlib/core/OutputStream.swift.

Printing is not completely finished yet.  We still have ReplPrintable, which
should be removed, string interpolation still uses String constructors, and
printing objects that don't conform to Printable will result in printing
mangled names.


Swift SVN r18001
2014-05-13 13:07:59 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Dave Abrahams
c33a59c6a7 [build] Complete gyb support
Remove all gyb-generated files and generate them automatically from .gyb
files.  Rename the proof-of-concept UnsafeArray.swift.gyb back to
UnsafeArray.swift.  Never forget to update the .gyb file or regenerate
again!

Swift SVN r14445
2014-02-27 03:01:16 +00:00