Doug Gregor
970d3d2564
A property is only an lvalue when there is a setter.
...
Swift SVN r1437
2012-04-16 17:57:00 +00:00
Doug Gregor
4fc32fd9b4
For a function that is either a getter or setter for a variable,
...
provide a mapping back to that variable. Teach the mangler to provide
a special mangling for such functions (__getVarName,
__setVarName). The mangling will undoubtedly change later, but the
point is that it will need to match the functions generated for
a resilient variable.
Swift SVN r1432
2012-04-14 00:11:04 +00:00
Doug Gregor
0fdb4d00fc
When we parse a 'var' declaration, we add all of the VarDecls and the
...
PatternBindingDecl to the DeclContext. Do the same for the get/set
functions for a property, so we don't need to perform 'deep' setting
of the DeclContext. This is simpler, although it makes pretty-printing
the AST a bit more difficult.
Swift SVN r1428
2012-04-13 22:22:17 +00:00
Doug Gregor
bbd5dfcfdf
Allow variables with a getter or setter to be declared in a
...
struct/oneof/class extension, making them instance methods. Normal
variables are still not allowed in these contexts, however.
The fact that we set DeclContexts late causes some consternation here,
because it's not clear just how far we need to recurse in
DeclContext. I've done enough to make properties work, but I'm still
rather uneasy about the current state of affairs.
Swift SVN r1423
2012-04-13 21:45:27 +00:00
Doug Gregor
7823cd48eb
Wire properties into the AST for VarDecl, and add dumping support. No
...
tests until we start type-checking something.
Swift SVN r1410
2012-04-13 00:27:22 +00:00
Eli Friedman
361481835c
Introduce a notion of module scope declarations; use it where appropriate instead of checking for a local declcontext.
...
Swift SVN r1380
2012-04-11 02:52:40 +00:00
Doug Gregor
a3c34c5dbd
Introduce an AST node (OverloadedMemberRefExpr) that represents dot
...
syntax when name lookup finds multiple candidates. Overload resolution
is then used to select the best candidate and map the overloaded
member reference expression down to DotSyntaxCallExpr or
DotSyntaxBaseIgnoredExpr, as appropriate.
This implements part of <rdar://problem/11071641>, so that simple
overload resolution works, but there is still a bit of cleanup to do.
Swift SVN r1366
2012-04-10 22:52:41 +00:00
Chris Lattner
fbfb76a515
rename 'plus' methods to 'static' methods, resolving:
...
<rdar://problem/10718220> Need a better name than 'plus' for "static" functions
Swift SVN r1340
2012-04-06 17:50:43 +00:00
Eli Friedman
94244131f7
Remove ElementRefDecl and DeclVarName. Add the replacement, PatternBindingDecl. Use proper pattern parsing for variable declarations. Uniformly use PatternBindingDecl for variable initialization. Adapt type-checking and IRGen for this new style of variable declaration. <rdar://problem/11124980>.
...
Swift SVN r1312
2012-04-02 23:49:28 +00:00
Doug Gregor
f370accf59
Introduce the notion of structured dependent types, such as a tuple
...
type with one or more elements of dependent type. Previously, an
expression such as (x, 5) would have the (unstructured) dependent
type, limiting our ability to type-check the subexpression 'x'
early. Now, if 'x' has type 'int' (for example), this expression will
now have the type (int, <<unstructured dependent type>>).
Extend coercion of a tuple to tuple type to handle coercion to
(structured) dependent tuple types, coercing element-by-element. This
code is very lightly tested and may still need to be restructured.
Swift SVN r1294
2012-03-29 16:26:04 +00:00
Doug Gregor
4cc616f2be
Rename the DependentType class to UnstructuredDependentType, because
...
this type is only going to cover dependent types for which there is
absolutely no structure. Still no functionality change.
Swift SVN r1292
2012-03-29 14:14:48 +00:00
Eli Friedman
29f3fca950
First iteration of CaptureAnalysis.
...
Swift SVN r1284
2012-03-29 00:24:03 +00:00
Doug Gregor
5fffa75e7b
Remove empty throw specifications from all of the overloaded new operators; reduces code size by 8k
...
Swift SVN r1282
2012-03-28 22:00:02 +00:00
John McCall
1a4b945a14
Flag in a ValueDecl whether it's ever been used as an
...
l-value or a heap l-value, except to immediate convert
it to an r-value or a non-heap l-value.
Swift SVN r1237
2012-03-19 08:28:42 +00:00
Chris Lattner
6185ab6d50
move getImplicitThisDecl to FuncDecl where the other 'this' handling stuff goes.
...
Swift SVN r1233
2012-03-19 05:43:20 +00:00
Chris Lattner
1884e4943f
refactor some code out of Sema into AST.
...
Swift SVN r1225
2012-03-17 23:07:00 +00:00
Chris Lattner
17ea0a6670
finish my pass over LangRef, updating it and changing it and the parser to keep the grammars in sync.
...
Swift SVN r1132
2012-03-01 16:55:09 +00:00
Chris Lattner
01a53ac0d5
improve comment.
...
Swift SVN r1113
2012-02-13 22:27:52 +00:00
John McCall
d0f4d86f3e
Use LValueType everywhere instead of the l-value value kind.
...
Kill off TypeJudgement. Various fixes and improvements.
Swift SVN r1107
2012-02-06 22:47:08 +00:00
John McCall
ce7780af04
I don't think we're really getting anything out of ArgDecl
...
at the moment. We can put it back if I'm wrong.
Swift SVN r1100
2012-01-26 02:08:52 +00:00
Chris Lattner
7c36780e35
sink the 'Init' field from ValueDecl down to VarDecl (as Init) and FuncDecl (as Body),
...
liberating the other ValueDecl's from its baggage.
Swift SVN r1079
2012-01-18 07:34:54 +00:00
Chris Lattner
7d0f7d53f9
improve type safety and specificity a bit, the body of a function is always a FuncExpr.
...
Swift SVN r1069
2012-01-18 06:56:53 +00:00
Chris Lattner
cb80e127a6
improve redefinition diagnostics since all type aliases are definitions, not declarations.
...
Swift SVN r1067
2012-01-18 06:52:15 +00:00
Doug Gregor
ae11ec70f0
Fix CMake build and sync up exception specifications
...
Swift SVN r1007
2012-01-12 01:08:40 +00:00
Chris Lattner
37cb633b12
Change TypeAliasDecl to be a ValueDecl, whose type is MetaTypeType.
...
Swift SVN r1004
2012-01-11 07:13:32 +00:00
Chris Lattner
e22a30a130
revert r995: "introduce MetaTypeDecl (though nothing creates it yet)".
...
After some pondering on this, I can just use DeclRefExpr(TypeAliasDecl) to
represent a named metatype, there is not need to have yet-another decl. I'm
glad about this, because it didn't seem right.
Swift SVN r999
2012-01-11 05:42:22 +00:00
Chris Lattner
f204abf010
introduce MetaTypeDecl (though nothing creates it yet)
...
Swift SVN r997
2012-01-06 20:50:56 +00:00
Chris Lattner
8ce4737534
implement "a.b" AST and type checker support. Semantics are that 'a' is evaluated and discard. 'b' is evaluated and returned.
...
Swift SVN r950
2011-12-21 23:49:30 +00:00
Chris Lattner
17b11e9bbd
implement parsing, AST, and LangRef support for 'plus' methods. Dot syntax will need some work though to actually use them.
...
Swift SVN r949
2011-12-21 23:21:58 +00:00
John McCall
f4ce88878a
Remove the reference accessor to ValueDecl::Init.
...
Swift SVN r945
2011-12-21 03:06:27 +00:00
John McCall
8a8f297bde
Basic resilience query.
...
Swift SVN r937
2011-12-15 00:45:31 +00:00
John McCall
a1f7eefba3
Extract out decl attributes into a separately-allocated structure.
...
Swift SVN r920
2011-12-10 00:39:10 +00:00
John McCall
3456720d86
Extract decl attributes out into their own file.
...
Swift SVN r919
2011-12-08 00:22:16 +00:00
Chris Lattner
d9c15ebb9a
make ExtensionDecl be a DeclContext, install members into it properly.
...
Swift SVN r896
2011-12-05 23:22:04 +00:00
Chris Lattner
3d8fe587c1
the world has moved to using getters, conform.
...
Swift SVN r894
2011-11-29 22:47:23 +00:00
Chris Lattner
d666cc4fda
define ExtensionDecl.
...
Swift SVN r892
2011-11-29 22:40:24 +00:00
John McCall
94021a90be
Finish getterizing Decl.h.
...
Swift SVN r889
2011-11-18 01:29:31 +00:00
John McCall
b700f171a2
More getters.
...
Swift SVN r886
2011-11-18 01:10:03 +00:00
John McCall
d716f82984
Getterize ValueDecl.
...
Swift SVN r885
2011-11-18 01:04:12 +00:00
John McCall
9079154ded
Getterize TypeAliasDecl.
...
Swift SVN r884
2011-11-18 00:48:14 +00:00
John McCall
50fb0d63f6
More incremental getterization.
...
.w
Swift SVN r883
2011-11-18 00:29:15 +00:00
John McCall
d74f17259c
Incremental getterization of Decl.h.
...
Swift SVN r882
2011-11-18 00:17:20 +00:00
Chris Lattner
4f7c4c535e
random tidying
...
Swift SVN r868
2011-11-10 22:12:09 +00:00
Chris Lattner
7e96d0d53e
embrace macro metaprogramming for decls.
...
Swift SVN r867
2011-11-10 22:08:46 +00:00
Chris Lattner
9e9f421f1a
getAliasType() doesn't need an ASTContext argument anymore.
...
Swift SVN r816
2011-11-01 18:37:05 +00:00
Chris Lattner
4933a27098
clean up lookupType/lookupValue to only take an AccessPath instead of an import decl.
...
Strip of the module name implicit in the access path.
Swift SVN r801
2011-11-01 04:43:51 +00:00
Chris Lattner
d69b3cec39
add a helper method, not particularly useful yet because not all decls have a DeclContext.
...
Swift SVN r753
2011-10-18 21:52:46 +00:00
Chris Lattner
33b3a22999
fix a fixme around a dead method.
...
Swift SVN r751
2011-10-18 01:27:13 +00:00
Chris Lattner
a7c7d64fa0
Switch swift to use SourceLoc instead of SMLoc.
...
Also use the new getAdvancedLoc() method instead of hacking
on SMLoc directly.
Also fix the warning/note/error methods to forward through ASTContext
instead of being replicated everywhere.
Swift SVN r750
2011-10-18 01:22:29 +00:00
John McCall
f121bd5e2d
Arbitrary-associativity operator precedence parsing.
...
Swift SVN r743
2011-09-29 01:31:16 +00:00