Commit Graph

4421 Commits

Author SHA1 Message Date
Doug Gregor
4d3e475973 Fix typo in example
Swift SVN r10784
2013-12-04 17:36:25 +00:00
Doug Gregor
627f0ae447 Allow "x as T" to perform implicit conversions from x to T.
Fixes <rdar://problem/15283100>.


Swift SVN r10783
2013-12-04 17:31:44 +00:00
Chris Lattner
50f0de5937 rename the still-unused "rootinit" enum in MarkUninitialized to "RootSelf".
Teach silprinter to print the new flag.


Swift SVN r10776
2013-12-04 05:43:28 +00:00
Chris Lattner
567a3175dc extend the mark_initialized SIL instruction to have a "kind" enum field.
Existing uses use a "globalvar" kind.  Add a new "rootinit" kind which
will be used for root initializers (i.e. init methods of structs, enums, 
and root classes).



Swift SVN r10772
2013-12-04 02:02:15 +00:00
John McCall
007d3974d6 Use a proper mangling to try to share reabstraction thunks.
Swift SVN r10764
2013-12-03 23:23:52 +00:00
Adrian Prantl
41e92af7ae Mangler: Add a DWARF-only mangling for type aliases that includes the
decl context of the type alias.
This implements <rdar://problem/15290346> "typealias sugar needs to be
mangled into debug info mangled type names".

Swift SVN r10749
2013-12-03 17:15:18 +00:00
Doug Gregor
002038ad8e Allow a comma-separated list of init expressions in C-style for loops.
Swift SVN r10748
2013-12-03 15:14:54 +00:00
Dave Zarzycki
83f953b80a 15242776 docs: Replace "Slice" with "Array"
Swift SVN r10710
2013-12-01 08:16:54 +00:00
Chris Lattner
ad05efc481 Redesign the BuiltinFunctionRefInst to contain an Identifier instead of
a FuncDecl.  This makes it much more straight-forward for SIL passes to
introduce a new one - without doing name lookup in the builtin module!



Swift SVN r10694
2013-11-30 01:49:36 +00:00
Adrian Prantl
4fc5c9637b Mangler: Eliminate an ambiguity in the mangling of contexts.
<rdar://problem/15444866> Mangling is ambiguous -- may want prefix for functions

Swift SVN r10669
2013-11-23 00:56:16 +00:00
John McCall
8fdf6fe9e7 Provide a place to collect folk wisdom for implementors.
Swift SVN r10668
2013-11-23 00:38:58 +00:00
Dave Abrahams
a29a8778eb [docs] SIL.rst: fix another ReST error
Swift SVN r10650
2013-11-22 00:38:22 +00:00
Dave Abrahams
283662f764 [docs] SIL.rst: fix ReST error
Swift SVN r10649
2013-11-22 00:37:14 +00:00
John McCall
e95dc16fac Describe SIL function types, the restrictions on SIL
value types, and the problem of abstraction difference.

Swift SVN r10647
2013-11-22 00:17:22 +00:00
Dave Abrahams
4ac8b87b39 [docs/tests] Move prototypes into a dedicated test subdirectory
This code never belonged in docs/ in the first place.  The other
problem was that they'd drift out-of-date, and regressions that were
only going to be caught by this code could slip into the compiler,
e.g. rdar://problem/15525229

Swift SVN r10637
2013-11-21 18:27:44 +00:00
Doug Gregor
19759529db Allow delayed identifier expressions (.foo) with static variables and methods.
This allows expressions such as ".foo" and ".foo(1)" to refer to
static variables and static methods, respectively, as well as enum
cases. 

To get here, rework the parsing of delayed identifier expressions a
bit, so that the argument itself is part of the delayed argument
expression rather than a separate call expression. This simplifies
both the handling of patterns of this form and the type checker, which
can now user simpler constraints.

If we really want to support (.foo)(1), we can make that work, but it
seems unnecessary and perhaps confusing.


Swift SVN r10626
2013-11-21 06:24:06 +00:00
Dave Abrahams
b1ac7ba7a4 [docs] Fix all ReST/Sphinx warnings, turn sphinx warnings into errors
Also revert r10607, which this change obsoletes

