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
John McCall
6b27921ce3
Propagate around l-value-ness. There aren't any interesting invariants
...
here yet.
Swift SVN r740
2011-09-27 23:46:08 +00:00
John McCall
54ff2ccf4a
Lop the last word off ModuleDecl and TranslationUnitDecl.
...
Swift SVN r693
2011-09-06 21:43:46 +00:00
Chris Lattner
a915596f0f
switch decl's classof to use range comparisons.
...
Swift SVN r690
2011-09-06 06:49:11 +00:00
John McCall
6ddc15143b
Support qualified names for types.
...
Swift SVN r683
2011-09-03 06:07:44 +00:00
John McCall
4a0f713e62
Progress towards a builtin module.
...
Swift SVN r682
2011-09-03 05:35:49 +00:00
Chris Lattner
a838f412f4
eliminate ProtocolFuncElementDecl, just use FuncDecl instead.
...
Swift SVN r668
2011-09-01 18:17:12 +00:00
Chris Lattner
70bbb65241
make ProtocolType a DeclContext, add AST and trivial sema support for
...
ProtocolFuncElementDecl, the first thing we will allow in a protocol.
Swift SVN r664
2011-08-31 23:31:42 +00:00
Chris Lattner
74b804a03a
rearrange DeclContext arguments so that they are at the end, not the beginning.
...
Swift SVN r661
2011-08-31 23:05:51 +00:00
Chris Lattner
af4d36f463
Eliminate the 'unary' attribute, instead just know that operators
...
that take a single argument are unary. Move a bunch of semantic
checking of operators from the parser to TypeCheckDecl now that it
has a decent place to hold it.
Swift SVN r646
2011-08-31 00:13:57 +00:00
Doug Gregor
63ca527a95
Introduce accessors into DeclVarName and eliminate direct mutation by
...
setting all fields on construction. Use this opportunity to save a
pointer of storage for every DeclVarName.
squeeze out a pointer's worth of storage
Swift SVN r639
2011-08-29 19:59:33 +00:00
Chris Lattner
a071b37639
optimize out trivial accessors.
...
Swift SVN r626
2011-08-25 23:46:51 +00:00
John McCall
b2bd8e12a7
Introduce the idea of a DeclContext.
...
Swift SVN r623
2011-08-25 19:26:50 +00:00
Chris Lattner
28f05f0348
add parser and sema support for user defined unary operators.
...
Swift SVN r572
2011-08-20 00:27:11 +00:00
Chris Lattner
9279ebe82b
add Decl visition to ExprStmtVisitor.h, switch Decl.cpp to print the same way
...
expr and stmt does.
Swift SVN r470
2011-07-31 20:38:13 +00:00
Chris Lattner
63ce0be641
make the big switch: {} are now statements, not expressions. This removes some
...
annoying things from the grammar (like expr-non-brace), and makes it so that
the body/else of an if is just a statement.
This patch has a fairly serious caveat that we just drop function bodies on the
floor now, since we have no "stmtexpr" sort of thing to represent the syntactic
sugar that is func. We'll fix that soon.
Swift SVN r462
2011-07-31 17:39:13 +00:00
Chris Lattner
0fc77abf5c
Per discussion on swift-dev, unify 'meth' and 'func' syntax into just 'func' syntax
...
where you can optionally declare a receiver type. This is cleaner both conceptually
and in implementation, and eliminates drug references. :)
Swift SVN r444
2011-07-24 20:11:35 +00:00
Chris Lattner
6f7c702321
disable copy and assignment of various types, and plain 'operator new' of others
...
using the new '0x way.
Swift SVN r443
2011-07-24 19:33:27 +00:00
Chris Lattner
f3c270fa06
convert DeclKind to an scoped enum
...
Swift SVN r439
2011-07-24 18:44:56 +00:00
Chris Lattner
f114a7ab79
close some declarations with shift right, adopting another killer '0x feature :)
...
Swift SVN r436
2011-07-24 00:37:18 +00:00
Chris Lattner
4f29cc0e8c
convert TheUnresolvedType/TheDependentType and the empty tuple type
...
to be accessors on their respective classes, for consistency.
Swift SVN r429
2011-07-19 06:41:42 +00:00
Chris Lattner
3af81cccbe
raw_ostream and NullablePtr. While there are more types that
...
could be handled in similar ways, this gets the most of them.
Swift SVN r424
2011-07-19 06:09:31 +00:00
Chris Lattner
10017bef15
ArrayRef and SmallVector[Impl]
...
Swift SVN r423
2011-07-19 06:03:26 +00:00
Chris Lattner
e647b29339
stop the llvm-namespace-qualification-insanity by caving in and
...
adding a new swift/AST/LLVM.h file which forward declares and imports
common llvm classes, starting with SMLoc.
Swift SVN r420
2011-07-19 05:49:43 +00:00
Chris Lattner
9e8c82435a
implement AST and sema support for methods. The example method in the
...
testcase now AST's to:
(methdecl 'print2' type='(this : rect) -> (os : ostream) -> ()'
(closure_expr type='(this : rect) -> (os : ostream) -> ()'
(closure_expr type='(os : ostream) -> ()'
(brace_expr type='()'
(apply_expr type='int'
(declref_expr type='(r : rect) -> int' decl=area)
(tuple_expr type='(r : rect)'
(declref_expr type='rect' decl=this)))))))
which seems right. Some cleanups are pending.
Swift SVN r416
2011-07-19 05:26:51 +00:00
Chris Lattner
e071e0f159
add a helper, tweak a comment.
...
Swift SVN r347
2011-04-10 03:07:32 +00:00
Chris Lattner
ea53191985
properly initialize an ivar.
...
Swift SVN r346
2011-04-09 21:16:41 +00:00
Chris Lattner
5e28a6fcdd
Finally get around to doing a major type system refactoring, where we introduce Type as a "smart pointer" and rename the existing Type class to TypeBase.
...
This prevents use of isa/dyn_cast/etc on Type*'s and means we just pass around Type by value instead of having to use Type* everywhere.
Swift SVN r343
2011-04-05 01:06:57 +00:00
Chris Lattner
c9ee19e269
Implement parser, sema, doc, and name lookup support for refined import declarations. You can still only do top level references, but that's because we don't have namespaces or anything else interesting yet.
...
This allows "import swift.int" for example.
Swift SVN r329
2011-03-23 05:18:29 +00:00
Chris Lattner
c9eb885752
Introduce top-level expressions and simplify TranslationUnitDecl (and various things that hack on it) by making it hold a single BraceExpr instead of a list of exprs and decls.
...
Swift SVN r293
2011-03-20 06:59:37 +00:00
Chris Lattner
cb8884e832
Move error reporting for unresolved types from SemaDecl to NameBinding, where it should be. This requires enhancing TranslationUnitDecl to hold a list of unresolved types.
...
Swift SVN r290
2011-03-20 04:45:06 +00:00
Chris Lattner
60cdb19d02
Add a new ImportDecl to represent imports.
...
Swift SVN r286
2011-03-19 06:22:47 +00:00
Chris Lattner
6ab4eec127
Two changes that got mixed up:
...
#1 : Change type conversion errors to print the types involved, making the diagnostic better. We still don't have ranges, but it is progress.
#2 : Reimplement support for anonymous closure arguments (e.g. func($0+$1)) where func takes a closure, step #1 .
- This removes AnonDecl, replacing it with AnonClosureArgExpr. $0 and friends have to be expressions since they don't get a type and don't get resolved until TypeChecking.
- For now we just replace the existing broken support, a future step is to implement type checking support for them.
Swift SVN r278
2011-03-17 06:09:19 +00:00
Chris Lattner
1cc8befa30
Fix a scary and long standing bug which never manifested because vars and funcs had the same data.
...
Swift SVN r273
2011-03-17 04:27:41 +00:00
Chris Lattner
c5506dc66e
Capture the structure of a declared VarName in the ast as DeclVarName.
...
Swift SVN r266
2011-03-14 21:54:21 +00:00
Chris Lattner
1eb17f15dd
Stub out a namebinding pass, fix some crash-on-invalid cases in TypeChecking.
...
Swift SVN r263
2011-03-14 06:07:44 +00:00