Commit Graph

1819 Commits

Author SHA1 Message Date
Jordan Rose
b0f94ed4b7 [docs] LibraryEvolution: Make code snippets more concrete, take 2.
Missed a spot.
2016-02-08 17:21:15 -08:00
Jordan Rose
3737ce7beb [docs] LibraryEvolution: Make code snippets more concrete.
...by giving all the types silly magic-themed names, rather than just
'Base' or 'SomeProto'. That makes a (mostly) consistent theme throughout
the document, and hopefully makes it easier to have a mental model
about what various changes mean.
2016-02-08 17:20:28 -08:00
Jordan Rose
d58b14db70 [docs] LibraryEvolution: Remove the "draft" warning.
Not that it won't continue to change, but it's moving from "we're
working things out" to "basically the plan of record". Time to ask for
feedback!
2016-02-08 16:59:10 -08:00
Jordan Rose
2c1e329233 [docs] LibraryEvolution: Add some known problematic scenarios.
These are pretty sketchy, but they do cause issues.
2016-02-08 16:27:54 -08:00
Jordan Rose
0db4f95527 [docs] LibraryEvolution: Allow adding associated types.
We're going to try to do this.
2016-02-08 16:27:54 -08:00
Jordan Rose
0be8afe114 [docs] LibraryEvolution: Assorted edits.
Filling out some sections, wordsmithing others, moving things around.
2016-02-07 10:12:50 -08:00
Jordan Rose
dc04ebf9b1 [docs] LibraryEvolution: Backdating rules don't apply to SPI.
...if we had such a feature, anyway.
2016-02-07 10:12:50 -08:00
Jordan Rose
a53ebe7681 [docs] LibraryEvolution: Initializers need to enforce DI.
...so they usually can't be inlineable. Explain which ones can and which
ones can't.
2016-02-07 10:12:50 -08:00
Jordan Rose
005b6eba79 [docs] LibraryEvolution: Add a section on backdating. 2016-02-07 10:12:49 -08:00
practicalswift
7127018255 [gardening] Fix recently introduced typo: "overrideable" → "overridable" 2016-02-06 10:41:13 +01:00
Slava Pestov
bbbe307980 SIL: Introduce SILDefaultWitnessTable and start plumbing
This will be used to help IRGen record protocol requirements
with resilient default implementations in protocol metadata.

To enable testing before all the Sema support is in place, this
patch adds SIL parser, printer and verifier support for default
witness tables.

For now, SILGen emits empty default witness tables for protocol
declarations in resilient modules, and IRGen ignores them when
emitting protocol metadata.
2016-02-05 20:57:11 -08:00
Jordan Rose
6e4599ca01 [docs] LibraryEvolution: Discuss nominal members explicitly.
I realized "members are mostly the same as their top-level equivalents" is worth
calling out explicitly, especially for subscripts and initializers without top-level
equivalents. There's still a hole here for members of protocol extensions, which can
have pretty drastic effects on conforming types.
2016-02-05 20:48:15 -08:00
Jordan Rose
d0ccc987af [docs] LibraryEvolution: Add a discussion of deployments.
I could explain that here, but it's all in the new section. :-)
2016-02-05 18:19:33 -08:00
Jordan Rose
33756a53b2 [docs] LibraryEvolution: s/proposal/document/
"Proposal" refers to something going through the Swift Evolution Process,
which this won't as such. (Although it does have many pieces affected by
proposals, as described at the end of the document.)
2016-02-05 16:35:13 -08:00
Jordan Rose
a062186d5e [docs] LibraryEvolution: Fill out the section on fixed-contents classes.
Basically, elaborate on why it's not important right now. Also, drop the
section on limiting the addition of new vtable-dispatched methods. That's
not something we're really interested in.
2016-02-05 16:35:13 -08:00
Jordan Rose
cb87705fe4 [docs] LibraryEvolution: Point out a Central Tenet of Swift:
The Default Behavior Should Be Safe

