Commit Graph

22435 Commits

Author SHA1 Message Date
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
5f1bcd7b7e Move all the side-allocated members of ASTContext to a single
side-allocation.  This is both easier to work with and extend
and slightly more efficient.



Swift SVN r1106
2012-02-02 01:13:33 +00:00
John McCall
6ff9afb6f5 Introduce LValueType.
Swift SVN r1105
2012-02-02 00:57:10 +00:00
John McCall
6d8837dc8d Macro metaprogramming for types.
Swift SVN r1104
2012-02-01 22:37:59 +00:00
John McCall
76ad8fff02 Add more parentheses to Types.h.
Swift SVN r1103
2012-01-31 04:32:37 +00:00
John McCall
e66c13cfe7 Change the 'walk' APIs to use virtual function dispatch
instead .
1,2d
1i
Change the 'walk' APIs to use virtual dispatch instead of
blocks.  This makes it much easier to thread information
through the API, as well to extend the API to handle
recursive visiting of other structures (e.g., Decls
and Patterns).



Swift SVN r1101
2012-01-26 04:31:38 +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
John McCall
16f8b2e656 Revise the language design for function argument clause syntax.
A function argument clause is now one or more patterns (which
must be parenthesized and explicitly type all positions) not
separated by arrows;  the first arrow then separates off the
return type.

Revisions to language reference forthcoming.



Swift SVN r1099
2012-01-26 01:25:26 +00:00
John McCall
14aa93a382 Publicize an API for printing out a source location for
debugging purposes.  Add a PrettyStackTraceLocation for
noting that we're currently processing a fixed location.



Swift SVN r1096
2012-01-26 00:07:05 +00:00
John McCall
ecb7bbc790 Basic ASTs for pattern-matching. We're going to generate
these for FuncExpr signatures.



Swift SVN r1095
2012-01-24 22:27:06 +00:00
Chris Lattner
bab9ca384c switch TupleExpr to use MutableArrayRef.
Swift SVN r1090
2012-01-19 06:54:43 +00:00
Chris Lattner
599e4b2528 switch to using the new llvm::MutableArrayRef class, this requires llvm r148463
Swift SVN r1088
2012-01-19 06:39:07 +00:00
Chris Lattner
594c117658 remove a dead diagnostic, simplify the top-level translation unit parsing gunk
Swift SVN r1086
2012-01-19 00:39:33 +00:00
John McCall
213d61361a It is no longer necessary to remember all the ArgDecls
in a FuncExpr.  This coincidentally means that we can
create the FuncExpr before we create the ArgDecls and
thus avoid the need to reparent them all.



Swift SVN r1081
2012-01-18 07:45:44 +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
584ed537fc introduce a new ErrorExpr to represent a subexpression that is semantically
inconsistent (so it needs to be killed) but that we want to retain source
range information and not kill the entire subtree that contains it.


Swift SVN r1073
2012-01-18 07:18:57 +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
John McCall
4477b90156 Require creators of initialized TupleTypeElts to provide
both of the semantically-important fields.  Make the
default constructor trivial, or at least closer to trivial.
Provide a space in TupleTypeElt for the parser to drop in
the ArgDecl corresponding to this element.



Swift SVN r1068
2012-01-18 06:54: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
John McCall
ea5e37e276 Getterize uses of TupleTypeElt. I'm trying to figure out how
parameter attributes should work here.



Swift SVN r1066
2012-01-18 04:05:25 +00:00
Chris Lattner
fa2ea94348 always turn a named reference to a type into an IdentifierType.
This preserving source location info and reduces redundancy in the parser.


Swift SVN r1065
2012-01-18 01:57:44 +00:00
Chris Lattner
1c42e8f6a6 rename DottedNameType to IdentifierType. It captures loc information for random uses of type names, among other things.
Swift SVN r1064
2012-01-18 01:52:28 +00:00
Chris Lattner
ac190abfef completely eliminate the type symbol table. "boom".
Swift SVN r1058
2012-01-17 07:43:32 +00:00
Chris Lattner
2f7cd03c6b switch type lookup to use value lookup for everything. Dead code ahoy.
Swift SVN r1057
2012-01-17 07:36:16 +00:00
Chris Lattner
51e44891af rip out now-dead code from NameBinding. It still generally needs to be beaten
into sense later, but this gets it closer to reasonable.


Swift SVN r1051
2012-01-17 06:35:34 +00:00
Chris Lattner
c8ca11a199 Drop in the new DottedNameType and wire it up in name binding.
This is horribly hack and slash (but enough to pass all tests) for a few reasons:
- I've #if 0'd out the tendrils of the old code 
- This handles *just* what was handled before instead of being more general
- We don't have an llvm::MutableArrayRef type, so there is some really gross
  const_cast'ing and other struggles to deal with its absence.



