Commit Graph

4421 Commits

Author SHA1 Message Date
Doug Gregor
918cf5fb7a Constructors and initialization proposal, first draft.
Swift SVN r8286
2013-09-16 18:57:19 +00:00
Doug Gregor
ca31b28e0f LangRef: add some basic documentation for generics.
Swift SVN r8240
2013-09-14 03:22:56 +00:00
Joe Groff
04b9685d84 SIL.rst: Remove currently irrelevant and potentially confusing caveat.
Swift SVN r8219
2013-09-13 22:25:18 +00:00
Joe Groff
7b37f2d445 SIL.rst: Clarify class subtyping rules wrt generic instances.
Swift SVN r8216
2013-09-13 22:12:07 +00:00
Joe Groff
6e56a4206c SIL.rst: Describe aliasing rules for heap object references.
Clarify that, unlike SIL addresses, class values and other heap object references can alias and be captured. Class value aliasing is controlled by the type system.

Swift SVN r8210
2013-09-13 21:01:58 +00:00
Doug Gregor
97e772bb43 Generics manifesto: Rename "requires" to "where" and update syntax.
Swift SVN r8182
2013-09-13 02:19:35 +00:00
Joe Groff
c65f4c3f43 Rework archetype mangling to follow parent hierarchy.
Use the ordinal archetype manglings only for the primary archetypes of a generic context, and define a mangling for associated types relative to their parent archetype. This will make the archetype mangling resilient in the face of our planned improvements to associated type and protocol conformance ABI. It also correctly mangles self and associated types of protocols, which my previous attempt utterly failed to accomplish.

Swift SVN r8174
2013-09-13 01:16:27 +00:00
Chris Lattner
7c8ae9352a Add a new "mark_function_escape" instruction that will be used to mark the
escape point of function definitions that "close" over global variables.



Swift SVN r8152
2013-09-12 18:31:00 +00:00
Joe Groff
6dbc1a8835 Add manglings for associated types.
This should allow declarations inside protocols to mangle successfully, which is needed by SourceKit to be able to use mangled names as unique decl identifiers. I'm also planning to use mangled protocol decls to name generic curry thunk symbols.

This only introduces a mangling for independent associated types. I think we will eventually want to mangle dependent associated types (such as T.AssocType for an archetype T : SomeProtocol) with a non-indexed mangling too, but this doesn't do that yet.

Swift SVN r8148
2013-09-12 15:29:08 +00:00
Chris Lattner
3c0c9a5da7 introduce a new mark_uninitialized SIL instruction which will be used by
definitive initialization of top-level code.


Swift SVN r8144
2013-09-12 04:30:48 +00:00
Joe Groff
f58d65a903 SIL.rst: Update description of 'thunk' linkage for its broader role.
Swift SVN r8124
2013-09-11 23:51:16 +00:00
Joe Groff
705102b544 SIL: Rename 'ClangThunk' specifier to 'Thunk'.
Lazily-generated currying thunks will require the same IR-level linkonce_odr linkage as clang thunks currently do, so generalize the name of the existing SIL-level linkage specifier 'clang_thunk'.

Swift SVN r8122
2013-09-11 23:47:15 +00:00
Joe Groff
4a4c70ab36 IRGen: Implement partial_apply lowering for objc dynamic method values.
To do this right, we need to emit the objc_msgSend on the 'self' argument inside the forwarding stub, so handle them in a different code path in IRGenSIL::visitPartialApplyInst.