Also, remove the line about "providing tools to check changes", because
it no longer fits in the prologue flow and isn't core to the model.
The section on it is good enough.
2016-02-05 11:54:35 -08:00
Dmitri Gribenko
27be1ab257 build-script: allow to run host-side iOS tests
This change allows to easily run iOS tests that require only running the
compiler, and don't require running the generated code.
2016-02-04 17:19:12 -08:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Jordan Rose
65155cba0d [docs] LibraryEvolution: Member typealiases affect ABI.
Thanks, Dmitri!
2016-02-04 13:41:24 -08:00
Dmitri Gribenko
c62dde514b Merge pull request #1198 from practicalswift/typo-fixes-20160204
[gardening] Fix recently introduced typos: "overrideable" → "overridable", "additioned" → "addition"
2016-02-04 09:16:04 -08:00
practicalswift
59737e4781 [gardening] Fix recently introduced typo: "additioned" → "addition" 2016-02-04 12:56:52 +01:00
practicalswift
c53bd4d3cb [gardening] Fix recently introduced typo: "overrideable" → "overridable" 2016-02-04 12:05:35 +01:00
Jordan Rose
10f2c9ac5a [docs] LibraryEvolution: Add a section on minimum library versions. 2016-02-03 19:08:51 -08:00
Jordan Rose
9af119d9ce [docs] LibraryEvolution: Add information about attributes.
I went through the list of attributes and declaration modifiers and
made sure they were all accounted for. Anything not on the list
should be assumed restricted, as mentioned at the top of the
"Supported Evolution" section.
2016-02-03 17:14:39 -08:00
Jordan Rose
e01d29b170 [docs] LibraryEvolution: Add missing related proposal.
"Overridable methods in extensions"
2016-02-03 17:14:39 -08:00
David Farler
a6a5ece206 IRGen: Emit type references for remote reflection
- Implement emission of type references for nominal type field
  reflection, using a small custom encoder resulting in packed
  structs, not strings. This will let us embed 7-bit encoded
  32-bit relative offsets directly in the structure (not yet
  hooked in).
- Use the AST Mangler for encoding type references
  Archetypes and internal references were complicating this before, so we
  can take the opportunity to reuse this machinery and avoid unique code
  and new ABI.

Next up: Tests for reading the reflection sections and converting the
demangle tree into a tree of type references.

Todo: For concrete types, serialize the types for associated types of
their conformances to bootstrap the typeref substitution process.

