Skip to content

Commit 9311f72

Browse files
committed
Merge branch 'master' into feature/easier-install
2 parents 26508ca + 5e25990 commit 9311f72

File tree

182 files changed

+4465
-2345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+4465
-2345
lines changed

CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ option(SWIFT_INCLUDE_DOCS
5454
"Create targets for building docs."
5555
TRUE)
5656

57-
option(SWIFT_ENABLE_TARGET_LINUX
58-
"Enable compiler support for targeting Linux"
59-
TRUE)
60-
6157
set(SWIFT_VERSION "2.2" CACHE STRING
6258
"The user-visible version of the Swift compiler")
6359
set(SWIFT_VENDOR "" CACHE STRING
@@ -401,6 +397,19 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
401397

402398
set(SWIFT_PRIMARY_VARIANT_SDK_default "LINUX")
403399
set(SWIFT_PRIMARY_VARIANT_ARCH_default "x86_64")
400+
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
401+
configure_sdk_unix(FREEBSD "FreeBSD" "freebsd" "freebsd" "x86_64" "x86_64-freebsd10")
402+
403+
set(CMAKE_EXECUTABLE_FORMAT "ELF")
404+
405+
set(SWIFT_HOST_VARIANT "freebsd" CACHE STRING
406+
"Deployment OS for Swift host tools (the compiler) [freebsd].")
407+
408+
set(SWIFT_HOST_VARIANT_SDK "FREEBSD")
409+
set(SWIFT_HOST_VARIANT_ARCH "x86_64")
410+
411+
set(SWIFT_PRIMARY_VARIANT_SDK_default "FREEBSD")
412+
set(SWIFT_PRIMARY_VARIANT_ARCH_default "x86_64")
404413
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
405414
# Set defaults.
406415

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
By submitting a pull request, you represent that you have the right to license
2+
your contribution to Apple and the community, and agree by submitting the patch
3+
that your contributions are licensed under the [Swift
4+
license](https://swift.org/LICENSE.txt).
5+
6+
---
7+
8+
Before submitting the pull request, please make sure you have tested your
9+
changes and that they follow the Swift project [guidelines for contributing
10+
code](https://swift.org/contributing/#contributing-code).

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
<img src="https://swift.org/assets/images/swift.svg" alt="Swift logo" height="70" >
12
# Swift Programming Language
23

34
**Welcome to Swift!**
45

56
Swift is a high-performance system programming language. It has a clean
6-
and modern syntax, and offers seamless access to existing C and Objective-C code
7+
and modern syntax, offers seamless access to existing C and Objective-C code
78
and frameworks, and is memory safe (by default).
89

910
Although inspired by Objective-C and many other languages, Swift is not itself a
@@ -15,12 +16,12 @@ modules, eliminating the need for headers and the code duplication they entail.
1516

1617
## Documentation
1718

18-
To read the documentation, start by installing the Sphinx documentation
19-
generator tool (http://sphinx-doc.org, just run `easy_install -U Sphinx` from
20-
the command line and you're good to go). Once you have that, you can build the
21-
Swift documentation by going into `docs` and typing `make`. This compiles
22-
the `.rst` files in the `docs` directory into HTML in the `docs/_build/html`
23-
directory.
19+
To read the documentation, start by installing the
20+
[Sphinx](http://sphinx-doc.org) documentation generator tool (just run
21+
`easy_install -U Sphinx` from the command line and you're good to go). Once you
22+
have that, you can build the Swift documentation by going into `docs` and
23+
typing `make`. This compiles the `.rst` files in the `docs` directory into
24+
HTML in the `docs/_build/html` directory.
2425

2526
Once built, the best place to start is with the Swift white paper, which gives a
2627
tour of the language (in `docs/_build/html/whitepaper/index.html`).
@@ -66,7 +67,7 @@ compiler for C++14 support and create a symlink:
6667

6768
### Getting Sources for Swift and Related Projects
6869

69-
For those checking out sources as read-only:
70+
For those checking out sources as read-only:
7071

7172
git clone https://github.com/apple/swift.git swift
7273
git clone https://github.com/apple/swift-llvm.git llvm
@@ -78,9 +79,9 @@ compiler for C++14 support and create a symlink:
7879
git clone https://github.com/apple/swift-corelibs-xctest.git
7980
git clone https://github.com/apple/swift-corelibs-foundation.git
8081

81-
For those who plan on regular making direct commits, cloning over
82-
SSH may provide a better experience (which requires uploading
83-
SSH keys to GitHub):
82+
For those who plan on regularly making direct commits, cloning over
83+
SSH may provide a better experience (which requires uploading
84+
SSH keys to GitHub):
8485

8586
git clone [email protected]:apple/swift.git swift
8687
git clone [email protected]:apple/swift-llvm.git llvm
@@ -106,6 +107,10 @@ for building Swift and is the default configuration generated by CMake. If
106107
you're on OS X or don't install it as part of your Linux distribution, clone
107108
it next to the other projects and it will be bootstrapped automatically:
108109

110+
git clone https://github.com/martine/ninja.git
111+
112+
or
113+
109114
git clone [email protected]:martine/ninja.git
110115

111116
You can also install CMake and Ninja on OS X using a third-party

apinotes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Swift signatures of imported Objective-C APIs. Compiled API notes
2525
files reside in the Swift module directory, i.e., the same directory
2626
where the `.swiftmodule` file would reside for the Swift overlay of
2727
that module. For system modules, the path depends on the platform
28-
and architecture
28+
and architecture.
2929

3030
Platform | Path
3131
:------------- | :-------------

cmake/modules/AddSwift.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ function(_add_variant_link_flags
151151

152152
if("${sdk}" STREQUAL "LINUX")
153153
list(APPEND result "-lpthread" "-ldl")
154+
elseif("${sdk}" STREQUAL "FREEBSD")
155+
# No extra libraries required.
154156
else()
155157
list(APPEND result "-lobjc")
156158
endif()

docs/DriverInternals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Analysis` for more information.
114114
The Compilation's TaskQueue controls the low-level aspects of managing
115115
subprocesses. Multiple Jobs may execute simultaneously, but communication with
116116
the parent process (the driver) is handled on a single thread. The level of
117-
parellelism may be controlled by a compiler flag.
117+
parallelism may be controlled by a compiler flag.
118118

119119
If a Job does not finish successfully, the Compilation needs to record which
120120
jobs have failed, so that they get rebuilt next time the user tries to build

docs/TextFormatting.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ Debug Printing
129129

130130
Via compiler magic, *everything* conforms to the ``CustomDebugStringConvertible``
131131
protocol. To change the debug representation for a type, you don't
132-
need to declare conformance: simply give the type a ``debugFormat()``
133-
::
132+
need to declare conformance: simply give the type a ``debugFormat()``::
134133

135134
/// \brief A thing that can be printed in the REPL and the Debugger
136135
protocol CustomDebugStringConvertible {
@@ -199,7 +198,7 @@ Because it's not always efficient to construct a ``String``
199198
representation before writing an object to a stream, we provide a
200199
``Streamable`` protocol, for types that can write themselves into an
201200
``OutputStream``. Every ``Streamable`` is also a ``CustomStringConvertible``,
202-
naturally ::
201+
naturally::
203202

204203
protocol Streamable : CustomStringConvertible {
205204
func writeTo<T: OutputStream>(target: [inout] T)
@@ -426,7 +425,7 @@ would also make ``OutputStream`` adapters a *bit* simpler to use
426425
because you'd never need to “write back” explicitly onto the target
427426
stream. However, stateful ``OutputStream`` adapters would still need a
428427
``close()`` method, which makes a perfect place to return a copy of
429-
the underlying stream, which can then be “written back.” :
428+
the underlying stream, which can then be “written back:
430429

431430
.. parsed-literal::
432431

docs/TypeChecker.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ and types generated from the primary expression kinds are:
319319
of some type.
320320

321321
**Ternary operator**
322-
A ternary operator``x ? y : z`` generates a number of
322+
A ternary operator ``x ? y : z`` generates a number of
323323
constraints. The type ``T(x)`` must conform to the ``LogicValue``
324324
protocol to determine which branch is taken. Then, a new type
325325
variable ``T0`` is introduced to capture the result type, and the
@@ -805,7 +805,7 @@ an overloaded function. Additionally, when comparing two solutions to
805805
the same constraint system, overload sets present in both solutions
806806
can be found by comparing the locators for each of the overload
807807
choices made in each solution. Naturally, all of these operations
808-
require locators to be uniqued, which occurs in the constraint system
808+
require locators to be unique, which occurs in the constraint system
809809
itself.
810810

811811
Simplifying Locators

docs/proposals/Error Handling.rst

Lines changed: 0 additions & 171 deletions
This file was deleted.

docs/proposals/OptimizerEffects.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Introduction
2020
This document formalizes the effects that functions have on program
2121
state for the purpose of facilitating compiler optimization. By
2222
modeling more precise function effects, the optimizer can make more
23-
assumptions leading to more agressive transformation of the program.
23+
assumptions leading to more aggressive transformation of the program.
2424

2525
Function effects may be deduced by the compiler during program
2626
analyis. However, in certain situations it is helpful to directly
@@ -919,5 +919,5 @@ Generally, a default-safe policy provides a much better user model
919919
from some effects. For example, we could decide that functions cannot
920920
affect unspecified state by default. If the user accesses globals,
921921
they then need to annotate their function. However, default safety
922-
dictates that any neccessary annotations should be introduced before
922+
dictates that any necessary annotations should be introduced before
923923
declaring API stability.

0 commit comments

Comments
 (0)