Commit Graph

1009 Commits

Author SHA1 Message Date
Chris Lattner
afea47b621 rename "destroy_value" to "release_value", part of rdar://15889208.
Swift SVN r15777
2014-04-02 05:33:52 +00:00
Chris Lattner
6540423613 rename CopyValueInst -> RetainValueInst. The .sil syntax
isn't changed yet.


Swift SVN r15775
2014-04-02 05:11:31 +00:00
Chris Lattner
61de944e51 typographical changes.
Swift SVN r15721
2014-04-01 05:00:37 +00:00
John McCall
f1180f5e6d in order to work correctly for non-@objc protocols.
Language features like erasing concrete metatype
values are also left for the future.  Still, baby steps.

The singleton ordinary metatype for existential types
is still potentially useful; we allow it to be written
as P.Protocol.

I've been somewhat cavalier in making code accept
AnyMetatypeType instead of a more specific type, and
it's likely that a number of these places can and
should be more restrictive.
When T is an existential type, parse T.Type as an
ExistentialMetatypeType instead of a MetatypeType.

An existential metatype is the formal type
 \exists t:P . (t.Type)
whereas the ordinary metatype is the formal type
 (\exists t:P . t).Type
which is singleton.  Our inability to express that
difference was leading to an ever-increasing cascade
of hacks where information is shadily passed behind
the scenes in order to make various operations with
static members of protocols work correctly.

This patch takes the first step towards fixing that
by splitting out existential metatypes and giving
them a pointer representation.  Eventually, we will
need them to be able to carry protocol witness tables

Swift SVN r15716
2014-04-01 00:38:28 +00:00
Joe Groff
2c804dabe2 Update failable initializers proposal.
Use the ``init() -> T?`` return type syntax we introduced for whole-object initializers, and limit the scope of initializer failure to @objc initializers; we don't need to be able to initiate initializer failure from Swift for 1.0.

Swift SVN r15703
2014-03-31 23:06:48 +00:00
Joe Groff
584009d27e SIL: Remove copy_value's result.
We won't have any types where copying has an effect on the bit pattern (except for blocks, which need special handling anyway), and copy_value having a result makes optimizations more complex, so remove it.

Swift SVN r15640
2014-03-30 03:40:45 +00:00
Joe Groff
ad1297a094 [sooner] Save some thoughts about generators.
Swift SVN r15624
2014-03-29 17:30:04 +00:00
Joe Groff
afd59130f0 SIL: Add a FixLifetime instruction.
This will be a signal to ARC optimization, RVO, and other lifetime-affecting optimizations that they should not shorten the lifetime of a value past a certain point. We need this for C pointer bridging. This adds the instruction, but does not add any knowledge of it to the ARC optimizers.

