Commit Graph

2734 Commits

Author SHA1 Message Date
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
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