Commit Graph

1978 Commits

Author SHA1 Message Date
Dmitri Gribenko
e3d8448bbd Merge pull request #3902 from hfossli/patch-2
GenericsManifesto.md – fixed a formatting problem
2016-08-01 09:13:06 -07:00
Bas Broek
aac62823ec [Gardening] Infer a Bool 2016-08-01 15:28:06 +02:00
Håvard Fossli
88c875e581 GenericsManifesto.md – fixed a formatting problem 2016-08-01 13:46:19 +02:00
Doug Gregor
8f81b2184e Formatting fix for the generics manifesto 2016-07-30 20:50:24 -07:00
Doug Gregor
b0fed59a1b Merge pull request #3889 from Scellow/patch-2
Added correct Swift tag for code snippets
2016-07-30 20:49:30 -07:00
Antonio Alves
cee7d90458 Update OptimizationTips.rst 2016-07-30 08:30:43 -07:00
Scellow
ab87ad21f2 Added correct Swift tag for code snippets
This make code easier to read by adding syntax coloring
2016-07-30 15:17:53 +02:00
Robert Widmann
14dc86cf15 Polish off uses of dynamicType in codebase 2016-07-29 16:58:40 -07:00
Jordan Rose
b5003f4c48 Private members may not satisfy protocol requirements, ever. (#3842)
* Private members may not satisfy protocol requirements, ever.

...because by construction they can be invoked from outside of the
type.

Finishing up SE-0025 ('private' and 'fileprivate').

* Update docs and mark SE-0025 ('private' and 'fileprivate') as done!

There's still improvements we can make (see 508e825f), but the feature
is in place and should be working correctly.
2016-07-29 11:24:05 -07:00
Michael Gottesman
ca48aaef1d [doc] Initial validation-test documentation. It is not complete, but it is a good start. 2016-07-26 23:06:14 -07:00
Michael Gottesman
33d77efe7a [docs] Move Benchmarking @swift-ci to its own section instead of validation-testing. 2016-07-26 23:06:14 -07:00
Dmitri Gribenko
6ad03e2319 Merge pull request #3780 from radex/patch-1
Fixes typos in OptimizationTips.rst
2016-07-26 16:59:12 -07:00
Andrew Trick
a18d490d6a Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3773)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 14:21:15 -07:00
Radek Pietruszewski
d1106c0782 Fixes typos in OptimizationTips.rst 2016-07-26 23:16:19 +02:00
Michael Gottesman
c77a21d1a3 [docs] Small styling change in ContinuousIntegration.
NFC
2016-07-26 13:38:12 -07:00
Michael Gottesman
47053c6f7a [docs] Fix the ContinuousIntegration.md table of contents. 2016-07-26 13:36:35 -07:00
Michael Gottesman
647c55b403 Fill out pull request testing section/multiple repo testing section of ContinuousIntegration.md (#3775) 2016-07-26 13:34:22 -07:00
Michael Gottesman
b1da6c32fe Rename CI.md to ContinuousIntegration.md
I should have called it this in the first place...
2016-07-26 13:09:08 -07:00
Michael Gottesman
804d20d5d6 [docs] Add a quick doc for the CI that initially just contain information about @swift-ci.
This documentation is also in the PR template, but many people do not read the
PR template...
2016-07-26 13:08:10 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
Joe Groff
10a0eb1c13 Merge pull request #3710 from jckarter/turn-on-id-as-any
Turn on id as any
2016-07-25 18:58:27 -07:00
Joe Groff
32b50c624d stdlib: Remove _isBridgedToObjectiveC from _ObjectiveCBridgeable.
All generic bridgeable types can bridge for all their instantiations now. Removing this ferrets out some now-unnecessary traps that check for unbridgeable parameter types.
2016-07-25 06:01:21 -07:00
practicalswift
dbc6ec55b8 [gardening] Fix recently introduced "a" vs. "an" typos 2016-07-25 10:09:57 +02:00
Dmitri Gribenko
d82682ec6c Merge pull request #3733 from practicalswift/typo-fixes-20160724
[gardening] Fix recently introduced typos.
2016-07-24 15:43:03 -07:00
practicalswift
7e89679404 [gardening] Fix recently introduced typos. 2016-07-24 22:32:40 +02:00
Slava Pestov
5a763f9b23 Merge pull request #3720 from slavapestov/migrate-noreturn-to-never
Fixits for @noreturn -> Never (SE-0102)
2016-07-24 12:58:29 -07:00
Dmitri Gribenko
558f2b8591 Merge pull request #3517 from natecook1000/nc-SE-0120
[stdlib] Implement partition API change (SE-0120)
2016-07-24 01:43:02 -07:00
Slava Pestov
57c58176bc AST: Remove noreturn bit from function types 2016-07-24 00:15:34 -07:00
Andrew Trick
a41484ea2b Add UnsafeRawPointer type and API. (#3677)
* Add UnsafeRawPointer type and API.

As proposed in SE-0107:   UnsafeRawPointer.
https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md

The fundamental difference between Unsafe[Mutable]RawPointer and
Unsafe[Mutable]Pointer<Pointee> is simply that the former is used for "untyped"
memory access, and the later is used for "typed" memory access. Let's refer to
these as "raw pointers" and "typed pointers". Because operations on raw pointers
access untyped memory, the compiler cannot make assumptions about the underlying
type of memory and must be conservative. With operations on typed pointers, the
compiler may make strict assumptions about the type of the underlying memory,
which allows more aggressive optimization.

Memory can only be accessed by a typed pointer when it is currently
bound to the Pointee type. Memory can be bound to type `T` via:
- `UnsafePointer<T>.allocate(capacity: n)`
- `UnsafePointer<Pointee>.withMemoryRebound(to: T.self, capacity: n) {...}`
- `UnsafeMutableRawPointer.initializeMemory(as: T.self, at: i, count: n, to: x)`
- `UnsafeMutableRawPointer.initializeMemory(as: T.self, from: p, count: n)`
- `UnsafeMutableRawPointer.moveInitializeMemory(as: T.self, from: p, count: n)`
- `UnsafeMutableRawPointer.bindMemory(to: T.self, capacity: n)`

Mangle UnsafeRawPointer as predefined substitution 'Sv' for Swift void
pointer ([urp] are taken).

* UnsafeRawPointer minor improvements.

Incorporate Dmitri's feedback.

Properly use a _memmove helper.

Add load/storeBytes alignment precondition checks.

Reword comments.

Demangler tests.

* Fix name mangling test cases.

* Fix bind_memory specialization.
2016-07-22 13:32:08 -07:00
Nate Cook
d7ee56088f [stdlib] Implement partition API change (SE-0120) 2016-07-21 10:16:54 -05:00
Luke Larson
74e0498015 Revert "Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs."
This reverts commit 62d1fa760c.
2016-07-19 15:18:17 -07:00
Doug Gregor
598690b594 Make title underline longer 2016-07-19 14:21:42 -07:00
Tony Parker
3cb4a76fed Merge pull request #3576 from parkera/se86_outputstream
Rename OutputStream to OutputStreamable [SE-0086]
2016-07-19 13:45:01 -07:00
Mishal Shah
62d1fa760c Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-07-19 22:31:34 +02:00
Joe
67dccb283e [SE-0095] Code feedback changes; Any is parsed as a keyword
- Any is made into a keyword which is always resolved into a TypeExpr,
allowing the removal of the type system code to find TheAnyType before
an unconstrained lookup.
- Types called `Any` can be declared, they are looked up as any other
identifier is
- Renaming/redefining behaviour of source loc methods on
ProtocolCompositionTypeRepr. Added a createEmptyComposition static
method too.
- Code highlighting treats Any as a type
- simplifyTypeExpr also does not rely on source to get operator name.
- Any is now handled properly in canParseType() which was causing
generic param lists containing ‘Any’ to fail
- The import objc id as Any work has been relying on getting a decl for
the Any type. I fix up the clang importer to use Context.TheAnyType
(instead of getAnyDecl()->getDeclaredType()). When importing the id
typedef, we create a typealias to Any and declare it unavaliable.
2016-07-19 12:01:37 -07:00
Joe
622c86bbcf [SE-0095] Converted the docs to new composition syntax 2016-07-19 12:01:37 -07:00
Tony Parker
2a4e916296 Rename OutputStream to TextOutputStream [SE-0086] 2016-07-18 16:47:23 -07:00
Andrew Trick
2b732d0af5 Introduce Builtin.bindMemory and SIL bind_memory. (#3573)
Required for SE-0107: UnsafeRawPointer.
2016-07-18 13:18:03 -07:00
Dmitri Gribenko
f519cdf128 Fix .rst build error 2016-07-18 02:36:44 -07:00
Chris Lattner
aba4bd5bf0 fix typo 2016-07-17 22:19:49 -07:00
Brian Gesiak
67cce899d2 [docs] Add "IWYU" to lexicon 2016-07-17 23:40:34 -04:00
Andrew Trick
c47687da2c Add an isStrict flag to SIL pointer_to_address. (#3529)
Strict aliasing only applies to memory operations that use strict
addresses. The optimizer needs to be aware of this flag. Uses of raw
addresses should not have their address substituted with a strict
address.

Also add Builtin.LoadRaw which will be used by raw pointer loads.
2016-07-15 15:04:02 -05:00
Chris Lattner
f3aec9358b fix overly pedantic build issue where RST files fail to build if their
underline isn't big enough.
2016-07-12 21:58:52 -07:00
Robert Widmann
f97e5dcb0e [SE-0115][1/2] Rename *LiteralConvertible protocols to ExpressibleBy*Literal. This
change includes both the necessary protocol updates and the deprecation
warnings
suitable for migration.  A future patch will remove the renamings and
make this
a hard error.
2016-07-12 15:25:24 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
mrmrs
13a65a5882 Add consistent formatting in swift.css
This changes all classes to be formatted in the same way.
* Each property is on it's own line
* Each declaration is on it's own line
* Single linebreak in between rulesets
2016-07-06 16:25:18 -07:00
Jordan Rose
dce2db9a87 [docs] LibraryEvolution: add "let vs. var" as a planned proposal.
Dmitri and I were talking about this today and we think it's
worth proposing as part of the general library evolution effort.
2016-06-30 20:30:16 -07:00
Jordan Rose
56ac97cb53 [doc] Tweak recent Lexicon additions based on feedback. 2016-06-27 18:29:02 -07:00
Vijaya Prakash Kandel
f892bc4331 Typo corrected
Corrected typo in the documentation for implementation which means implements.
2016-06-28 00:03:36 +02:00