Swift SVN r8112
2013-09-11 21:07:28 +00:00
Joe Groff
7eb02647f5 Update SIL.rst discussion of objc calling convention.
Swift SVN r8111
2013-09-11 21:07:22 +00:00
Dave Abrahams
642ef3682b [stdlib] StringDesign.rst: Finalize the Overview section
Swift SVN r8087
2013-09-10 23:57:39 +00:00
Doug Gregor
ad9a958e2d Document SIL dynamic_method_br instruction
Swift SVN r8086
2013-09-10 22:58:53 +00:00
Dave Abrahams
cea6cb0828 [stdlib] StringDesign.rst: Remove needless level of document structure, simplify the description of indexing
Swift SVN r8078
2013-09-10 20:01:14 +00:00
Dave Abrahams
b400879485 [stdlib] StringDesign.rst WIP
Swift SVN r8069
2013-09-10 17:03:49 +00:00
Anna Zaks
89fff39153 [SIL.rst] Update the guaranteed passes section.
Swift SVN r8058
2013-09-09 22:37:10 +00:00
Joe Groff
387946298e Describe calling convention for [byref] arguments in SIL.rst.
Swift SVN r8052
2013-09-09 20:17:37 +00:00
Doug Gregor
c5557a624c SIL: Introduce the 'dynamic_method' instruction for dynamic method dispatch.
The dynamic_method instruction handles method lookup on an existential
of type DynamicLookup based on the selector of an [objc] method of a
class or protocol. It is only introduced in the narrow case where we
are forcing a use of the method with '!', e.g.,

class X {
  func [objc] f() { println("Dynamic lookup") }
}

var x : DynamicLookup = X()
x.f!()



Swift SVN r8037
2013-09-09 16:12:50 +00:00
Dave Abrahams
d718c8a7f9 [stdlib] StringDesign.rst: WIP with a new "introduction by example" approach
Swift SVN r8027
2013-09-07 02:57:07 +00:00
Dave Abrahams
be2152494e [docs] Silence warnings by removing non-existent documents from the toctree
Swift SVN r8026
2013-09-07 02:57:05 +00:00
Dave Abrahams
8da6fdfba8 [stdlib] StringDesign.rst: note that we have to cover YAGNI
Swift SVN r8025
2013-09-07 02:57:02 +00:00
Joe Groff
d10491ae18 SIL.rst: Add a note that 'apply' currently consumes thick callees.
Swift SVN r7995
2013-09-06 20:33:32 +00:00
John McCall
7a909b64c2 Update the description of 'assign'.
I also removed a restriction about the form of the operand that
doesn't seem to be enforced by SIL-gen at all.

Swift SVN r7951
2013-09-05 18:08:11 +00:00
Michael Gottesman
743e99fb96 Fixed typo in SIL documentation.
Swift SVN r7944
2013-09-05 07:03:44 +00:00
Dave Abrahams
3d62ae4acf [stdlib] StringDesign.rst: More Work In Progress (WIP)
Beginning to move all ObjC/Cocoa references out of the first part of
the document, so the high-level string design stands on its own.  It's
becoming clear that rationales need to be moved out of the sidebar and
back into the main body of the text, so checkpointing before
restructuring.

Swift SVN r7899
2013-09-04 16:19:03 +00:00
Doug Gregor
1dea838517 Remove the "x as T" syntax from the language.
Swift SVN r7874
2013-09-03 22:47:33 +00:00
Dave Abrahams
9dd70537f8 [stdlib] StringDesign.rst: Work In Progress (WIP)
Swift SVN r7862
2013-09-03 21:00:21 +00:00
Chris Lattner
fb801cd73c a couple more.
Swift SVN r7848
2013-09-03 16:52:00 +00:00
Chris Lattner
938ee19b36 This -> Self.
Swift SVN r7847
2013-09-03 16:50:44 +00:00
Howard Hinnant
c6d960c3df Minor type-o in Reserved Punctuation Tokens.
Swift SVN r7800
2013-08-30 21:02:39 +00:00
Dave Abrahams
8c84806f5b [stdlib] StringDesign.rst: this => self
Swift SVN r7798
2013-08-30 20:39:28 +00:00
John McCall
6aba15bc63 Document unowned_to_ref and ref_to_unowned, and discuss some
of the philosophy behind preserving this information in the type.