Swift SVN r10611
2013-11-20 23:27:13 +00:00
Dave Abrahams
3c10621de2 [docs] Suppress "not included in any toctree" warning in CMake build
We have lots of documents that are intentionally not in any toctree;
we were just getting a massive pile of useless warnings about them.
Had there been a valid warning in there we'd have missed it anyhow.

Swift SVN r10607
2013-11-20 22:01:54 +00:00
John McCall
07b7bf7bf7 Add a mangling for SILFunctionType.
Swift SVN r10561
2013-11-19 22:54:59 +00:00
Joe Groff
f6b1745650 SIL: Remove 'ModuleInst'.
Module values could never be used for anything, and we have SILUndef now, so when SILGen sees a ModuleExpr, we can just emit 'undef'.

Swift SVN r10548
2013-11-18 21:36:08 +00:00
Dmitri Hrybenko
81dc5deee8 Change 'def' keyword back to 'func'
Swift SVN r10522
2013-11-17 07:45:28 +00:00
Joe Groff
19457c12ea Give Builtin.Word an abstract size.
Instead of hardcoding Builtin.Word to be an alias for Builtin.Int64, make it its own type of abstract pointer width.

- Change BuiltinIntegerType's width representation to accommodate abstract widths.

- In the AST and in SIL, store values of the types as the greatest supported size for the abstract width (64 bits for a pointer).

- Add some type safety to the ([sz]ext|trunc)(OrBitCast)? builtins that they're used appropriately given the upper and lower bounds of the abstract sizes they're working with.

- Now that Builtin.Word is a distinct type, give it its own mangling.

- In IRGen, lower pointer-sized BuiltinIntegerType appropriately for the target, and truncate lowered SIL values if necessary.

Fixes <rdar://problem/15367913>.

Swift SVN r10467
2013-11-14 19:56:26 +00:00
Dave Abrahams
cca343ec68 [stdlib] Initial prototype demonstration of a mutable Indexable container
Not yet tested.

Swift SVN r10451
2013-11-14 03:15:20 +00:00
Chris Lattner
425819ac07 Change the SIL string_literal instruction to produce three results
(the same way alloc_box returns two) instead of returning a tuple.

This eliminates a ton of tuple_extract instructions, which just
bloat the generated SIL.  This resolves rdar://15378135.



Swift SVN r10416
2013-11-13 06:43:09 +00:00
Joe Groff
3a50d63ffd KeywordArguments proposal: Describe behavior with trailing closures.
Trailing closures get exceptions from the "required keyword for selector style argument" and "positional parameters must come before keyword parameters" rules.

Swift SVN r10415
2013-11-13 06:12:12 +00:00
Doug Gregor
5bdaf96a9b Update grammar for comma-separated increment expressions in C-style for loops.
The actual language change went into r10399.


Swift SVN r10409
2013-11-13 03:54:20 +00:00
Dave Abrahams
7315d38393 [proposals] OperatorMethods.rst: minor ReST fixup
Swift SVN r10358
2013-11-12 02:00:48 +00:00
Adrian Prantl
da0cb5a10a [Mangler] Introduce a 'Qq' mangling format for archetypes that will be
used only for debug info and within the _Tt namespace.
The DWARF output created by swift is intentionally flat, therefore
archetypes need to be emitted with their DeclContext. While increasing the
length of the mangled names in some cases (substitutions help a lot) it
has the advantage of making names completely self-contained.
There is a lengthy thread on swift-debugger discussing this change.

Swift SVN r10348
2013-11-11 23:44:31 +00:00
Doug Gregor
b89f1fdae8 Minor tweaks to the initialization proposal
Swift SVN r10347
2013-11-11 23:35:47 +00:00
Joe Groff
ed252547c0 KeywordArguments proposal: Describe vararg keywords, note QoI issue with 'foo.bar:'
Swift SVN r10335
2013-11-11 19:10:56 +00:00
Doug Gregor
218d0224e9 Draft initialization proposal.
Swift SVN r10333
2013-11-11 18:15:01 +00:00
Joe Groff
8fc1dea287 KeywordArguments proposal revisions.
Define "named application" using AST peepholes instead of having different grammar productions; this is better for QoI and more flexible. For completeness, describe how named application lookup works with non-function decls.

