Commit Graph

13406 Commits

Author SHA1 Message Date
Enrico Granata
1625193055 ..and also fix a few that the script didn't seem to find
Swift SVN r19474
2014-07-02 18:44:34 +00:00
Enrico Granata
cfe3087278 Per DaveA's script, Remove spurious TABs I introduced
Swift SVN r19473
2014-07-02 18:36:01 +00:00
Dmitri Hrybenko
f3c7bdc273 stdlib/NSString APIs on String: change substringFromIndex() and
substringToIndex() to accept String.Index instead of Int

rdar://17306557


Swift SVN r19467
2014-07-02 15:58:59 +00:00
Dmitri Hrybenko
57df21cefe stdlib/comments: UTF-8 and UTF-16 are spelled with a dash
Swift SVN r19466
2014-07-02 15:45:38 +00:00
Dmitri Hrybenko
7e4c6782ee stdlib/String: rename String.utf16count -> .utf16Count to follow naming
conventions

rdar://17016806


Swift SVN r19463
2014-07-02 15:03:02 +00:00
Dmitri Hrybenko
36cbfe3c8f stdlib: fix grammar mistake in API name (introduced by me), and use a better
name suggested by Dave

enum UTFDecodeResult -> enum UnicodeDecodingResult


Swift SVN r19462
2014-07-02 14:58:31 +00:00
Dmitri Hrybenko
f7e926e5b0 stdlib/Arrays: refer to the parameter correctly.
Swift SVN r19460
2014-07-02 14:32:50 +00:00
Dmitri Hrybenko
db4fbb4f33 stdlib/Array: use monospaced text in a comment
Swift SVN r19459
2014-07-02 14:15:38 +00:00
Dmitri Hrybenko
b304e651c8 stdlib/HeapBuffer: add a message to a runtime trap
Swift SVN r19458
2014-07-02 14:14:55 +00:00
Dmitri Hrybenko
313cfcaaa7 Unicode trie generator: add tests for the generator itself that use non-default
trie parameters and fix a few bugs

The bugs did not affect correctness of the particular instance of trie created
for grapheme cluster property, because trie parameters that were confused with
each other happened to be equal.

Also, fix a trie size bug: we were creating a trie large enough to store
information for 0x200000 code points, but there are only 0x10ffff.  It saved
only 15 bytes in the grapheme cluster tree, because that extra information was
compressed with some supplementary planes that also had default values.  This
also improved trie generation time by almost 2x.


Swift SVN r19457
2014-07-02 10:29:52 +00:00
Dmitri Hrybenko
d8ed7b6a7c stdlib: convert tabs to spaces
Swift SVN r19456
2014-07-02 09:08:48 +00:00
Andrew Trick
8122715df7 Teach the ColdBlocks SIL analysis to recognize the branch hint semantic model.
We're temporarily using @semantics until we have mandatory inlining of branch hints.

We now have @noinline, which helps a lot, but:
- @noinline and "cold/slow" are not the same thing.

- Some functions may need to be inlined into hot paths, but that
  doesn't mean we should also inline them into cold paths.

- It is easier to find cold blocks than to look for blocks that
  contain calls to @noinline functions. And that doesn't necessarilly
  mean the blocks are cold anyway.

Swift SVN r19455
2014-07-02 06:35:09 +00:00
Manman Ren
2b2330bf5b [attribute] rename @noinline to @inline(never).
Add support for parsing inline(never), it can be easily expanded to
handle inline(always).

rdar://17527111


Swift SVN r19447
2014-07-02 01:27:05 +00:00
Doug Gregor
a5bde4e3a4 CMake: Add COMPILE_FLAGS support for add_swift_library.
COMPILE_FLAGS is currently used for two purposes:
  - For any target library, add the appropriate Swift optimization flags. This eliminates the add_swift_optimization_flags boilerplate and makes these flags work for all library variants
  - For the runtime, pass the appropriate define down when SWIFT_RUNTIME_CLOBBER_FREED_OBJECTS is set, so that all library variants get this setting.