Swift SVN r15601
2014-03-29 02:50:34 +00:00
Mark Lacey
cae8562ff7 Reformat for 80 columns.
Swift SVN r15515
2014-03-26 19:28:02 +00:00
Mark Lacey
78931ea27b Fix typo: addres -> address
Swift SVN r15514
2014-03-26 19:28:02 +00:00
Dmitri Hrybenko
06175089ca LangRef: add array and dictionary literal syntax
Swift SVN r15507
2014-03-26 12:08:45 +00:00
Doug Gregor
2477afe657 Rework the section on "dropping prepositions" to be more specific
Swift SVN r15464
2014-03-25 20:26:13 +00:00
Doug Gregor
2c94b6a259 Make it clearer that we're planning to drop "with" and "for".
Swift SVN r15463
2014-03-25 16:43:17 +00:00
Doug Gregor
751d5bd0f1 Reword and clarify an awful paragraph.
Swift SVN r15459
2014-03-25 16:28:30 +00:00
Doug Gregor
0e4044041f Take Jordan's suggestion to rename @selector(...) to @objc(...).
Swift SVN r15426
2014-03-24 22:49:55 +00:00
Doug Gregor
c5ffbcacc7 Fix a few typos
Swift SVN r15425
2014-03-24 22:47:51 +00:00
Doug Gregor
059a549e84 Formatting fixes.
Swift SVN r15424
2014-03-24 22:32:49 +00:00
Doug Gregor
ee599c0bdd Objective-C and Smalltalk don't have keyword arguments per se
Swift SVN r15423
2014-03-24 22:32:47 +00:00
Doug Gregor
a586b6d31d Unified function syntax: switch to space-separated API name / parameter name.
Swift SVN r15420
2014-03-24 17:55:22 +00:00
Doug Gregor
c3183aec70 Remove "by" as a dropped preposition (it's still a preposition).
In Cocoa selectors, "by" is often used before an action, i.e.,

  URLByAppendingPathExtension:
  characterRangeByExtendingPosition:inDirection:
  dateByAddingComponents:toDate:options:

Dropping the preposition doesn't make the argument name better.

Swift SVN r15417
2014-03-24 16:38:40 +00:00
Doug Gregor
e4260da123 Remove useless "dropped?" entries from the table.
Swift SVN r15415
2014-03-24 16:06:20 +00:00
Doug Gregor
41ca928cfc Selector splitting: kick "over", "per", and "without" off the island.
These prepositions are used in Cocoa, but result in crummy or useless splits.

Swift SVN r15414
2014-03-24 16:04:35 +00:00
Doug Gregor
e85e10690a Un-fuse two lines
Swift SVN r15409
2014-03-24 15:30:02 +00:00
Doug Gregor
4e0f866a4b Add a section on dropping leading prepositions "by", "for", "with".
Swift SVN r15408
2014-03-24 15:27:16 +00:00
Doug Gregor
b4e859b3c0 Fix typo "migreate"
Swift SVN r15407
2014-03-24 14:36:36 +00:00
Doug Gregor
6895597eba Re-order comment about in-compiler selector->method name mappings.
Swift SVN r15406
2014-03-24 14:35:17 +00:00
Doug Gregor
590aae3f0d Note that we need a mapping in the compiler from selectors to method names.
Swift SVN r15405
2014-03-24 14:31:06 +00:00
Doug Gregor
f78cf35e37 Unified function syntax proposal: reflow to split paragraphs for diff'ability. NFC
Swift SVN r15404
2014-03-24 14:27:43 +00:00
Doug Gregor
c4b0a7daee Unified function syntax: distinguish "argument name" from "parameter name".
Swift SVN r15377
2014-03-23 05:19:11 +00:00
Doug Gregor
bf5bbbfb65 Unified function syntax: address some of DaveA's suggestions.
More to come on this, thanks!


Swift SVN r15376
2014-03-23 05:11:10 +00:00
Doug Gregor
6d082e360e Add ToC
Swift SVN r15374
2014-03-23 01:21:35 +00:00
Doug Gregor
1d4848099b Add a section about @call_arguments(strict).
Swift SVN r15373
2014-03-23 01:15:14 +00:00
Doug Gregor
1ca71f0b14 Proposal: Unified Function Syntax via Selector Splitting
Swift SVN r15371
2014-03-22 20:37:52 +00:00
Greg Parker
3f64d9dcef [docs] Fix an internal link and a grammar error.
Swift SVN r15330
2014-03-21 19:35:01 +00:00
Dmitri Hrybenko
11fea869c1 Change 'switch' not to fall through between empty cases and always require at
least one statement per case

rdar://16301313


Swift SVN r15266
2014-03-20 11:44:59 +00:00
Dmitri Hrybenko
2c717692ac LangRef: convert the section on switch and related sections to ReST, as I plan
to edit these for rdar://16301313


Swift SVN r15232
2014-03-19 09:40:12 +00:00
Doug Gregor
c854d9bb89 Incomplete draft discussion of Swift's object initialization.
Swift SVN r15222
2014-03-19 05:28:30 +00:00
Joe Groff
b8bac9bc12 Save some notes about how container patterns should work for future development.
Waiting for an SDK to install (again)...

Swift SVN r15215
2014-03-19 00:19:58 +00:00
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