Swift SVN r7791
2013-08-30 18:31:31 +00:00
Chris Lattner
fc04d57bd0 Rework the assign instruction in two major ways:
1. Change assign to follow SILGen's model for a semantic assignment,
   which (in the case of unowned pointers) doesn't require the left
   and right hand sides to be the same.
2. Change assign to consume/take the refcount from the LHS, following
   SILGen's design (which I completely misunderstood before).



Swift SVN r7787
2013-08-30 17:59:56 +00:00
Dave Abrahams
2cae5e127c [stdlib] StringDesign.rst: add DaveZ's organizational notes
Swift SVN r7768
2013-08-29 23:59:10 +00:00
Dave Abrahams
a6176da34b [stdlib] Check in WIP on Strings State of the Union
Swift SVN r7767
2013-08-29 23:56:04 +00:00
Joe Groff
55c8418a4e SIL.rst: Update is_nonnull description for John's change.
Swift SVN r7750
2013-08-29 22:05:18 +00:00
Michael Gottesman
d247bf36a3 A few updates to the external doxygen search capability to reflect certain changes I made on trunk and a few mistakes I made as well.
Swift SVN r7693
2013-08-28 22:02:48 +00:00
Michael Gottesman
1c3961e5e6 Fixed typo.
Swift SVN r7685
2013-08-28 20:44:01 +00:00
Michael Gottesman
64e0672bc0 Add support for generating doxygen compatible external search indices for swift.
Swift SVN r7684
2013-08-28 20:41:30 +00:00
Michael Gottesman
74abe70c30 Use new aggregate doxygen target for building swift doxygen.
Swift SVN r7683
2013-08-28 20:41:27 +00:00
Dmitri Hrybenko
453205f5c2 LangRef: fix the only instance of missing this -> self rename that I could find
Swift SVN r7669
2013-08-28 17:21:40 +00:00
Chris Lattner
a3928d4c70 fix this -> self conversion issue.
Swift SVN r7663
2013-08-28 04:10:19 +00:00
Jordan Rose
d40f74f2c1 [Parse] Treat ! as a postfix operator when both left- and right-bound.
For most operators, an expression like "a@b" is lexed with '@' as a binary
operation on 'a' and 'b'. However, we want to make sure we can support
calling optional functions using the syntax "a!()". Consequently, if there
are no spaces around a single '!' token, it is treated as a postfix operator
instead of an infix operator. The infix interpretation can still be requested
by using spaces on both sides of the operator.

Swift SVN r7651
2013-08-28 00:18:19 +00:00
Ted Kremenek
8f5b8ccb02 Rename "This" to "Self" and "this" to "self".
This was not likely an error-free change.  Where you see problems
please correct them.  This went through a fairly tedious audit
before committing, but comments might have been changed incorrectly,
not changed at all, etc.

Swift SVN r7631
2013-08-27 21:58:27 +00:00
Michael Gottesman
b8e7ccd3ff Updated SIL.rst in light of r7602.
Swift SVN r7607
2013-08-26 23:41:04 +00:00
Joe Groff
c74dc79610 SIL: Add instructions to implement address-only unions.
Because union layout may interleave tag bits with payload data, we need to be able to efficiently inject and remove tag bits from an address-only union in-place. To do this, we'll model address-only union initialization by projecting out the data address (union_data_addr) and storing to it, then overlaying the tag bits (inject_union_addr). To dispatch and project out the data, we'll use a destructive_switch_union_addr instruction that clears any tag bits in-place necessary to give a valid data address.

Swift SVN r7589
2013-08-26 20:50:31 +00:00
Joe Groff
fe1ad586e7 SIL: Add a 'union' instruction to construct unions.
The instruction represents constructing a loadable union given a case and the data for that case, which will let us emit union constructor functions in SIL instead of IRGen (rdar://problem/14773182).

Swift SVN r7558
2013-08-24 18:33:24 +00:00