Commit Graph

4421 Commits

Author SHA1 Message Date
Joe Groff
d04b9d4da9 C Argument Interop: Fill in some examples.
Swift SVN r15207
2014-03-18 22:36:13 +00:00
Joe Groff
f557ca8181 Update ABI.rst to move down fields in nominal type descriptor after r15194.
Swift SVN r15196
2014-03-18 17:53:06 +00:00
Joe Groff
c431509516 IRGen: Reserve a spot in the nominal type descriptor for the field type vector accessor.
Building the field type vector is potentially expensive and the vector isn't needed unless we do reflectiony things to a type, so let's use a lazy accessor. Make room for it, but don't populate it yet, so we can deal with fallout from the metadata layout change.

Swift SVN r15194
2014-03-18 17:30:31 +00:00
Joe Groff
f831a0609a Stock sphinx isn't happy about :math: or the lack of a favicon in docs/.
Make a fake empty favicon.ico and remove wanton math markup to quell Sphinx warnings.

Swift SVN r15165
2014-03-17 23:04:09 +00:00
Joe Groff
5888345330 Update "C Pointer Interop" proposal.
Focus on the immediate problem of handling arguments. Describe the desired user model followed by the necessary language features to support the user model using library implicit conversions.

Swift SVN r15161
2014-03-17 22:23:19 +00:00
Doug Gregor
3cc834714c SILGen for initialization using an existential metatype value.
Loosen the restrictions on open_existential_ref to also allow it to
refer to an existential metatype. When it does, open_existential_ref
returns the metatype for the opened archetype.



Swift SVN r15113
2014-03-16 20:52:54 +00:00
John McCall
794360d312 Permit optional class types to be returned autoreleased.
Swift SVN r15042
2014-03-14 07:10:10 +00:00
Dave Abrahams
4ac6bebe94 [stdlib] Rename StreamOf => GeneratorOf
This change is overdue from the renaming of Stream to Generator

Swift SVN r14971
2014-03-12 22:27:38 +00:00
Dmitri Hrybenko
b584eaac7d Update LangRef and simplify code completion test for value -> newValue change
Swift SVN r14954
2014-03-12 07:14:32 +00:00
Joe Groff
b8d48dd7bb Change 'x.type' to 'x.dynamicType'.
It's not a common operation, so it doesn't need a terse name that occupies valuable identifier real estate.

Swift SVN r14932
2014-03-11 23:18:33 +00:00
Joe Groff
b08f06f191 Revert "Accept (and prefer) "import type" as a scoped import for any non-protocol type."
This reverts commit r14488, since we're demoting 'type' back to a plain old identifier.

We could consider reallowing 'type' as a contextual keyword here, but from talking to Jordan he was OK with just reverting this functionality.

Swift SVN r14931
2014-03-11 23:18:30 +00:00
Dmitri Hrybenko
866511e27d Add mangling for SubscriptDecls to allow us to produce USRs for them
<rdar://problem/16237251> USR generator skips SubscriptDecls


Swift SVN r14923
2014-03-11 18:03:04 +00:00
John McCall
a9443d72f8 Parse attributes as part of <type> and simplify the grammar.
This means that we accept type attributes in a much broader
range of places where we previously required a <type>.  <type>
was already a production that demanded a grammatically
unconstrained context because of all the possible continuations;
reducing the number of independent productions makes it easier
to choose one and thus not accidentally limit the range of
possible types parsed.

In particular, we want to be able to parse @unchecked T? pretty
much anywhere you can write a type.

Swift SVN r14912
2014-03-11 07:59:22 +00:00
Joe Groff
945fbaf167 SIL: Add a linkage specifier to SILWitnessTables.
In the short term, we need to be able to emit shared symbols for SILWitnessTables corresponding to Clang-imported modules, and soon, the generic specializer will need to be able to reference *_external witness tables deserialized from library modules.

