Commit Graph

1018 Commits

Author SHA1 Message Date
Eli Friedman
ab2998431c Simplify our handling of tuple elements in the AST and Sema.
Swift SVN r2224
2012-06-21 21:30:57 +00:00
Doug Gregor
efd92be870 Introduce a form of TypeChecker::buildMemberRefExpr() that accepts the
results of member lookup, and eliminate all uses of
MemberLookup::createResultAST(). The AST library should not be
performing this semantic analysis.


Swift SVN r2221
2012-06-21 17:18:47 +00:00
Doug Gregor
f4bdd9ddf3 Introduce support for using static protocol functions within generics.
Swift SVN r2216
2012-06-20 17:59:03 +00:00
Doug Gregor
dfc23195ae Make liberal use of the new TypeBase::getRValueType().
Swift SVN r2208
2012-06-20 00:04:27 +00:00
Eli Friedman
433de7c3d2 Fix a crash-on-invalid in name lookup.
Swift SVN r2205
2012-06-19 22:18:09 +00:00
Doug Gregor
f847fe4a22 Introduce basic support for type-checking the definitions of generic
functions. This involves a few steps:

  - When assigning archetypes to type parameters, also walk all of the
  protocols to which the type parameter conforms and assign archetypes
  to each of the associated types.
  - When performing name lookup into an archetype, look into all of
  the protocols to which it conforms. If we find something, it can be
  referenced via the new ArchetypeMemberRefExpr.
  - When type-checking ArchetypeMemberRefExpr, substitute the values
  of the various associated types into the type of the member, so the
  resulting expression involves the archetypes for the enclosing
  generic method.

The rest of the type checking essentially follows from the fact that
archetypes are unique types which (therefore) have no behavior beyond
what is provided via the protocols they conform to. However, there is
still much work to do to ensure that we get the archetypes set up
correctly.



Swift SVN r2201
2012-06-19 21:16:14 +00:00
Doug Gregor
bf71eeb26d Include the generic parameter list of a function declaration in the
FuncDecl AST, and use it for local name lookup.


Swift SVN r2198
2012-06-18 23:49:40 +00:00
Chris Lattner
db0cd646fc lexer/parser/ast/sema support for do/while statements. irgen next.
Swift SVN r2186
2012-06-17 02:29:54 +00:00
Eli Friedman
18dfa5cf7d More refactoring; allow ConstructorLookup to find constructors in classes.
Swift SVN r2171
2012-06-07 23:57:18 +00:00
Eli Friedman
72e1bed79e Refactoring for constructor lookup.
Swift SVN r2170
2012-06-07 23:33:08 +00:00
Eli Friedman
45f1fa1f6c Fix some comments; remove unused ErrorStmt.
Swift SVN r2169
2012-06-07 22:14:17 +00:00
Eli Friedman
f1ffa870a3 A few adjustments to AST/Sema for ConstructorDecls, and starting IRGen.
Swift SVN r2160
2012-06-06 00:53:44 +00:00
Eli Friedman
75907029f1 Add parsing and semantic analysis for a basic ConstructorDecl. Still missing: no IRGen, and semantic analysis to actually call them.
Swift SVN r2159
2012-06-05 23:51:19 +00:00
Eli Friedman
27f8a5ab62 Teach the parser's handling of scopes to handle local types correctly.
Swift SVN r2138
2012-06-04 19:14:58 +00:00
Eli Friedman
26159b59ee First draft of some code to make the general unqualified lookup able to perform lookup into local scopes. Normally, name-binding doesn't need this because the parser can resolve references to locals, but we need this sort of lookup to handle cases involving local types. It's also likely this will be generally useful for tools consuming the AST, typo-correction, etc.
We probably need to add some sort of data structure to represent this information, but as a proof of concept the current code appears to work.  I'm still working out how to make sure the parser doesn't prematurely bind names and how to make name-binding use it where appropriate (and avoid it when we don't need it, because no matter how efficient we make it, it will still be relatively expensive).



Swift SVN r2112
2012-06-02 01:26:58 +00:00
Eli Friedman
d829b3c775 Unify the complete unqualified lookup logic in the UnqualifiedLookup class.
Swift SVN r2109
2012-06-01 23:26:58 +00:00
Eli Friedman
0e7ef8cebb Start refactoring code towards a single complete implementation of unqualified lookup.
Swift SVN r2108
2012-06-01 01:37:44 +00:00
Eli Friedman
29a13e9ae0 Move the NameLookup class into the AST library.
Swift SVN r2101
2012-05-31 22:35:50 +00:00