Commit Graph

4421 Commits

Author SHA1 Message Date
Joe Groff
df9cf24132 LangRef: Document generic parameter parsing.
Swift SVN r4054
2013-02-15 00:52:16 +00:00
Chris Lattner
8307e73595 remove some extraneous ;'s
Swift SVN r4045
2013-02-14 01:46:11 +00:00
Chris Lattner
698621067d typo fix.
Swift SVN r4042
2013-02-14 00:11:29 +00:00
Chris Lattner
f0c46ac962 ascii'ify
Swift SVN r4024
2013-02-13 05:23:58 +00:00
Dave Zarzycki
bf3c98a0e6 Revert \v from r3968
Nobody can find any modern use for \v.

Swift SVN r3990
2013-02-08 18:19:58 +00:00
Dave Zarzycki
a282c35e6a Make floating-point number parsing more strict
The range operators (".." and someday "...") make constructs like .24...42
ambiguous. Therefore, we will enforce that programmers either place digits
on both sides of the decimal place, or use of exponent based notation.

Swift SVN r3989
2013-02-08 15:48:02 +00:00
Dave Zarzycki
9ad1e4c950 C/C++/ObjC Interop: string/char escapes
If we're going to import C/C++/ObjC code, we ought to "just work" with
their escape patterns when reasonable. (No error-prone octal escapes or
trigraph support). Also, update LangRef to document what the escapes do.

This patch DOES fix a bug with lexing operators in the case of (already
warned about) embedded NUL bytes within a source file.

This patch DOES NOT change what we consider to be valid whitespace in
the language.

Swift SVN r3970
2013-02-06 17:51:18 +00:00
Doug Gregor
47041d0086 Minor tweaks
Swift SVN r3955
2013-02-05 21:41:47 +00:00
Doug Gregor
6885f94bb6 Add a Swift "roadmap", which is mainly just an unorganized heap of features, engineering tasks, and related tools.
All of these sections need more organization and prioritization. We'll get there.

Hint: use Emacs' table.el when editing this monster table. You'll be happier that way.


Swift SVN r3954
2013-02-05 21:29:24 +00:00
Joe Groff
081787c3d5 Lexer: Lex C99-style hexadecimal float literals.
APFloat's parser gives us the parsing for free. Unlike C99 we require at least one digit on both sides of the hexadecimal point in order to allow '0x1.method()' expressions, similar to Dave's proposed change to float lexing. Also, we were requiring a sign after 'e' in the exponent, which is inconsistent with C, C++, and the Java regex we claim to follow, so I made the exponent sign optional.

Swift SVN r3940
2013-02-03 19:06:08 +00:00
Joe Groff
176567f16e ABI.rst: Describe how mangling substitutions work.
Swift SVN r3936
2013-02-02 22:00:12 +00:00
Joe Groff
6cca08826a IRGen: Hack in calls to block converter funcs.
Add a mangling for 'block converter' functions and for [objc_block] function types. [objc_block] types also need their own HeapTypeInfo representation that uses ObjC retain/release. When we see a BridgeToBlockExpr, feed the function pointer and context from the Swift closure to the external conversion function and hope we get a block back.

Swift SVN r3899
2013-01-30 01:01:34 +00:00
Dave Zarzycki
ff8bd176b4 Sort the reserved keyword list
Swift SVN r3894
2013-01-29 21:13:41 +00:00
Dave Zarzycki
b36678214a Rename l_(paren|square)_(call|subscript)
Thanks Chris and John for the feedback.

Swift SVN r3893
2013-01-29 21:13:39 +00:00
Dave Zarzycki
a076d54858 Small fix to the last commit
Swift SVN r3886
2013-01-28 05:09:50 +00:00
Dave Zarzycki
2ef751d418 Record our current and various generics syntax thoughts
Not all of us save email forever, nor is a long email thread the best
way to track our current thinking. This document drops the humorous but
ultimately strawman Unicode proposals.