Swift SVN r14887
2014-03-10 23:14:16 +00:00
Dmitri Hrybenko
a3dd6db4b5 LangRef: update for new syntax: didSet(oldValue)
Swift SVN r14847
2014-03-09 15:48:34 +00:00
Michael Gottesman
2c1cb3977d Add some documentation to SIL.rst for sil_global_addr and sil_global so that they at least have something documented. rdar://15509316.
Swift SVN r14793
2014-03-07 21:06:49 +00:00
Joe Groff
dae75e04d6 Update LangRef for 'type' and quoted identifier changes.
Swift SVN r14684
2014-03-05 16:44:05 +00:00
Doug Gregor
82c1ba2e29 Remove peer_method instruction; we're no longer using it.
Swift SVN r14599
2014-03-03 17:13:06 +00:00
Doug Gregor
5d8bd84dfa Introduce the SIL instruction alloc_ref_dynamic.
alloc_ref_dynamic allocates an instance of a class type based on the
value in its metatype operand. Start emitting these instructions for
the allocating constructor of a complete object initializer (not yet
tested) and for the allocating constructor synthesized for an imported
Objective-C init method.

Still missing:
  - IRGen still does the same thing as alloc_ref right now. That
  change will follow.
  - There are devirtualization opportunities when we know the value of
  the metatype that would turn an alloc_ref_dynamic into an alloc_ref;
  I'm not planning to do this optimization.



Swift SVN r14560
2014-03-01 21:55:50 +00:00
Doug Gregor
571ae697d5 Parsing and AST support for complete object initializers.
Enforce that complete object initializers always be delegating.

Swift SVN r14549
2014-03-01 00:51:18 +00:00
Chris Lattner
0f6c14cee3 fix typo
Swift SVN r14522
2014-02-28 17:01:02 +00:00
Joe Groff
67ca7ce1e9 SIL: Rename 'protocol_metatype' to 'existential_metatype'.
It's not forming the metatype for the protocol type (exists t: P. t).metatype, it's forming the existential of a metatype of a conforming type, exists t: P. (t.metatype).

Swift SVN r14520
2014-02-28 16:14:00 +00:00
Dmitri Hrybenko
158acafbdc Documentation comment proposal: add summary from the meeting
Swift SVN r14517
2014-02-28 15:06:20 +00:00
Joe Groff
9424de6787 SIL: Rename 'archetype_metatype' to 'value_metatype'.
Since it can grab a metatype from any value now.

Swift SVN r14500
2014-02-28 06:33:05 +00:00
Joe Groff
545f173507 SIL: Fold 'archetype_metatype' and 'class_metatype'.
Having one instruction to get the dynamic metatype of a (non-existential) value makes more sense from a generic specialization standpoint and should stave off inevitable crashers when archetype_metatypes get specialized. protocol_metatype remains separate because metatype existentials are more interesting.

Swift SVN r14499
2014-02-28 06:32:58 +00:00
Joe Groff
59d2a169f6 SIL: Rename 'archetype_method' to 'witness_method'.
It has been generalized to get a witness out of an arbitrary protocol conformance, not just for archetypes.

Swift SVN r14497
2014-02-28 05:09:11 +00:00
Joe Groff
855ea99063 SIL: Combine 'archetype_ref_to_super' and 'upcast'.
We were wantonly applying 'upcast' to archetypes in some cases, and really, that's OK, since these instructions do the same thing (and generic specialization could turn archetype_ref_to_super into upcast). Make everyone's life easier by folding archetype_to_super into upcast. Fixes <rdar://problem/16192324>.

Swift SVN r14496
2014-02-28 04:33:18 +00:00
Doug Gregor
a861f9c2c8 Initializer inheritance proposal.
Swift SVN r14489
2014-02-28 00:41:02 +00:00
Jordan Rose
1fe8630bcd Accept (and prefer) "import type" as a scoped import for any non-protocol type.
Previously this was spelled "import typealias", and that spelling will
continue to be allowed (since someone may specifically be importing a
typealias and want that to match), but now that 'type' is a keyword,
"import type" is the right way to spell the generic "import any type"
scoped import.

Swift SVN r14488
2014-02-27 23:46:06 +00:00
Chris Lattner
25f9ebf958 fix a typo
Swift SVN r14464
2014-02-27 18:43:41 +00:00
Joe Groff
4e87971d81 Disallow bare type references.
Diagnose a metatype reference that doesn't appear as part of a call or member reference, offering fixits to either default-construct the type or get at the metatype explicitly using '.self'. Also diagnose an attempt to refer to 'T.type' by fixiting it to '.self'.