Swift SVN r10332
2013-11-11 17:57:42 +00:00
Dave Abrahams
f08baf51a9 [proposals] Operator Methods (opportunity/2.0)
Recording an idea and its rationale.  No discussion/review necessary
at this time.

Swift SVN r10048
2013-11-08 20:01:01 +00:00
Joe Groff
5ba10e7978 KeywordArguments proposal: Some QoI details.
Swift SVN r10039
2013-11-08 16:25:12 +00:00
Joe Groff
2c90207004 Sketch out a new proposal for how keyword args should work.
Swift SVN r10033
2013-11-08 02:52:40 +00:00
Joe Groff
c6cfd804ff Remove CompoundNames proposal; we're going down a different path.
Swift SVN r10032
2013-11-08 01:34:27 +00:00
Dave Abrahams
1568c54160 [proposals] MutationModel.rst: fix a footnote
Churn complete; back to coding

Swift SVN r10012
2013-11-07 00:41:53 +00:00
Dave Abrahams
f63e16ff1e [proposals] MutationModel.rst: ReST cleanups
Swift SVN r10011
2013-11-07 00:39:30 +00:00
Dave Abrahams
1149141f9c [proposals] MutationModel.rst: edits to define formal language semantics and incorporate results of the last meeting
Some people might object to the way I've defined rvalue and lvalue,
but it just seemed to fall out of things.  I started by talking about
writable and read-only data, and then read-only lvalues, but it was
complicated until all those distinctions fell away and left me with
the basic rule: rvalues can't be mutated and lvalues can.

If theoreticians object, we can find another way to phrase it.

Swift SVN r10010
2013-11-07 00:25:12 +00:00
Adrian Prantl
1d76cada73 ABI.rst: Add missing comment.
Swift SVN r9955
2013-11-05 03:05:20 +00:00
Joe Groff
83b37b5b20 ABI.rst: Fix description of protocol descriptor layout.
I left out the inherited protocols list, and all the subsequent offsets were off by one. Oops. Thanks Enrico for catching this.

Swift SVN r9953
2013-11-05 02:58:34 +00:00
Adrian Prantl
e001667ac2 Add missing preformat marker.
Swift SVN r9943
2013-11-04 23:49:45 +00:00
Dave Abrahams
b781191aa9 [proposals] MutationModel.rst: cleanup
ReST errors fixed, prose smoothed

Swift SVN r9930
2013-11-04 19:21:59 +00:00
Dave Abrahams
f03082f41a [proposals] ClassConstruction.rst: updates based on Doug's feedback
Swift SVN r9929
2013-11-04 18:28:35 +00:00
Joe Groff
010a12e639 CompoundNames proposal: specify when default args are evaluated...
...when evaluated as part of a partially-applied compound name.

Swift SVN r9923
2013-11-04 17:56:36 +00:00
Chris Lattner
f823a8b1ee typo
Swift SVN r9919
2013-11-04 16:43:34 +00:00
Joe Groff
74cd1186a8 CompoundNames proposal: more revisions.
Swift SVN r9914
2013-11-04 02:02:25 +00:00
Joe Groff
502748fc00 CompoundNames proposal: Revise in response to DaveA feedback.
Remove confusing references to old dot-paren syntax. Move the discussion of the use of unsugared compound names after describing their idiomatic sugared uses.

Swift SVN r9913
2013-11-04 01:29:17 +00:00
Dave Abrahams
a41500f962 [proposals] Mutation Model Draft
Will post formatted version Monday morning

Swift SVN r9912
2013-11-03 22:18:45 +00:00
Dave Abrahams
08b6181f4d [proposals] Class Construction Draft
Tries to keep simple things simple.  Will post formatted version Monday morning

Swift SVN r9911
2013-11-03 22:18:37 +00:00