Swift SVN r1050
2012-01-17 06:32:00 +00:00
Chris Lattner
4f8193956d introduce DottedNameType, which will eventually be used for foo.bar in a type context.
Swift SVN r1049
2012-01-17 01:55:17 +00:00
Chris Lattner
fab4ef8820 introduce a new OverloadSetRefExpr::createWithCopy method to eliminate
some redundancy in the code that always has to create an overload set
or a single declrefexpr depending on what various lookups produce.


Swift SVN r1044
2012-01-14 07:22:25 +00:00
Chris Lattner
f1db6de509 remove the :: token and DCE UnresolvedScopedIdentifierExpr.
Swift SVN r1043
2012-01-14 07:00:45 +00:00
Chris Lattner
c5c81c6f70 Implement dot lookup on module types, allowing things like Builtin.add_int32 to find
the add_int32 member of the Builtin module.  :: is now dead.


Swift SVN r1042
2012-01-14 06:52:38 +00:00
Chris Lattner
82bf169d90 implement ModuleType::get.
Swift SVN r1040
2012-01-14 06:40:39 +00:00
John McCall
1ec9db43c8 Provide helper methods to look through parentheses. Learning
from Clang, actually give these explicit high-level behavior
rules so that it's clear what should be added to them in the
future.



Swift SVN r1037
2012-01-13 10:07:17 +00:00
Chris Lattner
4b8a147952 change the type grammar from qualifying a type with module::typename to module.typename.
Swift SVN r1036
2012-01-13 05:45:59 +00:00
Chris Lattner
be666df09e introduce a ModuleExpr node.
Swift SVN r1035
2012-01-13 05:07:21 +00:00
Chris Lattner
73570ac177 introduce a new ModuleType, which will be the type given to ModuleExpr's.
Swift SVN r1034
2012-01-13 04:51:39 +00:00
Chris Lattner
5ab30d7a88 implement lookup of extension methods with a type as a base, e.g. type.extensionmethod.
This is semantically equivalent (but much more uniform) to C++'s method pointer stuff.


Swift SVN r1032
2012-01-12 23:07:06 +00:00
Chris Lattner
5d3158bae2 Simplify this now that the base of an unresolved dot reference is always non-null
Swift SVN r1023
2012-01-12 20:27:17 +00:00
John McCall
59bed696a5 Introduce a ParenExpr to represent the special case of
a tuple with one element and no labels.  This form is
treated specially in essentially every case, so it might
as well be its own expression kind.



Swift SVN r1021
2012-01-12 19:55:06 +00:00
John McCall
286abfc5f7 Mostly kill off RValue. More tomorrow. :)
Swift SVN r1020
2012-01-12 10:18:40 +00:00
Chris Lattner
e3a97a5b36 enhance type checking of apply exprs to handle application of an
argument list to a metatype.  No functionality change since nothing 
injects metatype'd values into a scope that can be looked up yet.


Swift SVN r1009
2012-01-12 06:10:02 +00:00
Chris Lattner
9f5d37dd2f introduce a new ConstructorCallExpr node, which is sugar node used to represent
the syntactic form of an argument list applied to a metatype.  Semantically,
this is yet-another ApplyExpr.


Swift SVN r1008
2012-01-12 05:43:07 +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
a4c22e9020 add a hunk missing from previous patch.
Swift SVN r1003
2012-01-11 07:06:41 +00:00
Chris Lattner
173df8794d implement the construction for MetaTypeType's and plug a leak of the ParenTypes map.
Swift SVN r1002
2012-01-11 06:59:14 +00:00
Chris Lattner
627b055989 MetaTypeType doesn't refer to a oneof anymore, it refers to any named type,
which means it wraps a TypeAliasDecl.


Swift SVN r1001
2012-01-11 06:50:24 +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
527c58f846 implement MetaTypeType, the type system representation of a metatype.
Swift SVN r996
2012-01-06 19:51:50 +00:00
John McCall
d559794e73 Introduce a new kind of sugar, ParenType. A tuple with one
anonymous member is actually one of these.

A func decl is curried over all of its parameter clauses,
as long as they're written without parentheses.  So the body
of a func is the body of the "most curried" function:
  func foo(x:int) -> (y:int) -> int {
    // This is the body of the function that takes 'y'.
    // It returns an int.
  }
  func bar(x:int) -> ((y:int) -> int) {
    // This is the body of the function that takes 'x'.
    // It returns a functon of type (y:int) -> int.
  }



Swift SVN r993
2012-01-06 04:10:32 +00:00