Commit Graph

1309 Commits

Author SHA1 Message Date
Chris Lattner
6f7caf8335 fix a past-o in the dox.
Swift SVN r28149
2015-05-05 04:26:19 +00:00
Slava Pestov
58f0b46335 Implement @nonobjc attribute
The following declaration kinds can be marked with this attribute:
- method
- property
- property accessor
- subscript
- constructor

Use cases include resolving circularity for bridging methods in an @objc
class, and allowing overloading methods and constructors in an @objc class
by signature by marking some of them @nonobjc.

It is an error to override an @objc method with a @nonobjc method. The
converse, where we override a @nonobjc method with a @objc method, is
explicitly supported.

It is also an error to put a @nonobjc attribute on a method which is
inferred as @objc due to being part of an @objc protocol conformance.

Fixes <rdar://problem/16763754>.

Swift SVN r28126
2015-05-04 19:26:23 +00:00
Erik Eckstein
40c1160713 Revert r28111 "rework the peephole for optional-to-optional casts to be more specific"
and r28105: "implement <rdar://problem/17013042> T! <-> T? conversions should not produce a diamond"

r28111 broke the stdlib build. I also reverted r28105, because r28111 fixes regressions introduced in r2805.



Swift SVN r28114
2015-05-04 07:24:13 +00:00
Chris Lattner
add4909d35 implement <rdar://problem/17013042> T! <-> T? conversions should not produce a diamond
Two pieces to this:
 - Peephole InjectOptionalExpr(BindOptionalExpr(X)) to bitcast x to the result type.
 - Enhance OptionalEvaluationExpr to delete the failure block if not needed.