Swift SVN r3885
2013-01-28 04:45:03 +00:00
Dave Zarzycki
5fe85d7020 Formalize unary prefix '&' to mean "make ref"
This makes reserved operator parsing more robust and easier to understand.

Swift SVN r3884
2013-01-27 21:20:06 +00:00
Dave Zarzycki
d7cc4b4a91 Reclaim "in" as an identifier
In Swift the "in" keyword is really a form of punctuation, and highly
context specific punctuation at that. It never begins a statement, nor
does the grammar require it be statement keyword. The grammar also
doesn't use it outside of for-each loops, and its use within a for-each
loop is highly unambiguous.

Thanks to Chris for the performance related feedback. This improves the
performance of getter/setter parsing as well.

Swift SVN r3880
2013-01-26 01:49:18 +00:00
Dave Zarzycki
73c31768ae The ++/-- hack doesn't exist anymore.
"var x = 123 ++y" is now unambiguously not a binary ++ operator.

Swift SVN r3868
2013-01-25 19:20:47 +00:00
Dave Zarzycki
b2173ef730 LangRef: add float commentary / question
Swift SVN r3867
2013-01-25 19:20:44 +00:00
Joe Groff
01f7030291 LangRef: Grammar and description of super exprs.
Swift SVN r3861
2013-01-24 22:34:43 +00:00
Dave Zarzycki
dd717e200f Update LangRef list of keywords and sort them
Swift SVN r3860
2013-01-24 22:01:35 +00:00
Dave Zarzycki
60eb51b85b Document that unary '&' is reserved
Swift SVN r3856
2013-01-24 17:36:35 +00:00
Dave Zarzycki
9eb53f37f5 12641063 Fix the double-indent problem with properties
Swift SVN r3822
2013-01-21 22:43:19 +00:00
John McCall
3713b6a549 Add a framework for distinguishing between deallocating
and non-deallocating destructors and allocating/non-allocating
constructors.

Non-deallocating destructors might not play well with ObjC
classes;  we might have to limit them to pure-swift hierarchies.

No functionality change except that I decided to not force
destructors to have internal linkage unconditionally.

Swift SVN r3814
2013-01-20 19:40:12 +00:00
John McCall
7eb4fbd21e Mangle the <context> of an ObjC class as 'So'.
Previously, we were mangling [objc] class types as swift
classes (using the defining component in the mangling) and
imported class types as class types with empty contexts.
This could create an inconsistency between components which
disagree about whether an ObjC class is defined in swift or
not;  this will not do.  Also, an empty context creates an
invalid mangling.

Swift SVN r3812
2013-01-20 19:40:06 +00:00
Joe Groff
0422897a47 Expose %swift.opaque as a builtin type.
Archetypes and projected existentials have the type %swift.opaque* and not i8*, so I need a corresponding SIL type to be able to model the ProjectExistential operation. We might also end up needing the builtin type for other low-level things down the line.

Swift SVN r3793
2013-01-18 02:24:23 +00:00
Joe Groff
c303ef1f7c SIL.rst: update ref_element_addr description.
Swift SVN r3780
2013-01-17 18:17:36 +00:00
Joe Groff
197b9e90e9 SILGen: Emit param patterns in reverse order.
Conform to IRGen's curried calling convention by emitting param patterns in reverse order, with the indirect return argument (if any) coming first.

Swift SVN r3777
2013-01-16 20:03:25 +00:00
Joe Groff
ee8fd2f7bf ABI.rst: Fix formatting of preformatted blocks.
Swift SVN r3765
2013-01-15 22:29:54 +00:00
Joe Groff
bb51760bdf SIL.rst: Describe calling convention for tuples.
Tuples recursively destructure, and the destructured elements then follow the normal calling convention.