rdar://problem/15617914
2016-02-03 13:52:26 -08:00
Jordan Rose
a83089bce3 [docs] LibraryEvolution: List out related proposals.
...most of which don't exist yet. These are things that need to go
through the Swift Evolution Process and ultimately be accepted or
rejected before we have final answers on some parts of the document.
2016-02-02 18:20:29 -08:00
Ted Kremenek
af3f8ec990 Merge pull request #173 from DaKnOb/image-optim
Optimize Documentation Images to Save Bandwidth
2016-02-02 18:17:42 -08:00
Jordan Rose
b9ef11e703 [docs] LibraryEvolution: Typealiases are compile-time constructs.
...and therefore unversioned.
2016-02-02 17:41:29 -08:00
Jordan Rose
ef62e38726 [docs] LibraryEvolution: Keep a list item together with a note.
The third item was added to this list without looking at the note.
2016-02-02 17:41:29 -08:00
Jordan Rose
7df2f13d00 [docs] LibraryEvolution: Resolve several TODOs by fiat.
The heuristic here is mostly "err on the side of a simpler document".
2016-02-01 15:04:20 -08:00
Doug Gregor
7c0e087cd5 [SIL] Extend the string_literal instruction with an 'objc_selector' encoding.
As part of SE-0022, introduce an 'objc_selector' encoding for string
literals that places the UTF-8 string literal into the appropriate
segment for uniquing of Objective-C selector names.
2016-01-27 13:57:40 -08:00
Jordan Rose
8aebe8d864 [docs] LibraryEvolution: Public members get a default version.
Specifically, public members (and nested types) within a versioned type are
assumed to be present on the outer type since its introduction unless otherwise
specified. (This saves boilerplate for a type's initial API.)
2016-01-26 17:45:30 -08:00
Jordan Rose
3a7e511eeb [docs] LibraryEvolution: To remove an override, the type must match exactly.
Thanks, Slava!
2016-01-26 17:45:29 -08:00
Slava Pestov
19fe31fde9 IRGen: Emit and use accessors for generic type metadata
Instead of directly emitting calls to swift_getGenericMetadata*() and
referencing metadata templates, call a metadata accessor function
corresponding to the UnboundGenericType of the NominalTypeDecl.

The body of this accessor forwards arguments to a runtime metadata
instantiation function, together with the template.

Also, move some code around, so that metadata accesses which are
only done as part of the body of a metadata accessor function are
handled separately in emitTypeMetadataAccessFunction().

Apart from protocol conformances, this means metadata templates are
no longer referenced from outside the module where they were defined.
2016-01-26 16:00:54 -08:00
Jordan Rose
4f4ec2c48a [docs] LibraryEvolution: Bring back "fixed-size" as a perf assertion. 2016-01-25 16:43:19 -08:00
Jordan Rose
9df9ee9d72 [docs] LibraryEvolution: Weaken "fixed-layout" structs to "fixed-contents".
This drops the requirement that a fixed-layout struct only contain fixed-size
things (which wasn't specified correctly anyway). Slava and Dmitri both
pointed out that the previous definition had several flaws, including not
really scaling to generics. This reduced version only promises that stored
instance properties won't be added, removed, or modified, which is still
enough to do useful optimizations. And in most cases, we'll be able to
infer the full "fixed-size" property of a type from this attribute anyway.

The name "fixed-contents" was chosen to force us to pick a better name later.

The next commit will bring back the "fixed-size" property as a performance
assertion.
2016-01-25 16:43:19 -08:00
Jordan Rose
812dbbb3c2 [docs] LibraryEvolution: Eliminate the @fixed property attribute.
After talking to Slava, it seems like this really is the same guarantee
as @inlineable on a property. See also the next commit.
2016-01-25 16:43:19 -08:00
Jordan Rose
873e0230e8 [docs] LibraryEvolution: Move "Versioning Internal Decls" to the end.
Now that we've decided to allow using versioned internal types in
fixed-layout structs, this isn't just about inlineable functions anymore.

No content change.
2016-01-25 16:43:19 -08:00
practicalswift
71e00fefa1 [gardening] Fix typos: "word word" (two spaces) → "word word" (one space) 2016-01-24 21:27:16 +01:00
practicalswift
4b0571bae8 [gardening] Fix documentation typos 2016-01-24 12:52:01 +01:00
practicalswift
33452564f6 PEP8: Fix violations of type "continuation line under-indented for hanging indent" (E121) 2016-01-24 09:47:53 +01:00
practicalswift
84a31184c7 PEP8: Fix all violations of type "missing whitespace after ','" (E231) 2016-01-24 09:40:32 +01:00
Ted Kremenek
5699bc67d4 Merge pull request #1003 from practicalswift/adhere-to-subset-of-pep8-iii
[gardening] Fix violations of non-controversial PEP8 rules
2016-01-23 16:38:43 -08:00
Marat S
119d501f23 Fix lowercase 'Void' 2016-01-23 23:39:47 +03:00
practicalswift
1cd4d4e9c9 [gardening] Fix violations of non-controversial PEP8 rules
Fixes:
* multiple statements on one line (colon) (E701)
* missing whitespace around arithmetic operator (E226)
* missing whitespace around operator (E225)
* closing bracket does not match visual indentation (E124)
* blank line contains whitespace (W293)
* continuation line missing indentation or outdented (E122)
* continuation line over-indented for hanging indent (E126)
* missing expected blank line (E301)
* trailing whitespace (W291)
* unexpected spaces around keyword / parameter equals (E251)
* whitespace after '(', '[' or '{' (E201)
* whitespace before ')', ']' or '}' (E202)
* whitespace before ',' or ':' (E203)
2016-01-23 09:23:33 +01:00
Marat S
32154de115 fix typo 2016-01-23 07:41:25 +03:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Jordan Rose
da7326b07f [docs] LibraryEvolution: All public entities must be versioned. 2016-01-21 18:26:53 -08:00
Jordan Rose
bd12f0c0f3 [docs] LibraryEvolution: Be more precise about "public".
...as Slava pointed out, many times it means "versioned". I chose to
leave several things as "non-public, non-versioned" even though "non-
versioned" is sufficient (a versioned library may not have unversioned
public API) because "non-public" is something people instinctively
understand.
2016-01-21 18:26:53 -08:00