Swift SVN r19444
2014-07-02 00:37:48 +00:00
Jordan Rose
e506d70667 [CMake] AppKit depends on QuartzCore, and UIKit depends on CoreImage.
Swift SVN r19439
2014-07-01 23:42:07 +00:00
Chris Lattner
287059b360 implement <rdar://problem/17279286> Swift has too many Unicode escape sequence forms
This consolidates the \x, \u, and \U escape sequences into one \u{abc} escape sequence.
For now we still parse and cleanly reject the old forms with a nice error message, this
will eventually be removed in a later beta (tracked by rdar://17527814)


Swift SVN r19435
2014-07-01 23:27:44 +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
f746b8c6dd [Accessibility] Public variables cannot have private types.
This does not yet handle variables with inferred types, since those don't
have TypePatterns.

There is some nasty propagation of @public into the stdlib because of this
one, mainly because Foundation needs access to some of the implementation
details of Array and Dictionary. We may want to try to improve this later
(or just build Foundation with -disable-access-control if it comes to that).

Swift SVN r19432
2014-07-01 22:30:53 +00:00
Jordan Rose
f13a5af044 [Accessibility] A typealias cannot be more accessible than its underlying type.
This actually lays the groundwork for checking the TypeLocs for all sorts
of decls, but let's start with typealiases.

Swift SVN r19428
2014-07-01 20:46:30 +00:00
Doug Gregor
315575e14f CMake: Add LINK_FLAGS option for add_swift_library
Swift SVN r19417
2014-07-01 17:11:38 +00:00
Doug Gregor
78117e7967 CMake: Make QuartzCore and CoreImage target libraries.
Swift SVN r19416
2014-07-01 17:11:38 +00:00
Doug Gregor
acbed44c36 CMake: Teach add_swift_library to handle libraries where the default configuration can’t be built.
Use this to build UIKit for iOS the iOS simulator without building it for the OS X host.

Swift SVN r19415
2014-07-01 17:11:37 +00:00
Doug Gregor
5ffb276c0c CMake: Give add_swift_library a TARGET_SDKS parameter to limit a particular library to a given set of SDKs.
Use it to make AppKit a target library, which will only be built against the OS X SDK.

Swift SVN r19414
2014-07-01 17:11:37 +00:00
Doug Gregor
99d4e0c8ed CMake: start building iOS variants for the CoreGraphics, Darwin, Dispatch, Foundation, ObjectiveC, and SpriteKit framework overlays
Swift SVN r19413
2014-07-01 17:11:36 +00:00
Doug Gregor
87c1198bcb Use build configurations to handle ObjCBool’s ‘signed char’ vs. ‘bool’ representation.
Swift SVN r19412
2014-07-01 17:11:35 +00:00
Doug Gregor
6446d69500 CMake: Add support for specifying framework dependencies for a library.
Use this for the Swift runtime’s dependency on Foundation, rather than a hack later on. This is part of getting the runtime to build for all of the variants.

Swift SVN r19406
2014-07-01 17:11:33 +00:00
Doug Gregor
1f7817360a Use build configurations to enable/disable Float80
Swift SVN r19405
2014-07-01 17:11:32 +00:00
Doug Gregor
d95b9fad69 CMake: Skeletal infrastructure for building multiple variants of Swift libraries (for iOS, iOS simulator, etc.).
This is behind a flag because it doesn’t work yet. However, we’re starting to see semi-sensible command lines coming out of it.

Swift SVN r19404
2014-07-01 17:11:32 +00:00
Dmitri Hrybenko
3f2006a00b stdlib/UnicodeTrie: add more comments, replace a _precondition()/#if
pair with _sanityCheck

Swift SVN r19395
2014-07-01 13:18:20 +00:00
Dmitri Hrybenko
27abfcb271 stdlib/String: add a performance FIXME
Swift SVN r19394
2014-07-01 13:18:18 +00:00
Dmitri Hrybenko
124eb2ae83 stdlib: reword trap messages in response to review from Dave
Swift SVN r19393
2014-07-01 13:18:16 +00:00
Enrico Granata
f59f6abc4e The bot is unhappy that these are not marked @public, so mark them @public
Swift SVN r19388
2014-07-01 01:47:13 +00:00
Greg Parker
3df563f233 [stdlib] Revert r19835 because it doesn't work on iOS.
Swift SVN r19387
2014-07-01 01:35:48 +00:00
Enrico Granata
9abfdb372e Add a Mirror for UnsafePointer
The one design choice here was whether to expose the pointee directly through the Mirror

My choice was against that. Instead, we present UnsafePointer as UnsafePointer(0x123) and the child we expose is the 0x123 numeric pointer value

The other option, of course, would be to present it as UnsafePointer(reflect(memory)) - but that seems risky to do by default
UnsafePointers are allowed to be in, guess what, unsafe states, and the stakes of having playgrounds try and dereference at all times are quite too high.

If the user really wants to reflect the pointee reflect(pointer.memory) will do it for them - and then any crashes will be theirs to enjoy.

Of course, I am very open to arguments as to why reflect(memory) would be a better choice.



Swift SVN r19386
2014-07-01 00:54:52 +00:00
Dave Abrahams
46d9d0d4df [stdlib] Bridge the types NSValue wraps explicitly
NSRange, NSPoint, NSSize, and NSRect

Fixes <rdar://problem/16973060>

Swift SVN r19385
2014-07-01 00:14:09 +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
Enrico Granata
0f706ba86c Add a Mirror for EmptyCollection. Oh, and test cases too.
Swift SVN r19380
2014-06-30 23:21:08 +00:00
Dave Abrahams
e38c32742b [stdlib] Dictionary: fix 80-column/endline violations
Swift SVN r19375
2014-06-30 22:12:16 +00:00
Dave Abrahams
c703a76cdc [stdlib] Add missing precondition check
Fixes <rdar://problem/17392712> UnsafeArray.init() should _precondition(length >= 0)

Swift SVN r19373
2014-06-30 21:59:42 +00:00
Dave Abrahams
c04aae5dce [stdlib] Add some missing mode lines for gyb files
Swift SVN r19372
2014-06-30 21:55:30 +00:00
Fariborz Jahanian
bae70e6358 Add dependency on swiftFoundation so Foundation
overlay is built too. This is for // rdar://16726822


Swift SVN r19371
2014-06-30 21:53:30 +00:00
Dave Abrahams
9825954746 [stdlib] That's not a doc comment!
Fixes <rdar://problem/17028678> comments for sort() don't make sense in
the synthesized header.  Putting the right comments in there is
<rdar://problem/17511801> Algorithm.swift needs doc comments

Swift SVN r19370
2014-06-30 21:46:19 +00:00
Enrico Granata
fcebadb355 Bit needs a Mirror too. It would be nice if we had automagical reflection for C-style enums, then this would just work OOTB
Swift SVN r19369
2014-06-30 21:16:50 +00:00
Dave Abrahams
127a3e59d2 [stdlib] give filter() the eager treatment, too
Swift SVN r19368
2014-06-30 20:56:11 +00:00
Fariborz Jahanian
30b995e09e Re-introduce SDK overlays for Core Image that I reverted
in r19361. Thank you Doug for pointing out that I did
not import Foundation. Sigh, that build systems have different
behavior in buildbot and elsewhere. Hope this fixes the buildbot failure.
// rdar://16726822


Swift SVN r19367
2014-06-30 20:50:06 +00:00
Nadav Rotem
715565e4ea Rename a member function
Swift SVN r19364
2014-06-30 20:16:26 +00:00
Enrico Granata
676547c5f7 Add Mirror support for CollectionOfOne
Swift SVN r19363
2014-06-30 20:14:31 +00:00
Enrico Granata
8e084a99b5 My editor was set up to produce tabs instead of spaces
Fix it and recommit



Swift SVN r19362
2014-06-30 20:08:27 +00:00
Fariborz Jahanian
ac96ad94d5 Revert r19357 (it fails on buildbot only).
Swift SVN r19361
2014-06-30 20:05:26 +00:00