Swift SVN r14433
2014-02-27 00:22:02 +00:00
Doug Gregor
1e8f02a45d Start diagnosing "deinit () { }".
Now that we do this, update the standard library, tests, other documents, etc.

Swift SVN r14423
2014-02-26 23:01:25 +00:00
Doug Gregor
dd143263eb Accept the "deinit { }" syntax, but don't require it.
Improve the Fix-It for the older "destructor" syntax so that it
replaces "destructor ()" with "deinit".

Swift SVN r14419
2014-02-26 22:42:14 +00:00
Chris Lattner
1344319677 Rename the internal compiler lexicon from val -> let.
Swift SVN r14408
2014-02-26 21:21:18 +00:00
Chris Lattner
90708473f7 switch some dox back to 'let'
Swift SVN r14400
2014-02-26 18:41:12 +00:00
Doug Gregor
981f8f6509 Rename "destructor" -> "deinit" (as a keyword) and -> "deinitializer" (in diagnostics).
Swift SVN r14380
2014-02-26 05:51:45 +00:00
Doug Gregor
0bde325327 Collapse 'DynamicSelf' into 'Self'.
Swift SVN r14377
2014-02-26 05:04:05 +00:00
Joe Groff
98d6fecc99 '.metatype' -> '.Type'
Also, reserve 'type' as a keyword for ensuing syntax changes.

Swift SVN r14375
2014-02-26 04:23:21 +00:00
Joe Groff
89807a939e Mangle the protocol constraints on associated types in GenericParamLists.
A short-term fix to <rdar://problem/16079822> that keeps generic overloads from creating symbol collisions without requiring a larger migration of the debugger or other tools.

Swift SVN r14353
2014-02-25 21:56:04 +00:00
Dave Abrahams
11cc0fc26a [stdlib] Fix formatting of new property decls
Swift SVN r14321
2014-02-24 23:19:46 +00:00
Dave Abrahams
42e82dfe1b [stdlib] startIndex/endIndex are now properties
Use Chris' totally cool property requirements feature as it has long
been intended.

Swift SVN r14317
2014-02-24 22:21:03 +00:00
Dmitri Hrybenko
f42a354794 Add a proposal about documentation comments
Swift SVN r14297
2014-02-24 11:45:51 +00:00
Dmitri Hrybenko
3da05e347d Change property accessor syntax to include braces
See release notes update for details.

rdar://15966905


Swift SVN r14271
2014-02-22 21:00:56 +00:00
Dmitri Hrybenko
b34d91da7c Remove obsolete document that is going to be superseded by DevPubs'
recommendations


Swift SVN r14269
2014-02-22 20:28:36 +00:00
Michael Gottesman
52da67589d Update SIL.rst with information about Typed Access TBAA.
This allows the optimizer to use the type information from loads, stores,
and address projections to disambiguate pointers. This will allow for
significantly more aggressive load/store forwarding of the “owning pointer”
pattern in the std lib by enabling the disambiguation of loads/stores of the
owning pointer that feed into retains/releases from loads/stores of the structs
data. This is a pervasive pattern seen in such important structs as Array,
String, and many others.

Swift SVN r14210
2014-02-21 17:17:26 +00:00
Dmitri Hrybenko
c2db9a5ff0 Convert the section about subscript decls to ReST, since grammar here will
require updates as well


Swift SVN r14150
2014-02-20 14:40:23 +00:00
Dmitri Hrybenko
7fcbd1bffd LangRef: convert a section on var decls to ReST, since I am going to edit it to
change the getter/setter syntax (rdar://15966905)


Swift SVN r14148
2014-02-20 13:42:37 +00:00
Greg Parker
726c6c75ce Fix docs build after r14116.
Swift SVN r14122
2014-02-20 01:39:08 +00:00
Ted Kremenek
46040d1640 Remove StyleGuide.rst. This isn't the one DevPubs is working on.
I'm speaking with Tim Isted offline about the next steps.

Swift SVN r14116
2014-02-20 00:13:24 +00:00
Dave Abrahams
020949d7b7 [styleguide] Add "work in progress" warning
We know that further edits are forthcoming from DevPubs; we just don't
know when.  Make sure nobody mistakes this for a DevPubs-approved draft.

Swift SVN r14102
2014-02-19 21:41:20 +00:00