Swift SVN r3748
2013-01-11 17:27:09 +00:00
John McCall
2e0070e229 Emit metaclass stub objects for swift classes.
Swift SVN r3740
2013-01-11 08:08:50 +00:00
Joe Groff
10924e22aa SIL.rst: Tidy up existential container description
Consistently use "existential container" to refer to the protocol-typed container object and "concrete value" to refer to the subobject owned by the existential container. Simplify the example a bit by removing the extraneous function call.

Swift SVN r3711
2013-01-09 00:02:36 +00:00
Joe Groff
da356c62ae SIL.rst: Existential terminology
Change the name of the implementation detail underlying protocol and protocol composition types to "existential container" while replacing references to "existential type" with "protocol or protocol composition type".

Swift SVN r3709
2013-01-08 04:25:36 +00:00
Dave Zarzycki
35c2b30aae Small doc fix after the Float/Double typealias shuffle
Swift SVN r3700
2013-01-06 19:08:24 +00:00
John McCall
b15b306314 Emit ObjC metadata and swift-as-ObjC thunks for methods.
Swift SVN r3697
2013-01-05 23:46:24 +00:00
Joe Groff
5749e9024d SIL.rst: Catch up with the current state of SIL.
Swift SVN r3693
2013-01-05 01:30:44 +00:00
Dave Zarzycki
78785c903f Char: add NUL literal and unit tests
Swift SVN r3681
2013-01-04 19:47:40 +00:00
Dave Zarzycki
dd53919b2a LangRef: for-each now uses formal protocols
Swift SVN r3657
2013-01-03 18:45:16 +00:00
Dave Zarzycki
3959f6f5ef LangRef: '//', '/*', and '*/' are not overloadable
Swift SVN r3656
2013-01-03 18:32:59 +00:00
Chris Lattner
c446a32a21 this doc isn't about the memory model.
Swift SVN r3625
2012-12-30 11:32:10 +00:00
Chris Lattner
d9bce8b0a7 check in some stuff that is in flight that I've been carrying around for awhile,
this is not actually sensible yet.


Swift SVN r3599
2012-12-28 10:48:15 +00:00
Chris Lattner
b19f4ffaf5 fix typo in regex.
Swift SVN r3598
2012-12-28 09:55:16 +00:00
Dave Zarzycki
c825debf2f Cleanup Enumeration
I tried to transform getEnumeratorType() into a VarDecl, but IRGen hasn't implement this feature yet.

Swift SVN r3527
2012-12-18 02:12:19 +00:00
Joe Groff
7f3939f88a SIL.rst: Describe calling convention.
Loadable types are passed and returned at +1. Address-only arguments are passed by reference and callee-copied. Address-only return values are passed as an implicit argument to caller-owned uninitialized memory and are callee-initialized.

Swift SVN r3525
2012-12-17 19:24:17 +00:00
Joe Groff
57ad36d521 SIL.rst: Call addresses *T instead of Address<T>.
Swift SVN r3524
2012-12-17 19:24:15 +00:00
Joe Groff
e75c0198cd SIL.rst: Add descriptions for newly-added insns.
Also repaint the "existential" bikeshed since there's a loud preference for talking about existentials as existentials within the implementation.

Swift SVN r3523
2012-12-17 19:24:13 +00:00
John McCall
b90adfa000 Add linking support for field-offset variables.
Not actually using them anywhere yet.

Swift SVN r3479
2012-12-13 10:28:35 +00:00
Joe Groff
387ef69809 SIL.rst: ref_element_addr and generalize insns
Describe a `ref_element_addr` instruction for extracting elements from reference types and a `generalize` instruction for representation conversion of generic values.

Swift SVN r3432
2012-12-11 00:05:39 +00:00
Jordan Rose
427be94945 Add the [iboutlet] and [ibaction] attributes.
Currently only used for parsing. The immediate intent of these attributes is
to have them behave like [objc] for the purpose of emitting method
implementations; however, they are semantically distinct and should only be
used to expose outlets and actions to Interface Builder.

Swift SVN r3416
2012-12-08 00:16:03 +00:00