Commit Graph

1819 Commits

Author SHA1 Message Date
Max Moiseev
02006f20bc Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-09 16:05:03 -08:00
Brian Gesiak
c9000af795 Merge pull request #1526 from practicalswift/fix-pep8-violations-ii
[Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
2016-03-08 23:55:46 -05:00
Max Moiseev
1fae0d1325 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-08 12:48:48 -08:00
practicalswift
265835fdfc [Python] Use consistent import ordering for Python code
Ordering used:
1.) standard library imports
2.) third party imports
3.) local package imports

Each group is individually alphabetized.
2016-03-07 23:25:16 +01:00
practicalswift
183da818df [Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
2016-03-07 22:36:23 +01:00
practicalswift
f72f4a4831 Merge pull request #1551 from practicalswift/fix-comment-pep8
[Python] Improve block comment consistency
2016-03-07 21:59:28 +01:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
practicalswift
82a55c80e9 [gardening] Fix recently introduced typo: "conformace" → "conformance" 2016-03-07 09:22:29 +01:00
practicalswift
202ac537bb [gardening] Fix recently introduced typo: "becasue" → "because" 2016-03-07 08:08:45 +01:00
Dmitri Gribenko
26b51be546 StdlibRationales.rst: add explanation why sorted() is not lazy 2016-03-06 22:05:06 -08:00
Dmitri Gribenko
762dd1180d StdlibRationales.rst: add missing quotes 2016-03-06 21:59:37 -08:00
practicalswift
04afd6e640 [Python] Improve consistency: "block comment should start with '# '" (PEP-8) 2016-03-05 14:03:16 +01:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Adrian Prantl
cbef660eda Fix broken indentation in SIL.rst 2016-02-26 13:38:16 -08:00
Adrian Prantl
310b0433a9 Reapply "Serialize debug scope and location info in the SIL assembler language.""
This ireapplies commit 255c52de9f.

Original commit message:

Serialize debug scope and location info in the SIL assembler language.
At the moment it is only possible to test the effects that SIL
optimization passes have on debug information by observing the
effects of a full .swift -> LLVM IR compilation. This change enable us
to write targeted testcases for single SIL optimization passes.

The new syntax is as follows:

 sil-scope-ref ::= 'scope' [0-9]+
 sil-scope ::= 'sil_scope' [0-9]+ '{'
                 sil-loc
                 'parent' scope-parent
                 ('inlined_at' sil-scope-ref )?
               '}'
 scope-parent ::= sil-function-name ':' sil-type
 scope-parent ::= sil-scope-ref
 sil-loc ::= 'loc' string-literal ':' [0-9]+ ':' [0-9]+

Each instruction may have a debug location and a SIL scope reference
at the end.  Debug locations consist of a filename, a line number, and
a column number.  If the debug location is omitted, it defaults to the
location in the SIL source file.  SIL scopes describe the position
inside the lexical scope structure that the Swift expression a SIL
instruction was generated from had originally. SIL scopes also hold
inlining information.

<rdar://problem/22706994>
2016-02-26 13:28:57 -08:00
Adrian Prantl
255c52de9f Revert "Serialize debug scope and location info in the SIL assembler language."
Temporarily reverting while updating the validation test suite.

This reverts commit c9927f66f0.
2016-02-26 11:51:57 -08:00
Adrian Prantl
c9927f66f0 Serialize debug scope and location info in the SIL assembler language.
At the moment it is only possible to test the effects that SIL
optimization passes have on debug information by observing the
effects of a full .swift -> LLVM IR compilation. This change enable us
to write targeted testcases for single SIL optimization passes.

The new syntax is as follows:

 sil-scope-ref ::= 'scope' [0-9]+
 sil-scope ::= 'sil_scope' [0-9]+ '{'
                 sil-loc
                 'parent' scope-parent
                 ('inlined_at' sil-scope-ref )?
               '}'
 scope-parent ::= sil-function-name ':' sil-type
 scope-parent ::= sil-scope-ref
 sil-loc ::= 'loc' string-literal ':' [0-9]+ ':' [0-9]+

Each instruction may have a debug location and a SIL scope reference
at the end.  Debug locations consist of a filename, a line number, and
a column number.  If the debug location is omitted, it defaults to the
location in the SIL source file.  SIL scopes describe the position
inside the lexical scope structure that the Swift expression a SIL
instruction was generated from had originally. SIL scopes also hold
inlining information.

<rdar://problem/22706994>
2016-02-26 10:46:29 -08:00
Dmitri Gribenko
f3389273ba stdlib: String indices: samePositionIn(_:) => samePosition(in:) 2016-02-24 16:29:27 -08:00
Dmitri Gribenko
f0633ce5a9 stdlib: Sequence.iterator() => .makeIterator() 2016-02-23 13:52:30 -08:00
Dave Abrahams
158adab721 stdlib: Add 'invoke:' label to withVaList 2016-02-23 13:14:43 -08:00
Max Moiseev
fcad164e18 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-22 12:59:57 -08:00
Michael Gottesman
d6d30dbcb5 [gardening] Add doc stub for load_unowned/store_unowned in SIL.rst. 2016-02-21 19:04:27 -08:00
Dmitri Gribenko
f27315b6f8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-20 15:36:04 -08:00
Joe Groff
a1ef412815 Sema/SILGen: Get property behavior implementations to codegen.
Fix some interface type/context type confusion in the AST synthesis from the previous patch, add a unique private mangling for behavior protocol conformances, and set up SILGen to emit the conformances when property declarations with behaviors are visited. Disable synthesis of the struct memberwise initializer if any instance properties use behaviors; codegen will need to be redesigned here.
2016-02-20 15:01:06 -08:00
Dmitri Gribenko
3d3d4540e1 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-20 14:37:49 -08:00
Ted Kremenek
70e4fdc293 Merge pull request #1354 from johnantoni/master
Squash image assets.
2016-02-20 11:44:58 -08:00
Dmitri Gribenko
7e88bd7b2f stdlib: remove dead code 2016-02-20 02:30:46 -08:00
Michael Gottesman
436d6c2e61 [docs] Add stubs in SIL.rst for documentation for strong_pin/strong_unpin.
Not sure why this was never added...
2016-02-19 20:52:18 -08:00
practicalswift
4a815dd542 [gardening] Fix recently introduced typo: "decoarted" → "decorated" 2016-02-19 14:18:29 +01:00
Dmitri Gribenko
f39b443e24 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-19 01:16:19 -08:00
Dmitri Gribenko
0f36bec31f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-18 16:41:35 -08:00
Jordan Rose
70bda7c5db [docs] LibraryEvolution: This is about binary compatibility.
...and can't guarantee semantic compatibility. Make this clear in the
introduction, as noted by David Owens.
2016-02-18 15:33:59 -08:00
Jordan Rose
ef2474056b Merge pull request #1340 from practicalswift/remove-spaces-from-filenames
[gardening] Use consistent naming of .rst files in docs/ ("CamelCase.rst")
2016-02-18 09:44:32 -08:00
Joe Groff
ae0e855aaf Revert "Runtime: Remove retainCount entry points."
This reverts commit 51e0594e1c. The retainCount
entry points are used by Instruments.
2016-02-18 09:38:23 -08:00
John Griffiths
a3546e66a4 Compress assets. 2016-02-18 12:31:59 -05:00
practicalswift
5d24d87d81 [gardening] Use consistent naming of .rst files in docs/ ("CamelCase.rst")
Fix some cases where "Camel Case.rst" is used instead of "CamelCase.rst".

File counts:
* Files in repo: 10 242
* Files in repo with spaces in file name: 10
* Files in repo with .rst suffix: 74
* Files in repo with .rst suffix and spaces in file name: 10

In addition to the consistency argument: spaces in file names create unnecessary
gotchas when it comes to bash scripting - see below.

Before this commit:

```
$ find . -name "*.rst" | xargs ls -dl > /dev/null
ls: cannot access ./docs/Dependency: No such file or directory
ls: cannot access Analysis.rst: No such file or directory
ls: cannot access ./docs/proposals/ObjC: No such file or directory
ls: cannot access Interoperation.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Argument: No such file or directory
ls: cannot access Interop.rst: No such file or directory
ls: cannot access ./docs/proposals/archive/Memory: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Concurrency: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Interop: No such file or directory
ls: cannot access Language: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/rejected/Bridging: No such file or directory
ls: cannot access Container: No such file or directory
ls: cannot access Protocols: No such file or directory
ls: cannot access to: No such file or directory
ls: cannot access Class: No such file or directory
ls: cannot access Clusters.rst: No such file or directory
ls: cannot access ./docs/archive/Namespace: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Vars: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Top: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Code.rst: No such file or directory
ls: cannot access ./docs/archive/Objective-C: No such file or directory
ls: cannot access Interoperability.rst: No such file or directory
ls: cannot access ./docs/Pattern: No such file or directory
ls: cannot access Matching.rst: No such file or directory
ls: cannot access ./docs/Failable: No such file or directory
ls: cannot access Initializers.rst: No such file or directory
$
```

After this commit:

```
$ find . -name "*.rst" | xargs ls -dl > /dev/null
$
```
2016-02-18 10:46:53 +01:00
John McCall
e249fd680e Destructure result types in SIL function types.
Similarly to how we've always handled parameter types, we
now recursively expand tuples in result types and separately
determine a result convention for each result.

The most important code-generation change here is that
indirect results are now returned separately from each
other and from any direct results.  It is generally far
better, when receiving an indirect result, to receive it
as an independent result; the caller is much more likely
to be able to directly receive the result in the address
they want to initialize, rather than having to receive it
in temporary memory and then copy parts of it into the
target.

The most important conceptual change here that clients and
producers of SIL must be aware of is the new distinction
between a SILFunctionType's *parameters* and its *argument
list*.  The former is just the formal parameters, derived
purely from the parameter types of the original function;
indirect results are no longer in this list.  The latter
includes the indirect result arguments; as always, all
the indirect results strictly precede the parameters.
Apply instructions and entry block arguments follow the
argument list, not the parameter list.

A relatively minor change is that there can now be multiple
direct results, each with its own result convention.
This is a minor change because I've chosen to leave
return instructions as taking a single operand and
apply instructions as producing a single result; when
the type describes multiple results, they are implicitly
bound up in a tuple.  It might make sense to split these
up and allow e.g. return instructions to take a list
of operands; however, it's not clear what to do on the
caller side, and this would be a major change that can
be separated out from this already over-large patch.

Unsurprisingly, the most invasive changes here are in
SILGen; this requires substantial reworking of both call
emission and reabstraction.  It also proved important
to switch several SILGen operations over to work with
RValue instead of ManagedValue, since otherwise they
would be forced to spuriously "implode" buffers.
2016-02-18 01:26:28 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Jordan Rose
11ff7157ff [docs] LibraryEvolution: Dmitri's feedback for @always_emit_into_client.
The main change is that @always_emit_into_client is now not considered a
versioned attribute: either you use it up front and the entity is not part
of your ABI, or you don't and it is. Everything else falls out from that.
2016-02-16 12:10:59 -08:00
practicalswift
6b8d231575 [gardening] Fix recently introduced typo: "an function" → "a function" 2016-02-16 09:53:07 +01:00
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Jordan Rose
b39cebd6fc [docs] LibraryEvolution: @always_emit_into_client
Describe a new attribute, @always_emit_into_client, which covers the
behavior of helpers for inlineable functions: any client that makes use
of the body of an inlineable function should use that implementation,
including any helper functions, local functions, or closures referenced
therein. This is also a tool a library developer can use.

This is a nice change because it formalizes several things that were
previously special-cased; however, there are still some open questions.

It's not totally clear whether we want separate @inlineable and
@always_emit_into_client annotations; we could attempt to get away with
just the latter. However, as noted in the diff, there are some entities
that can't really be completely eliminated from the ABI, so marking them
@always_emit_into_client would be disingenuous.
2016-02-15 19:17:16 -08:00
Max Moiseev
a558d13a3b Revert "Replace Unmanaged with UnsafeReference"
This reverts commit d72932e931.
2016-02-15 17:13:40 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Dmitri Gribenko
226ab38888 CMake / lit: add a mode to run only executable tests
This allows us to quickly run tests affected by implementation-only
standard library changes.
2016-02-12 22:50:42 -08:00
Jordan Rose
9c37cb6a7b [Sphinx] Fix the copyright year to always be the current year.
This is what we were doing manually anyway.
2016-02-12 18:43:15 -08:00
Jordan Rose
a5ce1391bd [docs] LibraryEvolution: Address smaller feedback points.
...from JoeG, Dmitri, and David Owens.

- Add an explicit section on default arguments.
- Replace the phrase "permitted but discouraged" with a new and stronger
  term "binary-compatible source-breaking change". This may need more
  work but it is an improvement.
- Mark that we could make converting get-only 'var' to 'let' safe.
- Adding a required convenience init is safe with certain restrictions.
- Add some more related proposals.
- Add a todo list for more substantive changes and ongoing discussion.
- Assorted clarifications and typo fixes.
2016-02-12 18:30:03 -08:00
Mark Lacey
bd30572f80 Minor clean-up of -assert-config option handling.
* Replace 'Fast' with 'Unchecked' everywhere.
* Update the help text to specify DisableReplacement rather than
  Replacement and to document Unchecked.
* Simplify tests slightly and add a tests for Unchecked.
2016-02-12 15:10:45 -08:00
practicalswift
383b6b746e [gardening] Fix recently introduced typo: "overrideable" → "overridable" 2016-02-09 22:46:12 +01:00
Prayag Verma
0f3c384c72 Fix a typo
Remove extra `to`
2016-02-09 20:05:48 +05:30