Swift SVN r28105
2015-05-04 01:12:23 +00:00
Ted Kremenek
2f2b9363e9 Change Printable/DebugPrintable to CustomStringConvertible/CustomDebugStringConvertible in docs.
Swift SVN r28000
2015-04-30 22:07:03 +00:00
Erik Eckstein
3ad2b6710b stdlib: add @_semantics("availability.osversion") to _stdlib_isOSVersionAtLeast
Needed by GlobalOpt (rdar://problem/20708979)



Swift SVN r27963
2015-04-30 11:05:31 +00:00
Dmitri Hrybenko
fe0a335a49 docs: add a rationale for use of BooleanType in the standard library
Swift SVN r27956
2015-04-30 02:17:27 +00:00
Dmitri Hrybenko
eaef05c99d docs: add a rationale for lazy functions on sequences and collections
Swift SVN r27955
2015-04-30 02:00:00 +00:00
David Farler
5b2de9ff9e Add document on Swift Markup Doc Comments
Swift SVN r27952
2015-04-30 00:34:41 +00:00
Andrew Trick
41cf8608cb Add is_unique documentation.
I also added a placeholder for ARC optimization docs. I wanted anyone
reading about swift ARC optimization to run across my discussion on
correctness w.r.t. COW.

Swift SVN r27890
2015-04-28 22:54:26 +00:00
Dmitri Hrybenko
c999f87c7c StdlibRationales: add Dave's writeup about high-order functions
Swift SVN r27823
2015-04-27 22:50:26 +00:00
Chris Willmore
c7c7388cf2 Change do-while to repeat-while.
Change all uses of "do { ... } while <cond>" to use "repeat" instead.
Rename DoWhileStmt to RepeatWhileStmt. Add diagnostic suggesting change
of 'do' to 'repeat' if a condition is found afterwards.

<rdar://problem/20336424> rename do/while loops to repeat/while & introduce "repeat <count> {}" loops

Swift SVN r27650
2015-04-23 22:48:31 +00:00
John McCall
ab66ffabf7 Another grammar bug.
Swift SVN r27649
2015-04-23 22:41:16 +00:00
John McCall
21b35b5e43 Spell out that initializers are imported as throwing instead
of failable if they have an error parameter.

Swift SVN r27648
2015-04-23 22:40:14 +00:00
John McCall
b8405acbc2 Mispelign.
Swift SVN r27647
2015-04-23 21:54:18 +00:00
John McCall
d00d6b8b3e Rationalize "throws" as a syntactic choice.
Swift SVN r27646
2015-04-23 21:15:09 +00:00
John McCall
bfa2038e60 Describe the order in which multiple defer actions are executed.
Swift SVN r27645
2015-04-23 21:15:06 +00:00
John McCall
aa0a8670e0 Editorial changes; credit to Quinn Taylor and Mark Lacey.
Swift SVN r27630
2015-04-23 07:07:17 +00:00
Chris Lattner
08f9269cc3 unbreak the dox build. I at least don't have a rust pygments lexer and this
is breaking my full build.


Swift SVN r27625
2015-04-23 04:18:24 +00:00
John McCall
b40e297ff2 Describe the implicit binding of 'error' within a catch clause.
Swift SVN r27624
2015-04-23 02:40:44 +00:00
John McCall
229df4d230 Add the error-handling proposal to the repository.
Swift SVN r27619
2015-04-23 00:56:48 +00:00
Joe Groff
8293f3f444 Update SIL.rst to discuss @convention instead of the old attributes.
Swift SVN r27611
2015-04-22 22:51:20 +00:00
Joe Groff
fd138326ba SIL: Reject '@cc', '@thin', and '@objc_block' in SIL.
Since it's an internal interface, there's no need for migration in SIL.

Swift SVN r27610
2015-04-22 22:40:08 +00:00
Slava Pestov
49bab4c38f Fix typos in docs
Swift SVN r27581
2015-04-22 17:18:41 +00:00
Joe Groff
3f38d75006 SILGen: Currying of 'super.method' calls.
Keep track of a second set of "direct method reference" curry thunks that don't end in a dynamic dispatch in order to properly implement a partial application such as 'let foo = super.foo'. Fixes rdar://problem/20598526.

Swift SVN r27538
2015-04-21 22:56:03 +00:00
Nadav Rotem
32211041d2 Rename @semantics -> @_semantics.
Swift SVN r27533
2015-04-21 17:10:06 +00:00
Chris Lattner
5df6b054db fix the dox build
Swift SVN r27527
2015-04-21 06:18:13 +00:00
Chris Lattner
42b4a966b0 Introduce a new null_class SIL instruction for forming a null pointer
reference to something of class type.  This is required to model
RebindSelfInConstructorExpr correctly to DI, since in the class case, 
self.init and super.init *take* a value out of class box so that it 
can pass the +1 value without performing an extra retain.  Nothing
else in the compiler uninitializes a DI-controlled memory object
like this, so nothing else needs this.  DI really doesn't like something
going from initialized to uninitialized.

Yes, I feel super-gross about this and am really unhappy about it.  I
may end up reverting this if I can find an alternate solution to this
problem.



Swift SVN r27525
2015-04-21 05:56:55 +00:00
Nadav Rotem
0f63546369 Rename the semantics tag name from never to sil.never. NFC.
Swift SVN r27486
2015-04-20 17:27:32 +00:00
Nadav Rotem
926042ff81 Add @semantics("optimize.never") to disable optimizations of a specific function.
This commit adds a flag to disable optimizations on a specific functions. The
primary motivation of this patch is to allow the optimizer developers to reduce
testcasese by disabling optimizations of parts of the code without having to
recompile the compiler or inspect SIL. The annotations  "inline(never)"
and "optimize.none" can go a long way.

The second motivation for this patch is to allow our internal adopters to work
around compiler bugs.

rar://19745484

Usage:

@semantics("optimize.never")
public func miscompile() { ... }

Swift SVN r27475
2015-04-20 05:06:55 +00:00
Dave Abrahams
cdb5808a95 StdlibAPIGuidelines: final clarification
Swift SVN r27151
2015-04-09 00:47:04 +00:00
Dave Abrahams
6832f493c1 StdlibAPIGuidelines: editorial review w/Dmitri
Swift SVN r27150
2015-04-09 00:43:55 +00:00
Dave Abrahams
4cf634ec7f StdlibAPIGuidelines: add a note.
Swift SVN r27149
2015-04-09 00:43:54 +00:00
Dave Abrahams
f3579767e9 Fix a ReST error
Swift SVN r27145
2015-04-08 23:43:40 +00:00
Dave Abrahams
d734fe7e07 [stdlib] Document our current design conventions
The API review list has requested this document.

Swift SVN r27144
2015-04-08 23:41:44 +00:00
Michael Gottesman
11e8cfa06f State in the uncurry level examples which reference is the "natural uncurry level" explicitly.
Swift SVN r27143
2015-04-08 23:30:52 +00:00
Joe Groff
655b2d3e93 Inplace: let -> var
Swift SVN r26800
2015-04-01 03:58:10 +00:00
Joe Groff
4b6c2803de Inplace proposal: Clarify the section on classes.
Try to make it more plain that assignment method syntax is still allowed with class methods; only explicit implementation of the assignment form is not allowed.

Swift SVN r26799
2015-04-01 03:54:30 +00:00
Dmitri Hrybenko
3307ccf4c3 docs: add notes from past API review discussions
Swift SVN r26795
2015-04-01 02:55:25 +00:00
Joe Pamer
5894736321 Update ABI.rst to point out that mangled types may never begin with a 'z'.
Swift SVN r26774
2015-03-31 19:31:55 +00:00
Joe Pamer
eee40fc53f Add basic parsing, sema and mangling support for throwing function types. Next up, metadata and serialization support, as well as more tests.
Swift SVN r26767
2015-03-31 18:55:19 +00:00
Chris Lattner
379cae70d9 unbreak the dox build.
Swift SVN r26761
2015-03-31 16:40:43 +00:00
John McCall
6d8fff9c06 Parsing and basic structure of try_apply. Not yet properly
threaded into IRGen; tests to follow when that's done.

I made a preliminary effort to make the inliner do the
right thing with try_apply, but otherwise tried to avoid
touching the optimizer any more than was required by the
removal of ApplyInstBase.

Swift SVN r26747
2015-03-31 02:41:03 +00:00
Chris Lattner
209d9d6f5b fix the dox build.
Swift SVN r26623
2015-03-27 05:46:33 +00:00
John McCall
35b7db3ae1 Parsing support for error results from SILFunctionType.
Swift SVN r26566
2015-03-26 00:01:32 +00:00
Dmitri Hrybenko
6ad58cc52c SequencesAndCollections: add sections about mutable and range
replaceable collections

Also explain that MutableCollectionType can have an interesting
domain-specific order.

Swift SVN r26515
2015-03-25 02:21:48 +00:00
Joe Groff
7431234bd2 SIL.rst: trim
Swift SVN r26496
2015-03-24 19:41:59 +00:00
Dmitri Hrybenko
042dc8e69b StdlibRationales: provide better examples
Swift SVN r26474
2015-03-24 02:17:53 +00:00
Joe Groff
a5fb34fea1 SIL.rst: Hook up links to existential box insns.
Swift SVN r26468
2015-03-24 01:10:01 +00:00
Dmitri Hrybenko
cfc547c3ec docs: start a document with random advice about C interop tricks
Based on an email exchange with Mishal Awadah.

Swift SVN r26245
2015-03-18 03:02:19 +00:00